From a719d4df7356d3ca5884d506f2b2027baf29f705 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Tue, 25 Oct 2022 16:54:27 +1100 Subject: [PATCH 1/9] use private action --- .github/workflows/main.yml | 77 ++------------------------------------ 1 file changed, 4 insertions(+), 73 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7567626b3..363b46a0b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -615,83 +615,14 @@ jobs: - macOS - Windows - Linux - runs-on: [self-hosted, '${{ matrix.os }}', bench] + runs-on: [ self-hosted, '${{ matrix.os }}', bench ] env: WINDOWPOS_NAME: windowpos steps: - - name: Remove previous build. - shell: bash - run: | - rm -rf ${{ env.APP_NAME }} - rm -rf bench - - - uses: actions/download-artifact@v2 - with: - name: ${{ matrix.os }}-artifacts - path: | - ${{ env.APP_NAME }} - - - uses: actions/download-artifact@v2 - with: - name: ${{ matrix.os }}-artifacts-bench - path: | - bench - - - name: Extract binary and data. - shell: bash - run: | - cd ${{ env.APP_NAME }} - archive=$(cat release-archive.filename) - 7z x $archive -aoa - 7z x ${archive%.xz} -aoa - echo "extracted release-archive" - mv ../bench/${{ matrix.os }}.zip . - 7z x ${{ matrix.os }}.zip -aoa - echo "extracted bench data" - - - name: Run CPU Frontend Benchmark. - uses: nick-invision/retry@v2 + - uses: actions/checkout@v3 with: - shell: bash - timeout_minutes: 3 - max_attempts: 3 - retry_on: error - command: | - cd ${{ env.APP_NAME }} - if [ "$RUNNER_OS" == "Windows" ]; then - python ./bench_runner.py --frontend_cpu --executable="${GITHUB_WORKSPACE}/${{ env.APP_NAME }}/${{ env.APP_NAME }}.exe" - elif [ "$RUNNER_OS" == "macOS" ] || [ "$RUNNER_OS" == "Linux" ]; then - chmod +x "${GITHUB_WORKSPACE}/${{ env.APP_NAME }}/${{ env.APP_NAME }}" - if [ "$RUNNER_OS" == "Linux" ]; then - chmod +x "${GITHUB_WORKSPACE}/${{ env.APP_NAME }}/${{ env.WINDOWPOS_NAME }}" - fi - python ./bench_runner.py --frontend_cpu --executable="${GITHUB_WORKSPACE}/${{ env.APP_NAME }}/${{ env.APP_NAME }}" - else - echo "Invalid platform" - exit 1 - fi - - - name: Run MEM Frontend Benchmark. - uses: nick-invision/retry@v2 - with: - shell: bash - timeout_minutes: 3 - max_attempts: 3 - retry_on: error - command: | - cd ${{ env.APP_NAME }} - if [ "$RUNNER_OS" == "Windows" ]; then - python ./bench_runner.py --frontend_mem --executable="${GITHUB_WORKSPACE}/${{ env.APP_NAME }}/${{ env.APP_NAME }}.exe" - elif [ "$RUNNER_OS" == "macOS" ] || [ "$RUNNER_OS" == "Linux" ]; then - chmod +x "${GITHUB_WORKSPACE}/${{ env.APP_NAME }}/${{ env.APP_NAME }}" - if [ "$RUNNER_OS" == "Linux" ]; then - chmod +x "${GITHUB_WORKSPACE}/${{ env.APP_NAME }}/${{ env.WINDOWPOS_NAME }}" - fi - python ./bench_runner.py --frontend_mem --executable="${GITHUB_WORKSPACE}/${{ env.APP_NAME }}/${{ env.APP_NAME }}" - else - echo "Invalid platform" - exit 1 - fi + repository: swift-nav/toolbox-frontend-ci + token: ${{ secrets.GITHUB_TOKEN }} sign_binaries: name: Sign Binaries From f2848925dd4c9d6fa7bff590fcfe29f6efac49bb Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Tue, 25 Oct 2022 17:05:38 +1100 Subject: [PATCH 2/9] move backend benchmark out --- .github/workflows/main.yml | 79 ++++++-------------------------------- 1 file changed, 12 insertions(+), 67 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 363b46a0b..04e9bbc6e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Checkout source uses: actions/checkout@v2 with: @@ -48,74 +47,15 @@ jobs: with: ssh-private-key: ${{ secrets.SSH_KEY }} - - name: Run ssh-keyscan - run: ssh-keyscan github.com >> ~/.ssh/known_hosts - - - name: Setup SSH for Windows Git LFS - run: | - & "C:\\Program Files\\Git\\bin\\sh.exe" -c "ssh-keyscan github.com >> ~/.ssh/known_hosts" - & "C:\\Program Files\\Git\\bin\\sh.exe" -c "echo '${{ secrets.SSH_KEY }}' >> ~/.ssh/id_rsa" - if: matrix.os == 'windows-2019' - - - name: Install ${{ runner.os }} Dependencies. - shell: bash - run: | - if [ "$RUNNER_OS" == "Linux" ]; then - sudo apt-get update && sudo apt-get install -y capnproto libudev-dev libssl-dev - elif [ "$RUNNER_OS" == "macOS" ]; then - brew install capnp llvm - elif [ "$RUNNER_OS" == "Windows" ]; then - choco install -y capnproto - fi - - - name: Pull Git LFS objects - run: git lfs pull - env: - GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=no - - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - - uses: Swatinem/rust-cache@v1 - with: - key: ${{ secrets.CACHE_VERSION }} - - - uses: davidB/rust-cargo-make@v1 - with: - version: ${{ env.CARGO_MAKE_VERSION }} - - - name: Cache pip - uses: actions/cache@v2 + - uses: actions/checkout@v3 with: - path: ${{ env.PIP_CACHE_DIR }} - key: ${{ runner.os }}-pyproject-toml-${{ secrets.CACHE_VERSION }}-${{ hashFiles('pyproject.toml') }} - - - - name: Install ImageMagick - shell: bash - run: | - cargo make install-imagemagick - - - name: Set up python builder - shell: bash - run: | - cargo make setup-builder - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Run Backend Benchmarks (Windows) - env: - LIBCLANG_PATH: ${{ env.LIBCLANG_PATH_WIN }} - run: | - cargo make backend-benches - if: matrix.os == 'windows-2019' + repository: swift-nav/toolbox-backend-ci + token: ${{ secrets.GITHUB_TOKEN }} + path: benchmark-backend-ci - - name: Run Backend Benchmarks - run: | - cargo make backend-benches - if: matrix.os != 'windows-2019' + - run: | + ./benchmark-backend-ci + rm -rf ./benchmark-backend-ci checks: @@ -623,6 +563,11 @@ jobs: with: repository: swift-nav/toolbox-frontend-ci token: ${{ secrets.GITHUB_TOKEN }} + path: benchmark-frontend-ci + + - run: | + ./benchmark-frontend-ci + rm -rf ./benchmark-frontend-ci sign_binaries: name: Sign Binaries From 92600848dea8767f0bc0c5bda3dde9f5e31e833d Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Tue, 25 Oct 2022 17:06:27 +1100 Subject: [PATCH 3/9] typo --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 04e9bbc6e..9d12dacdf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -566,8 +566,8 @@ jobs: path: benchmark-frontend-ci - run: | - ./benchmark-frontend-ci - rm -rf ./benchmark-frontend-ci + ./benchmark-frontend-ci + rm -rf ./benchmark-frontend-ci sign_binaries: name: Sign Binaries From e2062955b479bac912a8f1e0f348d7d0b3d96c2b Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Tue, 25 Oct 2022 17:10:01 +1100 Subject: [PATCH 4/9] move dir --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9d12dacdf..5955c79ac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,10 +48,10 @@ jobs: ssh-private-key: ${{ secrets.SSH_KEY }} - uses: actions/checkout@v3 + working-directory: benchmark-backend-ci with: repository: swift-nav/toolbox-backend-ci token: ${{ secrets.GITHUB_TOKEN }} - path: benchmark-backend-ci - run: | ./benchmark-backend-ci From 25013d10f659f10287a3a23ef597192da569f816 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Tue, 25 Oct 2022 17:13:31 +1100 Subject: [PATCH 5/9] specify path --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5955c79ac..149b16d53 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,10 +48,10 @@ jobs: ssh-private-key: ${{ secrets.SSH_KEY }} - uses: actions/checkout@v3 - working-directory: benchmark-backend-ci with: repository: swift-nav/toolbox-backend-ci token: ${{ secrets.GITHUB_TOKEN }} + path: "${{ github.workspace }}/benchmark-backend-ci" - run: | ./benchmark-backend-ci From bbf19cf5a92c116cb2fd99f1342181ad187cf48d Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Tue, 25 Oct 2022 17:14:36 +1100 Subject: [PATCH 6/9] specify main branch --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 149b16d53..07310ef02 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,6 +52,7 @@ jobs: repository: swift-nav/toolbox-backend-ci token: ${{ secrets.GITHUB_TOKEN }} path: "${{ github.workspace }}/benchmark-backend-ci" + ref: "main" - run: | ./benchmark-backend-ci From c7efeadcf4ae38c5d387f0994cd7ef0790151f1b Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Tue, 25 Oct 2022 17:21:45 +1100 Subject: [PATCH 7/9] trigger ci --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 07310ef02..a86d6eab3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -564,7 +564,8 @@ jobs: with: repository: swift-nav/toolbox-frontend-ci token: ${{ secrets.GITHUB_TOKEN }} - path: benchmark-frontend-ci + path: "${{ github.workspace }}/benchmark-frontend-ci" + ref: "main" - run: | ./benchmark-frontend-ci From 1f90c3ee62e3ccd46838daca194806ea9bd2cfa9 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Tue, 25 Oct 2022 17:23:58 +1100 Subject: [PATCH 8/9] use gh token --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a86d6eab3..59bee3589 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,7 +50,7 @@ jobs: - uses: actions/checkout@v3 with: repository: swift-nav/toolbox-backend-ci - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GH_TOKEN }} path: "${{ github.workspace }}/benchmark-backend-ci" ref: "main" From b6a5aabb020b9ccfe57225b31db968e941b3bd88 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Tue, 25 Oct 2022 17:24:50 +1100 Subject: [PATCH 9/9] ignore token ? --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 59bee3589..a6e9f1c73 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,7 +50,6 @@ jobs: - uses: actions/checkout@v3 with: repository: swift-nav/toolbox-backend-ci - token: ${{ secrets.GH_TOKEN }} path: "${{ github.workspace }}/benchmark-backend-ci" ref: "main"