Skip to content

Commit

Permalink
Simplified short-benchmarks jobs with frame-omni-bencher
Browse files Browse the repository at this point in the history
  • Loading branch information
bkontur committed May 14, 2024
1 parent c03e6bd commit 87fb780
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 96 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,10 @@ cancel-pipeline-test-frame-examples-compile-to-wasm:
needs:
- job: test-frame-examples-compile-to-wasm

cancel-pipeline-build-short-benchmark:
cancel-pipeline-build-frame-omni-bencher:
extends: .cancel-pipeline-template
needs:
- job: build-short-benchmark
- job: build-frame-omni-bencher

cancel-pipeline-check-runtime-migration-rococo:
extends: .cancel-pipeline-template
Expand Down
26 changes: 0 additions & 26 deletions .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,6 @@ build-frame-omni-bencher:
- target/release/frame-omni-bencher --version
- cp ./target/release/frame-omni-bencher ./artifacts/

build-short-benchmark:
stage: build
extends:
- .docker-env
- .common-refs
- .run-immediately
- .collect-artifacts
script:
- cargo build --profile release --locked --features=runtime-benchmarks,on-chain-release-build --bin polkadot --workspace
- mkdir -p artifacts
- target/release/polkadot --version
- cp ./target/release/polkadot ./artifacts/

# build jobs from cumulus

build-linux-stable-cumulus:
Expand Down Expand Up @@ -302,19 +289,6 @@ build-runtime-testing:
- job: build-runtime-starters
artifacts: false

build-short-benchmark-cumulus:
stage: build
extends:
- .docker-env
- .common-refs
- .run-immediately
- .collect-artifacts
script:
- cargo build --profile release --locked --features=runtime-benchmarks,on-chain-release-build -p polkadot-parachain-bin --bin polkadot-parachain --workspace
- mkdir -p artifacts
- target/release/polkadot-parachain --version
- cp ./target/release/polkadot-parachain ./artifacts/

# substrate

build-linux-substrate:
Expand Down
112 changes: 44 additions & 68 deletions .gitlab/pipeline/short-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@

# Run all pallet benchmarks only once to check if there are any errors

# run short-benchmarks for relay chain runtimes from polkadot

short-benchmark-westend: &short-bench
# run short-benchmarks for specified runtime with `frame-omni-bencher`
.short-benchmark: &short-bench
stage: short-benchmarks
extends:
- .docker-env
- .common-refs
- .docker-env
needs:
- job: build-short-benchmark
- job: build-frame-omni-bencher
artifacts: true
variables:
RUNTIME: westend
PACKAGE_NAME: benchmarked-runtime-chain
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-C debug-assertions -D warnings"
Expand All @@ -24,97 +23,74 @@ short-benchmark-westend: &short-bench
tags:
- benchmark
script:
- ./artifacts/polkadot benchmark pallet --chain $RUNTIME-dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1

# run short-benchmarks for system parachain runtimes from cumulus
- RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm
- RUNTIME_BLOB_PATH=./target/release/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME
- echo "Running short benchmarking for PACKAGE_NAME=$PACKAGE_NAME and RUNTIME_BLOB_PATH=$RUNTIME_BLOB_PATH"
- time cargo build --locked --quiet --release -p $PACKAGE_NAME --features runtime-benchmarks
- ls -lrt $RUNTIME_BLOB_PATH
- time ./artifacts/frame-omni-bencher v1 benchmark pallet --runtime $RUNTIME_BLOB_PATH --all --steps 2 --repeat 1

short-benchmark-westend-runtime:
<<: *short-bench
variables:
PACKAGE_NAME: westend-runtime

.short-benchmark-cumulus: &short-bench-cumulus
stage: short-benchmarks
extends:
- .common-refs
- .docker-env
needs:
- job: build-short-benchmark-cumulus
artifacts: true
short-benchmark-rococo-runtime:
<<: *short-bench
variables:
RUNTIME_CHAIN: benchmarked-runtime-chain
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-C debug-assertions -D warnings"
RUST_BACKTRACE: "full"
WASM_BUILD_NO_COLOR: 1
WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings"
tags:
- benchmark
script:
- ./artifacts/polkadot-parachain benchmark pallet --chain $RUNTIME_CHAIN --pallet "*" --extrinsic "*" --steps 2 --repeat 1
PACKAGE_NAME: rococo-runtime

short-benchmark-asset-hub-rococo:
<<: *short-bench-cumulus
<<: *short-bench
variables:
RUNTIME_CHAIN: asset-hub-rococo-dev
PACKAGE_NAME: asset-hub-rococo-runtime

short-benchmark-asset-hub-westend:
<<: *short-bench-cumulus
<<: *short-bench
variables:
RUNTIME_CHAIN: asset-hub-westend-dev
PACKAGE_NAME: asset-hub-westend-runtime

short-benchmark-bridge-hub-rococo:
<<: *short-bench-cumulus
<<: *short-bench
variables:
RUNTIME_CHAIN: bridge-hub-rococo-dev
PACKAGE_NAME: bridge-hub-rococo-runtime

short-benchmark-bridge-hub-westend:
<<: *short-bench-cumulus
<<: *short-bench
variables:
RUNTIME_CHAIN: bridge-hub-westend-dev
PACKAGE_NAME: bridge-hub-westend-runtime

short-benchmark-collectives-westend:
<<: *short-bench-cumulus
<<: *short-bench
variables:
RUNTIME_CHAIN: collectives-westend-dev
PACKAGE_NAME: collectives-westend-runtime

short-benchmark-contracts-rococo-runtime:
<<: *short-bench
variables:
PACKAGE_NAME: contracts-rococo-runtime

short-benchmark-coretime-rococo:
<<: *short-bench-cumulus
<<: *short-bench
variables:
RUNTIME_CHAIN: coretime-rococo-dev
PACKAGE_NAME: coretime-rococo-runtime

short-benchmark-coretime-westend:
<<: *short-bench-cumulus
<<: *short-bench
variables:
RUNTIME_CHAIN: coretime-westend-dev
PACKAGE_NAME: coretime-westend-runtime

short-benchmark-people-rococo:
<<: *short-bench-cumulus
<<: *short-bench
variables:
RUNTIME_CHAIN: people-rococo-dev
PACKAGE_NAME: people-rococo-runtime

short-benchmark-people-westend:
<<: *short-bench-cumulus
<<: *short-bench
variables:
RUNTIME_CHAIN: people-westend-dev
PACKAGE_NAME: people-westend-runtime

short-benchmark-glutton-westend:
<<: *short-bench-cumulus
variables:
RUNTIME_CHAIN: glutton-westend-dev-1300

quick-benchmarks-omni:
stage: short-benchmarks
extends:
- .docker-env
- .common-refs
- .run-immediately
needs:
- job: build-frame-omni-bencher
artifacts: true
<<: *short-bench
variables:
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-C debug-assertions"
RUST_BACKTRACE: "full"
WASM_BUILD_NO_COLOR: 1
WASM_BUILD_RUSTFLAGS: "-C debug-assertions"
script:
- time cargo build --locked --quiet --release -p asset-hub-westend-runtime --features runtime-benchmarks
- time ./artifacts/frame-omni-bencher v1 benchmark pallet --runtime target/release/wbuild/asset-hub-westend-runtime/asset_hub_westend_runtime.compact.compressed.wasm --all --steps 2 --repeat 1 --quiet
PACKAGE_NAME: glutton-westend-runtime

0 comments on commit 87fb780

Please sign in to comment.