From d512ea4ae1f90cc8e114ccf38744883f7b6a2e5d Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 3 Jan 2025 10:07:42 +0100 Subject: [PATCH 1/5] [WIP] Fix networking-benchmarks --- .github/workflows/networking-benchmarks.yml | 72 +++++++++++---------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/.github/workflows/networking-benchmarks.yml b/.github/workflows/networking-benchmarks.yml index e45ae601105d..84b4a1177636 100644 --- a/.github/workflows/networking-benchmarks.yml +++ b/.github/workflows/networking-benchmarks.yml @@ -4,6 +4,8 @@ on: push: branches: - master + pull_request: + types: [opened, synchronize, reopened, ready_for_review] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -27,12 +29,8 @@ jobs: matrix: features: [ - { - bench: "notifications_protocol", - }, - { - bench: "request_response_protocol", - }, + { bench: "notifications_protocol" }, + { bench: "request_response_protocol" }, ] steps: - name: Checkout @@ -54,8 +52,8 @@ jobs: publish-benchmarks: timeout-minutes: 60 needs: [build] - if: github.ref == 'refs/heads/master' - environment: subsystem-benchmarks + # if: github.ref == 'refs/heads/master' + # environment: subsystem-benchmarks runs-on: ubuntu-latest steps: - name: Checkout @@ -69,7 +67,13 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v4.1.8 with: - name: networking-bench-${{ github.sha }} + name: notifications_protocol-${{ github.sha }} + path: ./charts + + - name: Download artifacts + uses: actions/download-artifact@v4.1.8 + with: + name: request_response_protocol-${{ github.sha }} path: ./charts - name: Setup git @@ -78,30 +82,30 @@ jobs: git config --global --add safe.directory '*' ls -lsR ./charts - - uses: actions/create-github-app-token@v1 - id: app-token - with: - app-id: ${{ secrets.POLKADOTSDK_GHPAGES_APP_ID }} - private-key: ${{ secrets.POLKADOTSDK_GHPAGES_APP_KEY }} + # - uses: actions/create-github-app-token@v1 + # id: app-token + # with: + # app-id: ${{ secrets.POLKADOTSDK_GHPAGES_APP_ID }} + # private-key: ${{ secrets.POLKADOTSDK_GHPAGES_APP_KEY }} - - name: Generate ${{ env.BENCH }} - env: - BENCH: notifications_protocol - uses: benchmark-action/github-action-benchmark@v1 - with: - tool: "cargo" - output-file-path: ./charts/${{ env.BENCH }}.txt - benchmark-data-dir-path: ./bench/${{ env.BENCH }} - github-token: ${{ steps.app-token.outputs.token }} - auto-push: true + # - name: Generate ${{ env.BENCH }} + # env: + # BENCH: notifications_protocol + # uses: benchmark-action/github-action-benchmark@v1 + # with: + # tool: "cargo" + # output-file-path: ./charts/${{ env.BENCH }}.txt + # benchmark-data-dir-path: ./bench/${{ env.BENCH }} + # github-token: ${{ steps.app-token.outputs.token }} + # auto-push: true - - name: Generate ${{ env.BENCH }} - env: - BENCH: request_response_protocol - uses: benchmark-action/github-action-benchmark@v1 - with: - tool: "cargo" - output-file-path: ./charts/${{ env.BENCH }}.txt - benchmark-data-dir-path: ./bench/${{ env.BENCH }} - github-token: ${{ steps.app-token.outputs.token }} - auto-push: true + # - name: Generate ${{ env.BENCH }} + # env: + # BENCH: request_response_protocol + # uses: benchmark-action/github-action-benchmark@v1 + # with: + # tool: "cargo" + # output-file-path: ./charts/${{ env.BENCH }}.txt + # benchmark-data-dir-path: ./bench/${{ env.BENCH }} + # github-token: ${{ steps.app-token.outputs.token }} + # auto-push: true From 15da5b949682c25ba76b5d9e38f7e902b30de882 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 3 Jan 2025 11:03:45 +0100 Subject: [PATCH 2/5] rename file, decrease timeout --- .github/workflows/networking-benchmarks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/networking-benchmarks.yml b/.github/workflows/networking-benchmarks.yml index 84b4a1177636..577f00e9ad10 100644 --- a/.github/workflows/networking-benchmarks.yml +++ b/.github/workflows/networking-benchmarks.yml @@ -19,7 +19,7 @@ jobs: uses: ./.github/workflows/reusable-preflight.yml build: - timeout-minutes: 80 + timeout-minutes: 30 needs: [preflight] runs-on: ${{ needs.preflight.outputs.RUNNER_BENCHMARK }} container: @@ -40,7 +40,7 @@ jobs: id: run-benchmarks run: | mkdir -p ./charts - forklift cargo bench -p sc-network --bench ${{ matrix.features.bench }} -- --output-format bencher | grep "^test" | tee ./charts/networking-bench.txt || echo "Benchmarks failed" + forklift cargo bench -p sc-network --bench ${{ matrix.features.bench }} -- --output-format bencher | grep "^test" | tee ./charts/${{ matrix.features.bench }}.txt || echo "Benchmarks failed" ls -lsa ./charts - name: Upload artifacts From 2cc1c090c3d70ad7be37aa85042c82624dfca566 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 3 Jan 2025 11:56:21 +0100 Subject: [PATCH 3/5] timeout --- .github/workflows/networking-benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/networking-benchmarks.yml b/.github/workflows/networking-benchmarks.yml index 577f00e9ad10..029a18acac62 100644 --- a/.github/workflows/networking-benchmarks.yml +++ b/.github/workflows/networking-benchmarks.yml @@ -19,7 +19,7 @@ jobs: uses: ./.github/workflows/reusable-preflight.yml build: - timeout-minutes: 30 + timeout-minutes: 50 needs: [preflight] runs-on: ${{ needs.preflight.outputs.RUNNER_BENCHMARK }} container: From f0e5d3ce33effd6abd3b645c996995f24d90af7d Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 3 Jan 2025 12:36:37 +0100 Subject: [PATCH 4/5] rm debug --- .github/workflows/networking-benchmarks.yml | 56 ++++++++++----------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/.github/workflows/networking-benchmarks.yml b/.github/workflows/networking-benchmarks.yml index 029a18acac62..79494b9a015c 100644 --- a/.github/workflows/networking-benchmarks.yml +++ b/.github/workflows/networking-benchmarks.yml @@ -4,8 +4,6 @@ on: push: branches: - master - pull_request: - types: [opened, synchronize, reopened, ready_for_review] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -52,8 +50,8 @@ jobs: publish-benchmarks: timeout-minutes: 60 needs: [build] - # if: github.ref == 'refs/heads/master' - # environment: subsystem-benchmarks + if: github.ref == 'refs/heads/master' + environment: subsystem-benchmarks runs-on: ubuntu-latest steps: - name: Checkout @@ -82,30 +80,30 @@ jobs: git config --global --add safe.directory '*' ls -lsR ./charts - # - uses: actions/create-github-app-token@v1 - # id: app-token - # with: - # app-id: ${{ secrets.POLKADOTSDK_GHPAGES_APP_ID }} - # private-key: ${{ secrets.POLKADOTSDK_GHPAGES_APP_KEY }} + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ secrets.POLKADOTSDK_GHPAGES_APP_ID }} + private-key: ${{ secrets.POLKADOTSDK_GHPAGES_APP_KEY }} - # - name: Generate ${{ env.BENCH }} - # env: - # BENCH: notifications_protocol - # uses: benchmark-action/github-action-benchmark@v1 - # with: - # tool: "cargo" - # output-file-path: ./charts/${{ env.BENCH }}.txt - # benchmark-data-dir-path: ./bench/${{ env.BENCH }} - # github-token: ${{ steps.app-token.outputs.token }} - # auto-push: true + - name: Generate ${{ env.BENCH }} + env: + BENCH: notifications_protocol + uses: benchmark-action/github-action-benchmark@v1 + with: + tool: "cargo" + output-file-path: ./charts/${{ env.BENCH }}.txt + benchmark-data-dir-path: ./bench/${{ env.BENCH }} + github-token: ${{ steps.app-token.outputs.token }} + auto-push: true - # - name: Generate ${{ env.BENCH }} - # env: - # BENCH: request_response_protocol - # uses: benchmark-action/github-action-benchmark@v1 - # with: - # tool: "cargo" - # output-file-path: ./charts/${{ env.BENCH }}.txt - # benchmark-data-dir-path: ./bench/${{ env.BENCH }} - # github-token: ${{ steps.app-token.outputs.token }} - # auto-push: true + - name: Generate ${{ env.BENCH }} + env: + BENCH: request_response_protocol + uses: benchmark-action/github-action-benchmark@v1 + with: + tool: "cargo" + output-file-path: ./charts/${{ env.BENCH }}.txt + benchmark-data-dir-path: ./bench/${{ env.BENCH }} + github-token: ${{ steps.app-token.outputs.token }} + auto-push: true From 4677d7faca069ec0fe18e800b5cb90c5d272289c Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 3 Jan 2025 12:37:33 +0100 Subject: [PATCH 5/5] rename benchmarks workflows --- .../{networking-benchmarks.yml => benchmarks-networking.yml} | 0 .../{subsystem-benchmarks.yml => benchmarks-subsystem.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{networking-benchmarks.yml => benchmarks-networking.yml} (100%) rename .github/workflows/{subsystem-benchmarks.yml => benchmarks-subsystem.yml} (100%) diff --git a/.github/workflows/networking-benchmarks.yml b/.github/workflows/benchmarks-networking.yml similarity index 100% rename from .github/workflows/networking-benchmarks.yml rename to .github/workflows/benchmarks-networking.yml diff --git a/.github/workflows/subsystem-benchmarks.yml b/.github/workflows/benchmarks-subsystem.yml similarity index 100% rename from .github/workflows/subsystem-benchmarks.yml rename to .github/workflows/benchmarks-subsystem.yml