Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
[Do not merge] add benchmarks to pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
alvicsam committed Mar 9, 2022
1 parent 1f94506 commit af3cca0
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 51 deletions.
38 changes: 23 additions & 15 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@
#
# pipelines can be triggered manually in the web

default:
interruptible: true
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure

stages:
- test
- publish
- benchmarks

variables: &default-vars
GIT_STRATEGY: fetch
Expand Down Expand Up @@ -39,32 +48,18 @@ variables: &default-vars
- *rust-info-script
- ./scripts/ci/pre_cache.sh
- sccache -s
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure
interruptible: true
tags:
- linux-docker

.kubernetes-env: &kubernetes-env
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure
interruptible: true
tags:
- kubernetes-parity-build

.collect-artifacts: &collect-artifacts
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: on_success
expire_in: 28 days
expire_in: 7 days
paths:
- ./artifacts/

Expand Down Expand Up @@ -172,3 +167,16 @@ publish-s3:
after_script:
- aws s3 ls s3://${BUCKET}/${PREFIX}/latest/
--recursive --human-readable --summarize

#### stage: benchmarks

benchmark-pallet-assets:
stage: benchmarks
<<: *docker-env
variables:
PALLET: "pallet_assets"
script:
- time cargo build --profile production --locked --features runtime-benchmarks
- ./scripts/benchmarks.sh $PALLET
tags:
- linux-docker-benches
72 changes: 36 additions & 36 deletions scripts/benchmarks.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

PALLET=$1

steps=50
repeat=20

Expand All @@ -25,41 +27,39 @@ pallets=(
frame_system
)

for p in ${pallets[@]}
do
./target/production/polkadot-collator benchmark \
--chain=$statemineChain \
--execution=wasm \
--wasm-execution=compiled \
--pallet=$p \
--extrinsic='*' \
--steps=$steps \
--repeat=$repeat \
--json \
--header=./file_header.txt \
--output=$statemineOutput

./target/production/polkadot-collator benchmark \
--chain=$statemintChain \
--execution=wasm \
--wasm-execution=compiled \
--pallet=$p \
--extrinsic='*' \
--steps=$steps \
--repeat=$repeat \
--json \
--header=./file_header.txt \
--output=$statemintOutput
./target/production/polkadot-collator benchmark \
--chain=$statemineChain \
--execution=wasm \
--wasm-execution=compiled \
--pallet=$PALLET \
--extrinsic='*' \
--steps=$steps \
--repeat=$repeat \
--json \
--header=./file_header.txt \
--output=$statemineOutput

./target/production/polkadot-collator benchmark \
--chain=$statemintChain \
--execution=wasm \
--wasm-execution=compiled \
--pallet=$PALLET \
--extrinsic='*' \
--steps=$steps \
--repeat=$repeat \
--json \
--header=./file_header.txt \
--output=$statemintOutput

./target/production/polkadot-collator benchmark \
--chain=$westmintChain \
--execution=wasm \
--wasm-execution=compiled \
--pallet=$p \
--extrinsic='*' \
--steps=$steps \
--repeat=$repeat \
--json \
--header=./file_header.txt \
--output=$westmintOutput
done
./target/production/polkadot-collator benchmark \
--chain=$westmintChain \
--execution=wasm \
--wasm-execution=compiled \
--pallet=$PALLET \
--extrinsic='*' \
--steps=$steps \
--repeat=$repeat \
--json \
--header=./file_header.txt \
--output=$westmintOutput

0 comments on commit af3cca0

Please sign in to comment.