-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add workflow for networking benchmarks #7029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8334a60
Add workflow for networking benchmarks
AndreiEres d1728ec
Add debug
AndreiEres ab0acea
Add missing name
AndreiEres 5b8ca9d
Fix params
AndreiEres 6977087
Split benches
AndreiEres d5f5bba
Clean output file
AndreiEres 70f55a9
Fix grep
AndreiEres e994c3e
Remove debug
AndreiEres d8e2585
Update .github/workflows/networking-benchmarks.yml
AndreiEres e395c12
Merge branch 'master' into AndreiEres/networking-charts
AndreiEres cab2de7
Trigger CI
AndreiEres File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| name: Networking Benchmarks | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| preflight: | ||
| uses: ./.github/workflows/reusable-preflight.yml | ||
|
|
||
| build: | ||
| timeout-minutes: 80 | ||
| needs: [preflight] | ||
| runs-on: ${{ needs.preflight.outputs.RUNNER }} | ||
| container: | ||
| image: ${{ needs.preflight.outputs.IMAGE }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| features: | ||
| [ | ||
| { | ||
| bench: "notifications_protocol", | ||
| }, | ||
| { | ||
| bench: "request_response_protocol", | ||
| }, | ||
| ] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run Benchmarks | ||
| 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" | ||
| ls -lsa ./charts | ||
|
|
||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v4.3.6 | ||
| with: | ||
| name: ${{ matrix.features.bench }}-${{ github.sha }} | ||
| path: ./charts | ||
|
|
||
| publish-benchmarks: | ||
| timeout-minutes: 60 | ||
| needs: [build] | ||
| if: github.ref == 'refs/heads/master' | ||
| environment: subsystem-benchmarks | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: gh-pages | ||
| fetch-depth: 0 | ||
|
|
||
| - run: git checkout master -- | ||
|
|
||
| - name: Download artifacts | ||
| uses: actions/download-artifact@v4.1.8 | ||
| with: | ||
| name: networking-bench-${{ github.sha }} | ||
| path: ./charts | ||
|
|
||
| - name: Setup git | ||
| run: | | ||
| # Fixes "detected dubious ownership" error in the ci | ||
| 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 }} | ||
|
|
||
| - 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 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.