Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
bench in parallel as separate jobs
  • Loading branch information
gilescope committed Jul 6, 2022
commit c29bd8c914e633ccf16f1e427d6efc38b10b8da6
36 changes: 33 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ benchmarks-build:
- mkdir artifacts
- cp target/production/polkadot-parachain ./artifacts/

benchmarks:
benchmarks-statemint:
stage: benchmarks-run
before_script:
- *rust-info-script
Expand All @@ -288,7 +288,7 @@ benchmarks:
- ./scripts/benchmarks-ci.sh assets statemint ./artifacts > ./artifacts/bench-statemint.log
- ./scripts/benchmarks-ci.sh assets westmint ./artifacts > ./artifacts/bench-westmint.log
- git status
- export BRANCHNAME="weights-${CI_COMMIT_BRANCH}"
- export BRANCHNAME="weights-statemint-${CI_COMMIT_BRANCH}"
# Set git config
- rm -rf .git/config
- git config --global user.email "${GITHUB_EMAIL}"
Expand All @@ -302,7 +302,37 @@ benchmarks:
- git push origin $BRANCHNAME
# create PR
- curl -u ${GITHUB_USER}:${GITHUB_TOKEN}
-d '{"title":"[benchmarks] Update weights","body":"This PR is generated automatically by CI.","head":"'$BRANCHNAME'","base":"'${CI_COMMIT_BRANCH}'"}'
-d '{"title":"[benchmarks] Update weights for statemine/t","body":"This PR is generated automatically by CI.","head":"'$BRANCHNAME'","base":"'${CI_COMMIT_BRANCH}'"}'
-X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls
after_script:
- rm -rf .git/config
tags:
- weights

benchmarks-collectives:
stage: benchmarks-run
before_script:
- *rust-info-script
<<: *collect-artifacts
<<: *benchmarks-refs
script:
- ./scripts/benchmarks-ci.sh collectives collectives-polkadot ./artifacts > ./artifacts/bench-statemine.log
- git status
- export BRANCHNAME="weights-collectives-${CI_COMMIT_BRANCH}"
# Set git config
- rm -rf .git/config
- git config --global user.email "${GITHUB_EMAIL}"
- git config --global user.name "${GITHUB_USER}"
- git config remote.origin.url "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/paritytech/${CI_PROJECT_NAME}.git"
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
# push results to github
- git checkout -b $BRANCHNAME
- git add parachains/*
- git commit -m "[benchmarks] pr with weights"
- git push origin $BRANCHNAME
# create PR
- curl -u ${GITHUB_USER}:${GITHUB_TOKEN}
-d '{"title":"[benchmarks] Update weights for collectives","body":"This PR is generated automatically by CI.","head":"'$BRANCHNAME'","base":"'${CI_COMMIT_BRANCH}'"}'
-X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls
after_script:
- rm -rf .git/config
Expand Down
51 changes: 36 additions & 15 deletions scripts/benchmarks-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,42 @@ artifactsDir=$3
benchmarkOutput=./parachains/runtimes/$category/$runtimeName/src/weights
benchmarkRuntimeName="$runtimeName-dev"

pallets=(
pallet_alliance
pallet_assets
pallet_balances
pallet_collator_selection
pallet_collective
pallet_multisig
pallet_proxy
pallet_session
pallet_timestamp
pallet_utility
pallet_uniques
cumulus_pallet_xcmp_queue
frame_system
)
if [[ $runtimeName -eq "statemint" ]] || [[ $runtimeName -eq "statemine" ]] || [[ $runtimeName -eq "westmint" ]]
then
pallets=(
pallet_assets
pallet_balances
pallet_collator_selection
pallet_multisig
pallet_proxy
pallet_session
pallet_timestamp
pallet_utility
pallet_uniques
cumulus_pallet_xcmp_queue
frame_system
)
else
if [[ $runtimeName -eq "collectives-polkadot" ]]
pallets=(
pallet_alliance
pallet_balances
pallet_collator_selection
pallet_collective
pallet_multisig
pallet_proxy
pallet_session
pallet_timestamp
pallet_utility
cumulus_pallet_xcmp_queue
frame_system
)
then
else
echo "$runtimeName pallet list not found in benchmarks-ci.sh"
exit 1
fi
fi

for p in ${pallets[@]}
do
Expand Down
6 changes: 5 additions & 1 deletion scripts/benchmarks.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env bash

__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

${__dir}/benchmarks-ci.sh collectives collectives-polkadot target/production

${__dir}/benchmarks-ci.sh assets statemine target/production
${__dir}/benchmarks-ci.sh assets statemint target/production
${__dir}/benchmarks-ci.sh assets westmint target/production
${__dir}/benchmarks-ci.sh assets westmint target/production