From 87fb78034d06cd506bd607eac663b466d99c501a Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 14 May 2024 11:17:14 +0200 Subject: [PATCH] Simplified short-benchmarks jobs with `frame-omni-bencher` --- .gitlab-ci.yml | 4 +- .gitlab/pipeline/build.yml | 26 ------ .gitlab/pipeline/short-benchmarks.yml | 112 ++++++++++---------------- 3 files changed, 46 insertions(+), 96 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 73a8c52c448f..296501a3261b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/.gitlab/pipeline/build.yml b/.gitlab/pipeline/build.yml index 47efeff3a7eb..547c415353b0 100644 --- a/.gitlab/pipeline/build.yml +++ b/.gitlab/pipeline/build.yml @@ -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: @@ -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: diff --git a/.gitlab/pipeline/short-benchmarks.yml b/.gitlab/pipeline/short-benchmarks.yml index 9866328758f6..742b416bce77 100644 --- a/.gitlab/pipeline/short-benchmarks.yml +++ b/.gitlab/pipeline/short-benchmarks.yml @@ -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" @@ -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