Skip to content
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

bench all weekly - and fix for pallet_multisig lib #6789

Merged
merged 27 commits into from
Jan 24, 2025
Merged
Changes from 14 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e88c85e
bench all weekly - test
mordamax Dec 7, 2024
110426f
fix artifact name
mordamax Dec 7, 2024
7526bba
Update bench-update-weights.yml
mordamax Dec 8, 2024
b744c35
Update bench-update-weights.yml
mordamax Dec 8, 2024
9b2ce6c
Update bench-update-weights.yml
mordamax Dec 8, 2024
a23577a
Update bench-update-weights.yml
mordamax Dec 8, 2024
74bbdda
apply real bench
mordamax Dec 8, 2024
735ee8d
Update bench-update-weights.yml
mordamax Dec 8, 2024
0ac4002
increase timeout
mordamax Dec 8, 2024
81841a5
add auth
mordamax Dec 9, 2024
1bc4f70
merge master
mordamax Dec 9, 2024
d1ace92
Update bench-update-weights-weekly.yml
mordamax Dec 9, 2024
52d811a
Merge branch 'master' into mak-weekly-bench
mordamax Jan 16, 2025
10dbef2
Merge branch 'master' into mak-weekly-bench
mordamax Jan 17, 2025
f5171a4
switch to workflow_dispatch
mordamax Jan 17, 2025
c1323a8
rename workflow
mordamax Jan 17, 2025
2d4ea30
Merge branch 'master' into mak-weekly-bench
mordamax Jan 17, 2025
3115a27
go
mordamax Jan 17, 2025
a1cca9f
workflow_dispatch, --unidiff-zero
mordamax Jan 21, 2025
f6f51be
Update from mordamax running command 'bench --runtime dev --pallet pa…
Jan 21, 2025
0a6cc41
Update lib.rs
mordamax Jan 22, 2025
9b781e2
Update from mordamax running command 'bench --pallet pallet_multisig'
Jan 22, 2025
113a5a1
fix weights 2 args
mordamax Jan 22, 2025
f2962f3
Update from mordamax running command 'bench --pallet pallet_multisig …
github-actions[bot] Jan 23, 2025
3b644ec
Simplify Multisig benchmark
ggwpez Jan 23, 2025
6a93c44
Update from mordamax running command 'bench --pallet pallet_multisig …
github-actions[bot] Jan 23, 2025
4adc661
remove 2nd param
mordamax Jan 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 132 additions & 0 deletions .github/workflows/bench-update-weights-weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Weekly update of benchmarks (frame-omni-bencher)

on:
schedule:
- cron: '0 1 * * 0' # weekly on Sunday night 01:00 UTC

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: |
# only first two runtimes
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:
runs-on: ${{ needs.preflight.outputs.RUNNER_WEIGHTS }}
needs: [preflight, runtime-matrix]
timeout-minutes: 1440 # 24 hours per runtime
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 '*'
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
git diff HEAD > diff-${{ matrix.runtime.name }}.patch

- 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

- 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 from artifacts folder
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
# scan all patch files in the patches directory
for file in patches/diff-*/diff-*.patch; do
if [ -f "$file" ]; then
echo "Applying $file"
git apply "$file"
fi
done
DATE=$(date +'%Y-%m-%d-%s')
BRANCH="update-weights-weekly-$DATE"
rm -rf patches

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

git checkout -b "$BRANCH"
git status
git add .
git commit -m "Update all weights weekly for $DATE"
git push --set-upstream origin "$BRANCH"
git status
gh pr create --title "Update weights weekly for $DATE" --body "Update weights weekly for $DATE"
Loading