-
Notifications
You must be signed in to change notification settings - Fork 1.2k
bench all weekly - and fix for pallet_multisig lib #6789
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 24 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
e88c85e
bench all weekly - test
mordamax 110426f
fix artifact name
mordamax 7526bba
Update bench-update-weights.yml
mordamax b744c35
Update bench-update-weights.yml
mordamax 9b2ce6c
Update bench-update-weights.yml
mordamax a23577a
Update bench-update-weights.yml
mordamax 74bbdda
apply real bench
mordamax 735ee8d
Update bench-update-weights.yml
mordamax 0ac4002
increase timeout
mordamax 81841a5
add auth
mordamax 1bc4f70
merge master
mordamax d1ace92
Update bench-update-weights-weekly.yml
mordamax 52d811a
Merge branch 'master' into mak-weekly-bench
mordamax 10dbef2
Merge branch 'master' into mak-weekly-bench
mordamax f5171a4
switch to workflow_dispatch
mordamax c1323a8
rename workflow
mordamax 2d4ea30
Merge branch 'master' into mak-weekly-bench
mordamax 3115a27
go
mordamax a1cca9f
workflow_dispatch, --unidiff-zero
mordamax f6f51be
Update from mordamax running command 'bench --runtime dev --pallet pa…
0a6cc41
Update lib.rs
mordamax 9b781e2
Update from mordamax running command 'bench --pallet pallet_multisig'
113a5a1
fix weights 2 args
mordamax f2962f3
Update from mordamax running command 'bench --pallet pallet_multisig …
github-actions[bot] 3b644ec
Simplify Multisig benchmark
ggwpez 6a93c44
Update from mordamax running command 'bench --pallet pallet_multisig …
github-actions[bot] 4adc661
remove 2nd param
mordamax 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,165 @@ | ||
| name: Bench all runtimes | ||
|
|
||
| on: | ||
| # schedule: | ||
| # - cron: '0 1 * * 0' # weekly on Sunday night 01:00 UTC | ||
| workflow_dispatch: | ||
| # pull_request: | ||
|
|
||
| permissions: # allow the action to create a PR | ||
| contents: write | ||
| issues: write | ||
| pull-requests: write | ||
| actions: read | ||
|
|
||
| jobs: | ||
| preflight: | ||
| uses: ./.github/workflows/reusable-preflight.yml | ||
|
|
||
| runtime-matrix: | ||
| runs-on: ubuntu-latest | ||
| needs: [preflight] | ||
| timeout-minutes: 30 | ||
| outputs: | ||
| runtime: ${{ steps.runtime.outputs.runtime }} | ||
| container: | ||
| image: ${{ needs.preflight.outputs.IMAGE }} | ||
| name: Extract runtimes from matrix | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - id: runtime | ||
| run: | | ||
| RUNTIMES=$(jq '[.[] | select(.package != null)]' .github/workflows/runtimes-matrix.json) | ||
|
|
||
| RUNTIMES=$(echo $RUNTIMES | jq -c .) | ||
| echo "runtime=$RUNTIMES" | ||
| echo "runtime=$RUNTIMES" >> $GITHUB_OUTPUT | ||
|
|
||
| run-frame-omni-bencher: | ||
| needs: [preflight, runtime-matrix] | ||
| runs-on: ${{ needs.preflight.outputs.RUNNER_WEIGHTS }} | ||
| # 24 hours per runtime. | ||
| # Max it takes 14hr for westend to recalculate, but due to limited runners, | ||
| # sometimes it can take longer. | ||
| timeout-minutes: 1440 | ||
| strategy: | ||
| fail-fast: false # keep running other workflows even if one fails, to see the logs of all possible failures | ||
| matrix: | ||
| runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }} | ||
| container: | ||
| image: ${{ needs.preflight.outputs.IMAGE }} | ||
| env: | ||
| PACKAGE_NAME: ${{ matrix.runtime.package }} | ||
| FLAGS: ${{ matrix.runtime.bench_flags }} | ||
| RUST_LOG: "frame_omni_bencher=info,polkadot_sdk_frame=info" | ||
| steps: | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: master | ||
|
|
||
| - name: script | ||
| id: required | ||
| run: | | ||
| # Fixes "detected dubious ownership" error in the ci | ||
| git config --global --add safe.directory $GITHUB_WORKSPACE | ||
| git remote -v | ||
| python3 -m pip install -r .github/scripts/generate-prdoc.requirements.txt | ||
| python3 .github/scripts/cmd/cmd.py bench --runtime ${{ matrix.runtime.name }} | ||
| git add . | ||
| git status | ||
|
|
||
| if [ -f /tmp/cmd/command_output.log ]; then | ||
| CMD_OUTPUT=$(cat /tmp/cmd/command_output.log) | ||
| # export to summary to display in the PR | ||
| echo "$CMD_OUTPUT" >> $GITHUB_STEP_SUMMARY | ||
| # should be multiline, otherwise it captures the first line only | ||
| echo 'cmd_output<<EOF' >> $GITHUB_OUTPUT | ||
| echo "$CMD_OUTPUT" >> $GITHUB_OUTPUT | ||
| echo 'EOF' >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| # Create patch that includes both modifications and new files | ||
| git add -A | ||
| git diff --staged > diff-${{ matrix.runtime.name }}.patch -U0 | ||
| git reset | ||
|
|
||
| - name: Upload diff | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: diff-${{ matrix.runtime.name }} | ||
| path: diff-${{ matrix.runtime.name }}.patch | ||
|
|
||
| apply-diff-commit: | ||
| runs-on: ubuntu-latest | ||
| needs: [run-frame-omni-bencher] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: master | ||
|
|
||
| - name: Download all artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: patches | ||
|
|
||
| - name: Install subweight | ||
| run: cargo install subweight | ||
|
|
||
| # needs to be able to trigger CI | ||
| - uses: actions/create-github-app-token@v1 | ||
| id: generate_token | ||
| with: | ||
| app-id: ${{ secrets.CMD_BOT_APP_ID }} | ||
| private-key: ${{ secrets.CMD_BOT_APP_KEY }} | ||
|
|
||
| - name: Apply diff and create PR | ||
| env: | ||
| GH_TOKEN: ${{ steps.generate_token.outputs.token }} | ||
| run: | | ||
| DATE=$(date +'%Y-%m-%d-%s') | ||
| BRANCH="update-weights-weekly-$DATE" | ||
|
|
||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| git switch -c "$BRANCH" | ||
|
|
||
| for file in patches/diff-*/diff-*.patch; do | ||
| if [ -f "$file" ] && [ -s "$file" ]; then | ||
| echo "Applying $file" | ||
| git apply "$file" --unidiff-zero --allow-empty || echo "Failed to apply $file" | ||
| else | ||
| echo "Skipping empty or non-existent patch file: $file" | ||
| fi | ||
| done | ||
| rm -rf patches | ||
|
|
||
| git add . | ||
| git commit -m "Update all weights weekly for $DATE" | ||
| git push --set-upstream origin "$BRANCH" | ||
|
|
||
| PR_TITLE="Auto-update of all weights for $DATE" | ||
| gh pr create \ | ||
| --title "$PR_TITLE" \ | ||
| --head "$BRANCH" \ | ||
| --base "master" \ | ||
| --reviewer paritytech/ci \ | ||
| --reviewer paritytech/release-engineering \ | ||
| --draft \ | ||
| --label "R0-silent" \ | ||
| --body "$PR_TITLE" | ||
|
|
||
| subweight compare commits \ | ||
| --path-pattern "./**/weights/**/*.rs,./**/weights.rs" \ | ||
| --method asymptotic \ | ||
| --format markdown \ | ||
| --no-color \ | ||
| --change added changed \ | ||
| --ignore-errors \ | ||
| --threshold 2 \ | ||
| origin/master $BRANCH | ||
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
Oops, something went wrong.
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.