From af3cca09f2bbec7ab75e1e905314356ce4405a6f Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 9 Mar 2022 11:05:50 +0100 Subject: [PATCH 01/34] [Do not merge] add benchmarks to pipeline --- .gitlab-ci.yml | 38 ++++++++++++++--------- scripts/benchmarks.sh | 72 +++++++++++++++++++++---------------------- 2 files changed, 59 insertions(+), 51 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 04151c92d4f..a4019e0c723 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 @@ -39,24 +48,10 @@ 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 @@ -64,7 +59,7 @@ variables: &default-vars artifacts: name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}" when: on_success - expire_in: 28 days + expire_in: 7 days paths: - ./artifacts/ @@ -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 diff --git a/scripts/benchmarks.sh b/scripts/benchmarks.sh index 5ca8d4d4601..ee7cee505f9 100755 --- a/scripts/benchmarks.sh +++ b/scripts/benchmarks.sh @@ -1,5 +1,7 @@ #!/bin/bash +PALLET=$1 + steps=50 repeat=20 @@ -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 From fd948a57651aa1fa9b5b42988cc6c78d697c77e2 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 9 Mar 2022 11:12:19 +0100 Subject: [PATCH 02/34] disable jobs for test --- .gitlab-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a4019e0c723..9eb1e1367d0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -65,7 +65,7 @@ variables: &default-vars #### stage: test -test-linux-stable: +.test-linux-stable: stage: test <<: *docker-env rules: @@ -103,7 +103,7 @@ test-linux-stable: fi - sccache -s -check-runtime-benchmarks: +.check-runtime-benchmarks: stage: test <<: *docker-env script: @@ -113,7 +113,7 @@ check-runtime-benchmarks: - time cargo check -p parachain-template-node --features runtime-benchmarks - sccache -s -cargo-check-try-runtime: +.cargo-check-try-runtime: stage: test <<: *docker-env script: @@ -123,14 +123,14 @@ cargo-check-try-runtime: - time cargo check -p parachain-template-node --features try-runtime - sccache -s -cargo-check-benches: +.cargo-check-benches: stage: test <<: *docker-env script: - time cargo check --all --benches - sccache -s -check-rustdoc: +.check-rustdoc: stage: test <<: *docker-env variables: From 7d3c3f2bc41a18ff103b9a4386bdc881299119af Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 11 Mar 2022 13:25:24 +0100 Subject: [PATCH 03/34] Revert "[Do not merge] add benchmarks to pipeline" This reverts commit af3cca09f2bbec7ab75e1e905314356ce4405a6f. --- .gitlab-ci.yml | 38 +++++++++-------------- scripts/benchmarks.sh | 72 +++++++++++++++++++++---------------------- 2 files changed, 51 insertions(+), 59 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9eb1e1367d0..484b102faa8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,19 +4,10 @@ # # 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 @@ -48,10 +39,24 @@ 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 @@ -59,7 +64,7 @@ variables: &default-vars artifacts: name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}" when: on_success - expire_in: 7 days + expire_in: 28 days paths: - ./artifacts/ @@ -167,16 +172,3 @@ 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 diff --git a/scripts/benchmarks.sh b/scripts/benchmarks.sh index ee7cee505f9..5ca8d4d4601 100755 --- a/scripts/benchmarks.sh +++ b/scripts/benchmarks.sh @@ -1,7 +1,5 @@ #!/bin/bash -PALLET=$1 - steps=50 repeat=20 @@ -27,39 +25,41 @@ 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=$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=$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=$westmintChain \ - --execution=wasm \ - --wasm-execution=compiled \ - --pallet=$PALLET \ - --extrinsic='*' \ - --steps=$steps \ - --repeat=$repeat \ - --json \ - --header=./file_header.txt \ - --output=$westmintOutput + ./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 From 070612b98f646029ab35fa2a5e7cf623c3b17eb7 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 11 Mar 2022 13:41:29 +0100 Subject: [PATCH 04/34] add weights tag --- .gitlab-ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 484b102faa8..553aa0e9f41 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -172,3 +172,17 @@ 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 + - git status + tags: + - weights From 19af0643fefda395821b2b12e29ad1c767a1a9bc Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 11 Mar 2022 13:42:38 +0100 Subject: [PATCH 05/34] add stage --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 553aa0e9f41..06f85df9070 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,7 @@ stages: - test - publish + - benchmarks variables: &default-vars GIT_STRATEGY: fetch From 11803a6c78e3884a887c86a37799add283dcc353 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 11 Mar 2022 13:49:53 +0100 Subject: [PATCH 06/34] empty before_script for benches --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 06f85df9070..46fed6f9096 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -176,9 +176,10 @@ publish-s3: #### stage: benchmarks -benchmark-pallet-assets: +benchmarks: stage: benchmarks <<: *docker-env + before_script: variables: PALLET: "pallet_assets" script: From 4b8e1fe6aa4c67fcdd16f534007121ae4dd97057 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 11 Mar 2022 13:56:28 +0100 Subject: [PATCH 07/34] run benchmarks on ci6 --- .gitlab-ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 46fed6f9096..e946b7ca005 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -179,12 +179,9 @@ publish-s3: benchmarks: stage: benchmarks <<: *docker-env - before_script: - variables: - PALLET: "pallet_assets" script: - time cargo build --profile production --locked --features runtime-benchmarks - ./scripts/benchmarks.sh - git status tags: - - weights + - ci6 From 8f1621f9dc9c4f5da55d336f75f9731cbaff7925 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 11 Mar 2022 15:42:53 +0100 Subject: [PATCH 08/34] disable cargo target dir --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e946b7ca005..6e02983a05f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -179,6 +179,8 @@ publish-s3: benchmarks: stage: benchmarks <<: *docker-env + variables: + CARGO_TARGET_DIR: "" script: - time cargo build --profile production --locked --features runtime-benchmarks - ./scripts/benchmarks.sh From 13e062db0dc26cdc0e7b8e9d07129accc1473ef8 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 11 Mar 2022 15:49:20 +0100 Subject: [PATCH 09/34] disable pre-cache --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6e02983a05f..fce490bfc37 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,8 +38,7 @@ variables: &default-vars image: "${CI_IMAGE}" before_script: - *rust-info-script - - ./scripts/ci/pre_cache.sh - - sccache -s + # - ./scripts/ci/pre_cache.sh retry: max: 2 when: From 2b18fda9ebc895daaca99404175e68ba2f867268 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 11 Mar 2022 15:51:41 +0100 Subject: [PATCH 10/34] add CARGO_TARGET_DIR var to bench script --- .gitlab-ci.yml | 2 -- scripts/benchmarks.sh | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fce490bfc37..1653a5c769d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -178,8 +178,6 @@ publish-s3: benchmarks: stage: benchmarks <<: *docker-env - variables: - CARGO_TARGET_DIR: "" script: - time cargo build --profile production --locked --features runtime-benchmarks - ./scripts/benchmarks.sh diff --git a/scripts/benchmarks.sh b/scripts/benchmarks.sh index 5ca8d4d4601..83e49fbe64e 100755 --- a/scripts/benchmarks.sh +++ b/scripts/benchmarks.sh @@ -27,7 +27,7 @@ pallets=( for p in ${pallets[@]} do - ./target/production/polkadot-collator benchmark \ + $CARGO_TARGET_DIR/target/production/polkadot-collator benchmark \ --chain=$statemineChain \ --execution=wasm \ --wasm-execution=compiled \ @@ -39,7 +39,7 @@ do --header=./file_header.txt \ --output=$statemineOutput - ./target/production/polkadot-collator benchmark \ + $CARGO_TARGET_DIR/target/production/polkadot-collator benchmark \ --chain=$statemintChain \ --execution=wasm \ --wasm-execution=compiled \ @@ -51,7 +51,7 @@ do --header=./file_header.txt \ --output=$statemintOutput - ./target/production/polkadot-collator benchmark \ + $CARGO_TARGET_DIR/target/production/polkadot-collator benchmark \ --chain=$westmintChain \ --execution=wasm \ --wasm-execution=compiled \ From b2166177abca748e1a978b4e980ea6039688998c Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 11 Mar 2022 16:43:11 +0100 Subject: [PATCH 11/34] debug --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1653a5c769d..fa2faa0b5e5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -180,6 +180,7 @@ benchmarks: <<: *docker-env script: - time cargo build --profile production --locked --features runtime-benchmarks + - cd $CARGO_TARGET_DIR && tree - ./scripts/benchmarks.sh - git status tags: From 9336c60ba3691c85f7180e814ad152dabd1146da Mon Sep 17 00:00:00 2001 From: alvicsam Date: Tue, 22 Mar 2022 09:58:06 +0100 Subject: [PATCH 12/34] debug --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fa2faa0b5e5..7b70cda07c3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -180,6 +180,7 @@ benchmarks: <<: *docker-env script: - time cargo build --profile production --locked --features runtime-benchmarks + - apt-get update && apt-get install tree - cd $CARGO_TARGET_DIR && tree - ./scripts/benchmarks.sh - git status From 8a3a20aecee3bb050c0f06d5b85138dc7bae5d93 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Tue, 22 Mar 2022 11:23:30 +0100 Subject: [PATCH 13/34] fix script path --- .gitlab-ci.yml | 2 -- scripts/benchmarks.sh | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7b70cda07c3..1653a5c769d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -180,8 +180,6 @@ benchmarks: <<: *docker-env script: - time cargo build --profile production --locked --features runtime-benchmarks - - apt-get update && apt-get install tree - - cd $CARGO_TARGET_DIR && tree - ./scripts/benchmarks.sh - git status tags: diff --git a/scripts/benchmarks.sh b/scripts/benchmarks.sh index 83e49fbe64e..a2f2996bf39 100755 --- a/scripts/benchmarks.sh +++ b/scripts/benchmarks.sh @@ -27,7 +27,7 @@ pallets=( for p in ${pallets[@]} do - $CARGO_TARGET_DIR/target/production/polkadot-collator benchmark \ + $CARGO_TARGET_DIR/production/polkadot-collator benchmark \ --chain=$statemineChain \ --execution=wasm \ --wasm-execution=compiled \ @@ -39,7 +39,7 @@ do --header=./file_header.txt \ --output=$statemineOutput - $CARGO_TARGET_DIR/target/production/polkadot-collator benchmark \ + $CARGO_TARGET_DIR/production/polkadot-collator benchmark \ --chain=$statemintChain \ --execution=wasm \ --wasm-execution=compiled \ @@ -51,7 +51,7 @@ do --header=./file_header.txt \ --output=$statemintOutput - $CARGO_TARGET_DIR/target/production/polkadot-collator benchmark \ + $CARGO_TARGET_DIR/production/polkadot-collator benchmark \ --chain=$westmintChain \ --execution=wasm \ --wasm-execution=compiled \ From d69843674ac42d0128de79196eadb15631d1c5e1 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 23 Mar 2022 10:05:31 +0100 Subject: [PATCH 14/34] divide build and benchmark into 2 jobs --- .gitlab-ci.yml | 26 ++++++++++++++++++++++---- scripts/benchmarks-test.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 4 deletions(-) create mode 100755 scripts/benchmarks-test.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1653a5c769d..ecf2e62e0d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,7 @@ stages: - test - publish + - benchmarks-build - benchmarks variables: &default-vars @@ -20,6 +21,14 @@ variables: &default-vars ARCH: "x86_64" WASM_BUILD_WORKSPACE_HINT: "/builds/parity/cumulus/" +.collect-artifacts: &collect-artifacts + artifacts: + name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}" + when: on_success + expire_in: 1 days + paths: + - ./artifacts/ + .rust-info-script: &rust-info-script - rustup show - cargo --version @@ -175,12 +184,21 @@ publish-s3: #### stage: benchmarks -benchmarks: - stage: benchmarks +benchmarks-build: + stage: benchmarks-build <<: *docker-env + <<: *collect-artifacts script: - time cargo build --profile production --locked --features runtime-benchmarks - - ./scripts/benchmarks.sh - - git status + - cp $CARGO_TARGET_DIR/production/polkadot-collator ./artifacts/ tags: - ci6 + +benchmarks-statemine: + stage: benchmarks + <<: *docker-env + script: + - ./scripts/benchmarks-test.sh statemine + - git status + tags: + - weights diff --git a/scripts/benchmarks-test.sh b/scripts/benchmarks-test.sh new file mode 100755 index 00000000000..91d24bb5dc7 --- /dev/null +++ b/scripts/benchmarks-test.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +steps=50 +repeat=20 +chainName=$1 + +benhcmarkOutput=./polkadot-parachains/$chainName/src/weights +benhcmarkChainName="$chainName-dev" + +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 +) + +for p in ${pallets[@]} +do + ./artifacts/polkadot-collator benchmark \ + --chain=$benhcmarkChainName \ + --execution=wasm \ + --wasm-execution=compiled \ + --pallet=$p \ + --extrinsic='*' \ + --steps=$steps \ + --repeat=$repeat \ + --json \ + --header=./file_header.txt \ + --output=$benhcmarkOutput +done From ecf057c3885bfd2c28217dd1ca02aab31f0a3fd2 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 23 Mar 2022 11:43:49 +0100 Subject: [PATCH 15/34] fix bench build --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ecf2e62e0d9..64b9481c918 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -190,6 +190,7 @@ benchmarks-build: <<: *collect-artifacts script: - time cargo build --profile production --locked --features runtime-benchmarks + - mkdir artifacts - cp $CARGO_TARGET_DIR/production/polkadot-collator ./artifacts/ tags: - ci6 From 5594fde39f02ac54ef38956c667927826f586ea8 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 23 Mar 2022 12:37:19 +0100 Subject: [PATCH 16/34] small fix --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 64b9481c918..e6a8a656259 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,7 +35,7 @@ variables: &default-vars - rustup +nightly show - cargo +nightly --version - bash --version - - sccache -s + # - sccache -s .publish-refs: &publish-refs rules: From 89b7b9977e1a35a38a4ca742a94bef7bd6d3012c Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 23 Mar 2022 16:26:56 +0100 Subject: [PATCH 17/34] reduce benchmark output log --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e6a8a656259..9508ab9987c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -199,7 +199,7 @@ benchmarks-statemine: stage: benchmarks <<: *docker-env script: - - ./scripts/benchmarks-test.sh statemine + - ./scripts/benchmarks-test.sh statemine > ./artifacts/bench-statemine.log - git status tags: - weights From 99d750a102614b524a152a25952ff7f2dbbd2937 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 30 Mar 2022 11:33:48 +0200 Subject: [PATCH 18/34] add push github --- .gitlab-ci.yml | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9508ab9987c..c3a7f38fa29 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,15 @@ stages: - benchmarks-build - benchmarks +default: + interruptible: true + retry: + max: 2 + when: + - runner_system_failure + - unknown_failure + - api_failure + variables: &default-vars GIT_STRATEGY: fetch GIT_DEPTH: 100 @@ -48,24 +57,11 @@ variables: &default-vars before_script: - *rust-info-script # - ./scripts/ci/pre_cache.sh - 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 + image: "${CI_IMAGE}" tags: - kubernetes-parity-build @@ -192,14 +188,30 @@ benchmarks-build: - time cargo build --profile production --locked --features runtime-benchmarks - mkdir artifacts - cp $CARGO_TARGET_DIR/production/polkadot-collator ./artifacts/ - tags: - - ci6 + benchmarks-statemine: stage: benchmarks - <<: *docker-env + before_script: + - *rust-info-script script: - ./scripts/benchmarks-test.sh statemine > ./artifacts/bench-statemine.log - git status + # setup ssh + - eval $(ssh-agent) + - ssh-add - <<< ${GITHUB_SSH_PRIV_KEY} + - mkdir ~/.ssh && touch ~/.ssh/known_hosts + - ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts + # Set git config + - rm -rf .git/config + - git config user.email "${GITHUB_EMAIL}" + - git config user.name "${GITHUB_USER}" + - git config remote.origin.url "git@github.com:/paritytech/${CI_PROJECT_NAME}.git" + - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" + # push results to github + - git checkout -b "benchmarks-$(date +%d-%m-%Y)" + - git add polkadot-parachains/* + - git commit -m "[delete me] test pr with benchmarks" + - git push origin "benchmarks-$(date +%d-%m-%Y)" tags: - weights From d672528686542e2a0123b9532583a6f1e114bf1c Mon Sep 17 00:00:00 2001 From: alvicsam Date: Thu, 31 Mar 2022 10:58:42 +0200 Subject: [PATCH 19/34] add push gh --- .gitlab-ci.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c3a7f38fa29..e1f822d5b5a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -197,21 +197,22 @@ benchmarks-statemine: script: - ./scripts/benchmarks-test.sh statemine > ./artifacts/bench-statemine.log - git status - # setup ssh - - eval $(ssh-agent) - - ssh-add - <<< ${GITHUB_SSH_PRIV_KEY} - - mkdir ~/.ssh && touch ~/.ssh/known_hosts - - ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts + - export BRANCHNAME="benchmarks-$(date +%d-%m-%Y)-${CI_COMMIT_SHORT_SHA}" # Set git config - rm -rf .git/config - git config user.email "${GITHUB_EMAIL}" - git config user.name "${GITHUB_USER}" - - git config remote.origin.url "git@github.com:/paritytech/${CI_PROJECT_NAME}.git" + - 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 "benchmarks-$(date +%d-%m-%Y)" + - git checkout -b $BRANCHNAME - git add polkadot-parachains/* - git commit -m "[delete me] test pr with benchmarks" - - git push origin "benchmarks-$(date +%d-%m-%Y)" + - git push origin $BRANCHNAME + # create PR + - curl -i ${GITHUB_USER}:${GITHUB_TOKEN} + -d '{"head":"'$BRANCHNAME'","base":"master"}' + -X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls + tags: - weights From dab0fcf8cdcf54949afe65f9e733c5edef14d7db Mon Sep 17 00:00:00 2001 From: alvicsam Date: Thu, 31 Mar 2022 10:59:21 +0200 Subject: [PATCH 20/34] add after_script --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e1f822d5b5a..f56b3aa4a77 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -213,6 +213,8 @@ benchmarks-statemine: - curl -i ${GITHUB_USER}:${GITHUB_TOKEN} -d '{"head":"'$BRANCHNAME'","base":"master"}' -X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls + after_script: + - rm -rf .git/config tags: - weights From 70b7ed00e6dca108d5a3a1dbfe00d20fba230ae1 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Thu, 31 Mar 2022 11:00:26 +0200 Subject: [PATCH 21/34] typo fix --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f56b3aa4a77..c35c951a763 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -214,7 +214,7 @@ benchmarks-statemine: -d '{"head":"'$BRANCHNAME'","base":"master"}' -X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls after_script: - - rm -rf .git/config + - rm -rf .git/config tags: - weights From cd1cac20fcf69801a16e68cfe1c1bd148007de9f Mon Sep 17 00:00:00 2001 From: alvicsam Date: Thu, 31 Mar 2022 11:00:40 +0200 Subject: [PATCH 22/34] typo fix --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c35c951a763..9a82137e26e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -213,7 +213,7 @@ benchmarks-statemine: - curl -i ${GITHUB_USER}:${GITHUB_TOKEN} -d '{"head":"'$BRANCHNAME'","base":"master"}' -X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls - after_script: + after_script: - rm -rf .git/config tags: From 1092e1212f196e87df39f1c7f881131c45af405c Mon Sep 17 00:00:00 2001 From: alvicsam Date: Thu, 31 Mar 2022 14:51:37 +0200 Subject: [PATCH 23/34] fix curl --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9a82137e26e..4d4352aa521 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -210,7 +210,7 @@ benchmarks-statemine: - git commit -m "[delete me] test pr with benchmarks" - git push origin $BRANCHNAME # create PR - - curl -i ${GITHUB_USER}:${GITHUB_TOKEN} + - curl -u ${GITHUB_USER}:${GITHUB_TOKEN} -d '{"head":"'$BRANCHNAME'","base":"master"}' -X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls after_script: From 291fd830caa33256f769786fa772a61a9acad811 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Thu, 31 Mar 2022 17:40:39 +0200 Subject: [PATCH 24/34] fix git config --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4d4352aa521..5681617e7b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -200,8 +200,8 @@ benchmarks-statemine: - export BRANCHNAME="benchmarks-$(date +%d-%m-%Y)-${CI_COMMIT_SHORT_SHA}" # Set git config - rm -rf .git/config - - git config user.email "${GITHUB_EMAIL}" - - git config user.name "${GITHUB_USER}" + - 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 From 05a777d32e76eebec174aaa0635c4b9041594480 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 1 Apr 2022 09:51:06 +0200 Subject: [PATCH 25/34] add title and body to pr --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5681617e7b4..270405ea71c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -211,7 +211,7 @@ benchmarks-statemine: - git push origin $BRANCHNAME # create PR - curl -u ${GITHUB_USER}:${GITHUB_TOKEN} - -d '{"head":"'$BRANCHNAME'","base":"master"}' + -d '{"title":"[benchmarks] Update weights","body":"Test PR, not intended to merge","head":"'$BRANCHNAME'","base":"master"}' -X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls after_script: - rm -rf .git/config From c1b2db6b9f96131bdaf550ee26670874f2c0a1b4 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Mon, 4 Apr 2022 10:06:17 +0200 Subject: [PATCH 26/34] final check that everything works --- .gitlab-ci.yml | 10 +++++----- scripts/{benchmarks-test.sh => benchmarks-ci.sh} | 0 2 files changed, 5 insertions(+), 5 deletions(-) rename scripts/{benchmarks-test.sh => benchmarks-ci.sh} (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 270405ea71c..054dea26c3e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,7 @@ default: - unknown_failure - api_failure -variables: &default-vars +variables: GIT_STRATEGY: fetch GIT_DEPTH: 100 CARGO_INCREMENTAL: 0 @@ -92,7 +92,6 @@ variables: &default-vars - if: $CI_PIPELINE_SOURCE == "schedule" <<: *collect-artifacts variables: - <<: *default-vars # Enable debug assertions since we are running optimized builds for testing # but still want to have debug assertions. RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" @@ -144,7 +143,6 @@ variables: &default-vars stage: test <<: *docker-env variables: - <<: *default-vars SKIP_WASM_BUILD: 1 RUSTDOCFLAGS: "-Dwarnings" script: @@ -194,8 +192,11 @@ benchmarks-statemine: stage: benchmarks before_script: - *rust-info-script + <<: *collect-artifacts script: - - ./scripts/benchmarks-test.sh statemine > ./artifacts/bench-statemine.log + - ./scripts/benchmarks-ci.sh statemine > ./artifacts/bench-statemine.log + - ./scripts/benchmarks-ci.sh statemint > ./artifacts/bench-statemint.log + - ./scripts/benchmarks-ci.sh westmint > ./artifacts/bench-westmint.log - git status - export BRANCHNAME="benchmarks-$(date +%d-%m-%Y)-${CI_COMMIT_SHORT_SHA}" # Set git config @@ -215,6 +216,5 @@ benchmarks-statemine: -X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls after_script: - rm -rf .git/config - tags: - weights diff --git a/scripts/benchmarks-test.sh b/scripts/benchmarks-ci.sh similarity index 100% rename from scripts/benchmarks-test.sh rename to scripts/benchmarks-ci.sh From 8ac053e8802da81f86338c540e7f410c1f2b6297 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Mon, 4 Apr 2022 10:07:35 +0200 Subject: [PATCH 27/34] final check that everything works --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 054dea26c3e..99b1606f7c0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -208,11 +208,11 @@ benchmarks-statemine: # push results to github - git checkout -b $BRANCHNAME - git add polkadot-parachains/* - - git commit -m "[delete me] test pr with benchmarks" + - git commit -m "[benchmarks] pr with wieghts" - git push origin $BRANCHNAME # create PR - curl -u ${GITHUB_USER}:${GITHUB_TOKEN} - -d '{"title":"[benchmarks] Update weights","body":"Test PR, not intended to merge","head":"'$BRANCHNAME'","base":"master"}' + -d '{"title":"[benchmarks] Update weights","body":"This PR is generated automatically by CI.","head":"'$BRANCHNAME'","base":"master"}' -X POST https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/pulls after_script: - rm -rf .git/config From 5a4f3387bbbc4ba23275c1a49763327e5273a6e0 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Mon, 4 Apr 2022 14:53:52 +0200 Subject: [PATCH 28/34] return jobs back --- .gitlab-ci.yml | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 99b1606f7c0..86939a4b7ac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,7 +44,6 @@ variables: - rustup +nightly show - cargo +nightly --version - bash --version - # - sccache -s .publish-refs: &publish-refs rules: @@ -52,11 +51,30 @@ variables: - if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 +# run benchmarks manually +.benchmarks-refs: &benchmarks-refs + rules: + - if: $CI_PIPELINE_SOURCE == "web" + when: manual + - if: $CI_PIPELINE_SOURCE == "schedule" + when: manual + - if: $CI_COMMIT_REF_NAME == "master" + when: manual + - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 + when: manual + +.master-refs: &master-refs + rules: + - if: $CI_PIPELINE_SOURCE == "web" + - if: $CI_PIPELINE_SOURCE == "schedule" + - if: $CI_COMMIT_REF_NAME == "master" + - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 + .docker-env: &docker-env image: "${CI_IMAGE}" before_script: - *rust-info-script - # - ./scripts/ci/pre_cache.sh + - ./scripts/ci/pre_cache.sh tags: - linux-docker @@ -75,9 +93,10 @@ variables: #### stage: test -.test-linux-stable: +test-linux-stable: stage: test <<: *docker-env + <<: *common-refs rules: - if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME == "tags" @@ -112,7 +131,7 @@ variables: fi - sccache -s -.check-runtime-benchmarks: +check-runtime-benchmarks: stage: test <<: *docker-env script: @@ -122,7 +141,7 @@ variables: - time cargo check -p parachain-template-node --features runtime-benchmarks - sccache -s -.cargo-check-try-runtime: +cargo-check-try-runtime: stage: test <<: *docker-env script: @@ -132,14 +151,14 @@ variables: - time cargo check -p parachain-template-node --features try-runtime - sccache -s -.cargo-check-benches: +cargo-check-benches: stage: test <<: *docker-env script: - time cargo check --all --benches - sccache -s -.check-rustdoc: +check-rustdoc: stage: test <<: *docker-env variables: @@ -182,17 +201,18 @@ benchmarks-build: stage: benchmarks-build <<: *docker-env <<: *collect-artifacts + <<: *benchmarks-refs script: - time cargo build --profile production --locked --features runtime-benchmarks - mkdir artifacts - cp $CARGO_TARGET_DIR/production/polkadot-collator ./artifacts/ - benchmarks-statemine: stage: benchmarks before_script: - *rust-info-script <<: *collect-artifacts + <<: *master-refs script: - ./scripts/benchmarks-ci.sh statemine > ./artifacts/bench-statemine.log - ./scripts/benchmarks-ci.sh statemint > ./artifacts/bench-statemint.log From 2246b0c3fab49ce4eab478ca80c48ec596ae5342 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Mon, 4 Apr 2022 14:58:41 +0200 Subject: [PATCH 29/34] fix rules --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 86939a4b7ac..e28012f8065 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -96,7 +96,6 @@ variables: test-linux-stable: stage: test <<: *docker-env - <<: *common-refs rules: - if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME == "tags" From 463a3ae85a0352b4003f209180e9c6a6af6bd33a Mon Sep 17 00:00:00 2001 From: alvicsam Date: Mon, 4 Apr 2022 15:01:58 +0200 Subject: [PATCH 30/34] cancel changes benchmarks.sh --- scripts/benchmarks.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/benchmarks.sh b/scripts/benchmarks.sh index a2f2996bf39..5ca8d4d4601 100755 --- a/scripts/benchmarks.sh +++ b/scripts/benchmarks.sh @@ -27,7 +27,7 @@ pallets=( for p in ${pallets[@]} do - $CARGO_TARGET_DIR/production/polkadot-collator benchmark \ + ./target/production/polkadot-collator benchmark \ --chain=$statemineChain \ --execution=wasm \ --wasm-execution=compiled \ @@ -39,7 +39,7 @@ do --header=./file_header.txt \ --output=$statemineOutput - $CARGO_TARGET_DIR/production/polkadot-collator benchmark \ + ./target/production/polkadot-collator benchmark \ --chain=$statemintChain \ --execution=wasm \ --wasm-execution=compiled \ @@ -51,7 +51,7 @@ do --header=./file_header.txt \ --output=$statemintOutput - $CARGO_TARGET_DIR/production/polkadot-collator benchmark \ + ./target/production/polkadot-collator benchmark \ --chain=$westmintChain \ --execution=wasm \ --wasm-execution=compiled \ From 3a40468c868bc3356951f042dd059c6d4c076f45 Mon Sep 17 00:00:00 2001 From: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> Date: Mon, 4 Apr 2022 15:59:04 +0200 Subject: [PATCH 31/34] Apply suggestions from code review Co-authored-by: Denis Pisarev --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e28012f8065..1035a15c9e1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ stages: - test - publish - benchmarks-build - - benchmarks + - benchmarks-run default: interruptible: true @@ -207,7 +207,7 @@ benchmarks-build: - cp $CARGO_TARGET_DIR/production/polkadot-collator ./artifacts/ benchmarks-statemine: - stage: benchmarks + stage: benchmarks-run before_script: - *rust-info-script <<: *collect-artifacts From 886ab0c9b8d43ef5b1dc88e587dea2467a49c97b Mon Sep 17 00:00:00 2001 From: alvicsam Date: Mon, 4 Apr 2022 16:00:03 +0200 Subject: [PATCH 32/34] rename job --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1035a15c9e1..ed2804f95fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -206,7 +206,7 @@ benchmarks-build: - mkdir artifacts - cp $CARGO_TARGET_DIR/production/polkadot-collator ./artifacts/ -benchmarks-statemine: +benchmarks: stage: benchmarks-run before_script: - *rust-info-script From ea26a595586354be5ede5e68d9b9a5ffc8997b72 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Mon, 11 Apr 2022 17:13:23 +0200 Subject: [PATCH 33/34] change benches jobs to run on release-parachains-v* --- .gitlab-ci.yml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ed2804f95fb..59886f0f79c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,11 +24,9 @@ variables: GIT_STRATEGY: fetch GIT_DEPTH: 100 CARGO_INCREMENTAL: 0 - CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}" CI_IMAGE: "paritytech/ci-linux:production" DOCKER_OS: "debian:stretch" ARCH: "x86_64" - WASM_BUILD_WORKSPACE_HINT: "/builds/parity/cumulus/" .collect-artifacts: &collect-artifacts artifacts: @@ -51,16 +49,16 @@ variables: - if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 -# run benchmarks manually -.benchmarks-refs: &benchmarks-refs +# run benchmarks manually only on release-parachains-v* branch +.benchmarks-manual-refs: &benchmarks-manual-refs rules: - - if: $CI_PIPELINE_SOURCE == "web" - when: manual - - if: $CI_PIPELINE_SOURCE == "schedule" - when: manual - - if: $CI_COMMIT_REF_NAME == "master" + - if: $CI_COMMIT_REF_NAME =~ /^release-parachains-v[0-9]+\.[0-9]+.*$/ # i.e. release-parachains-v1.0, release-parachains-v2.1rc1 when: manual - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 + +# run benchmarks only on release-parachains-v* branch +.benchmarks-refs: &benchmarks-refs + rules: + - if: $CI_COMMIT_REF_NAME =~ /^release-parachains-v[0-9]+\.[0-9]+.*$/ # i.e. release-parachains-v1.0, release-parachains-v2.1rc1 when: manual .master-refs: &master-refs @@ -74,7 +72,6 @@ variables: image: "${CI_IMAGE}" before_script: - *rust-info-script - - ./scripts/ci/pre_cache.sh tags: - linux-docker @@ -195,12 +192,13 @@ publish-s3: --recursive --human-readable --summarize #### stage: benchmarks +# Work only on release-parachains-v* branches benchmarks-build: stage: benchmarks-build <<: *docker-env <<: *collect-artifacts - <<: *benchmarks-refs + <<: *benchmarks-manual-refs script: - time cargo build --profile production --locked --features runtime-benchmarks - mkdir artifacts @@ -211,13 +209,13 @@ benchmarks: before_script: - *rust-info-script <<: *collect-artifacts - <<: *master-refs + <<: *benchmarks-refs script: - ./scripts/benchmarks-ci.sh statemine > ./artifacts/bench-statemine.log - ./scripts/benchmarks-ci.sh statemint > ./artifacts/bench-statemint.log - ./scripts/benchmarks-ci.sh westmint > ./artifacts/bench-westmint.log - git status - - export BRANCHNAME="benchmarks-$(date +%d-%m-%Y)-${CI_COMMIT_SHORT_SHA}" + - export BRANCHNAME="${CI_COMMIT_BRANCH}-weights" # Set git config - rm -rf .git/config - git config --global user.email "${GITHUB_EMAIL}" @@ -231,7 +229,7 @@ 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":"master"}' + -d '{"title":"[benchmarks] Update weights","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 From 2a3765313b5c7662df4e2c5c534f26f5c3041a1e Mon Sep 17 00:00:00 2001 From: alvicsam Date: Mon, 11 Apr 2022 17:20:08 +0200 Subject: [PATCH 34/34] remove master refs --- .gitlab-ci.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 59886f0f79c..0b38b409005 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -61,13 +61,6 @@ variables: - if: $CI_COMMIT_REF_NAME =~ /^release-parachains-v[0-9]+\.[0-9]+.*$/ # i.e. release-parachains-v1.0, release-parachains-v2.1rc1 when: manual -.master-refs: &master-refs - rules: - - if: $CI_PIPELINE_SOURCE == "web" - - if: $CI_PIPELINE_SOURCE == "schedule" - - if: $CI_COMMIT_REF_NAME == "master" - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - .docker-env: &docker-env image: "${CI_IMAGE}" before_script: