From da3a28e7326116d5e9093a1aab43a6762e2cb95b Mon Sep 17 00:00:00 2001 From: alvicsam Date: Thu, 29 Aug 2024 13:06:02 +0200 Subject: [PATCH 1/3] [ci] Move check-runtime-migration to GHA --- .github/workflows/check-runtime-migration.yml | 57 +++++++++++++------ .gitlab/pipeline/check.yml | 4 +- 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/.github/workflows/check-runtime-migration.yml b/.github/workflows/check-runtime-migration.yml index b8962f0e07ad..b93a07bf61f1 100644 --- a/.github/workflows/check-runtime-migration.yml +++ b/.github/workflows/check-runtime-migration.yml @@ -8,7 +8,7 @@ on: types: [opened, synchronize, reopened, ready_for_review] # Take a snapshot at 5am when most SDK devs are not working. schedule: - - cron: '0 5 * * *' + - cron: "0 5 * * *" merge_group: workflow_dispatch: @@ -24,14 +24,25 @@ jobs: runs-on: ubuntu-latest outputs: IMAGE: ${{ steps.set_image.outputs.IMAGE }} + RUNNER: ${{ steps.set_runner.outputs.RUNNER }} steps: - name: Checkout uses: actions/checkout@v4 - id: set_image run: cat .github/env >> $GITHUB_OUTPUT - # rococo and westend are disabled for now (no access to parity-chains.parity.io) + # By default we use spot machines that can be terminated at any time. + # Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated. + - id: set_runner + run: | + # Run merge queues on persistent runners + if [[ $GITHUB_REF_NAME == *"gh-readonly-queue"* ]]; then + echo "RUNNER=arc-runners-polkadot-sdk-beefy-persistent" >> $GITHUB_OUTPUT + else + echo "RUNNER=arc-runners-polkadot-sdk-beefy" >> $GITHUB_OUTPUT + fi + # More info can be found here: https://github.com/paritytech/polkadot/pull/5865 check-runtime-migration: - runs-on: arc-runners-polkadot-sdk-beefy + runs-on: ${{ needs.set-image.outputs.RUNNER }} # We need to set this to rather long to allow the snapshot to be created, but the average time # should be much lower. timeout-minutes: 60 @@ -41,9 +52,10 @@ jobs: strategy: fail-fast: false matrix: - network: [ - # westend, - # rococo, + network: + [ + westend, + rococo, asset-hub-westend, asset-hub-rococo, bridge-hub-westend, @@ -53,18 +65,18 @@ jobs: coretime-rococo, ] include: - # - network: westend - # package: westend-runtime - # wasm: westend_runtime.compact.compressed.wasm - # uri: "wss://try-runtime-westend.polkadot.io:443" - # subcommand_extra_args: "--no-weight-warnings" - # command_extra_args: "" - # - network: rococo - # package: rococo-runtime - # wasm: rococo_runtime.compact.compressed.wasm - # uri: "wss://try-runtime-rococo.polkadot.io:443" - # subcommand_extra_args: "--no-weight-warnings" - # command_extra_args: "" + - network: westend + package: westend-runtime + wasm: westend_runtime.compact.compressed.wasm + uri: "wss://try-runtime-westend.polkadot.io:443" + subcommand_extra_args: "--no-weight-warnings" + command_extra_args: "" + - network: rococo + package: rococo-runtime + wasm: rococo_runtime.compact.compressed.wasm + uri: "wss://try-runtime-rococo.polkadot.io:443" + subcommand_extra_args: "--no-weight-warnings" + command_extra_args: "" - network: asset-hub-westend package: asset-hub-westend-runtime wasm: asset_hub_westend_runtime.compact.compressed.wasm @@ -143,3 +155,12 @@ jobs: --runtime ./target/release/wbuild/${{ matrix.package }}/${{ matrix.wasm }} \ on-runtime-upgrade --disable-spec-version-check --checks=all ${{ matrix.subcommand_extra_args }} snap -p snapshot.raw sleep 5 + # name of this job must be unique across all workflows + # otherwise GitHub will mark all these jobs as required + confirm-required-checks-passed: + runs-on: ubuntu-latest + name: All runtime migrations passed + # If any new job gets added, be sure to add it to this array + needs: [check-runtime-migration] + steps: + - run: echo '### Good job! All the checks passed 🚀' >> $GITHUB_STEP_SUMMARY diff --git a/.gitlab/pipeline/check.yml b/.gitlab/pipeline/check.yml index 64bef8d6e005..aa78a996d63b 100644 --- a/.gitlab/pipeline/check.yml +++ b/.gitlab/pipeline/check.yml @@ -70,7 +70,7 @@ check-toml-format: - sleep 5 # Check runtime migrations for Parity managed relay chains -check-runtime-migration-westend: +.check-runtime-migration-westend: stage: check extends: - .docker-env @@ -83,7 +83,7 @@ check-runtime-migration-westend: URI: "wss://try-runtime-westend.polkadot.io:443" SUBCOMMAND_EXTRA_ARGS: "--no-weight-warnings" -check-runtime-migration-rococo: +.check-runtime-migration-rococo: stage: check extends: - .docker-env From b04da166ae2011654b997b100f3a7592e38bb9f3 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Thu, 29 Aug 2024 13:17:25 +0200 Subject: [PATCH 2/3] rm check-runtime-migration --- .gitlab/pipeline/check.yml | 49 -------------------------------------- 1 file changed, 49 deletions(-) diff --git a/.gitlab/pipeline/check.yml b/.gitlab/pipeline/check.yml index aa78a996d63b..2212c1aeb0a8 100644 --- a/.gitlab/pipeline/check.yml +++ b/.gitlab/pipeline/check.yml @@ -46,52 +46,3 @@ check-toml-format: script: - taplo format --check --config .config/taplo.toml - echo "Please run `taplo format --config .config/taplo.toml` to fix any toml formatting issues" - -# More info can be found here: https://github.com/paritytech/polkadot/pull/5865 -.check-runtime-migration: - stage: check - extends: - - .docker-env - - .test-pr-refs - script: - - export RUST_LOG=remote-ext=debug,runtime=debug - - echo "---------- Downloading try-runtime CLI ----------" - - curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.5.4/try-runtime-x86_64-unknown-linux-musl -o try-runtime - - chmod +x ./try-runtime - - echo "Using try-runtime-cli version:" - - ./try-runtime --version - - echo "---------- Building ${PACKAGE} runtime ----------" - - time cargo build --release --locked -p "$PACKAGE" --features try-runtime - - echo "---------- Executing on-runtime-upgrade for ${NETWORK} ----------" - - > - time ./try-runtime ${COMMAND_EXTRA_ARGS} \ - --runtime ./target/release/wbuild/"$PACKAGE"/"$WASM" \ - on-runtime-upgrade --disable-spec-version-check --checks=all ${SUBCOMMAND_EXTRA_ARGS} live --uri ${URI} - - sleep 5 - -# Check runtime migrations for Parity managed relay chains -.check-runtime-migration-westend: - stage: check - extends: - - .docker-env - - .test-pr-refs - - .check-runtime-migration - variables: - NETWORK: "westend" - PACKAGE: "westend-runtime" - WASM: "westend_runtime.compact.compressed.wasm" - URI: "wss://try-runtime-westend.polkadot.io:443" - SUBCOMMAND_EXTRA_ARGS: "--no-weight-warnings" - -.check-runtime-migration-rococo: - stage: check - extends: - - .docker-env - - .test-pr-refs - - .check-runtime-migration - variables: - NETWORK: "rococo" - PACKAGE: "rococo-runtime" - WASM: "rococo_runtime.compact.compressed.wasm" - URI: "wss://try-runtime-rococo.polkadot.io:443" - SUBCOMMAND_EXTRA_ARGS: "--no-weight-warnings" From d3246f10db9ef7e9dca01b276894b0166e9e1a90 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Thu, 29 Aug 2024 13:34:32 +0200 Subject: [PATCH 3/3] rm cancel jobs --- .gitlab-ci.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c51d0ce5627e..56d426218c80 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -374,13 +374,3 @@ cancel-pipeline-build-short-benchmark: extends: .cancel-pipeline-template needs: - job: build-short-benchmark - -cancel-pipeline-check-runtime-migration-rococo: - extends: .cancel-pipeline-template - needs: - - job: check-runtime-migration-rococo - -cancel-pipeline-check-runtime-migration-westend: - extends: .cancel-pipeline-template - needs: - - job: check-runtime-migration-westend