From 42055dd03a77f286365e0f2712bcadf49365a894 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Sat, 23 Nov 2024 01:35:25 +0700 Subject: [PATCH] deleting variables for separate branches for our chains --- .docker/Dockerfile-unique-release | 9 +++--- .github/workflows/forkless-update-data.yml | 16 ++++++----- .github/workflows/forkless-update-nodata.yml | 16 ++++++----- .github/workflows/node-only-update.yml | 30 ++++++++++---------- js-packages/scripts/generateEnv.ts | 6 ++-- 5 files changed, 41 insertions(+), 36 deletions(-) diff --git a/.docker/Dockerfile-unique-release b/.docker/Dockerfile-unique-release index 9d701e4b0a..b9f505729f 100644 --- a/.docker/Dockerfile-unique-release +++ b/.docker/Dockerfile-unique-release @@ -4,13 +4,14 @@ FROM "uniquenetwork/services:base-nightly-1.67.0" as builder WORKDIR /workdir ARG UNIQUE_VERSION -RUN git clone -b "$UNIQUE_VERSION" --depth 1 https://github.com/uniquenetwork/unique-chain.git - +ARG UNIQUE_HASH ARG FEATURES -RUN --mount=type=cache,target=/cargo-home/registry \ + +RUN git clone -b "$UNIQUE_VERSION" --depth 1 https://github.com/uniquenetwork/unique-chain.git && \ + cd unique-chain && git checkout "$UNIQUE_HASH" && \ + --mount=type=cache,target=/cargo-home/registry \ --mount=type=cache,target=/cargo-home/git \ --mount=type=cache,target=/workdir/unique-chain/target \ - cd unique-chain && \ CARGO_INCREMENTAL=0 cargo build --release --features="${FEATURES}" --locked && \ mv ./target/release/unique-collator /workdir/unique-chain/ && \ cd target/release/wbuild && find . -name "*.wasm" -exec sh -c 'mkdir -p "../../../wasm/$(dirname {})"; cp {} "../../../wasm/{}"' \; diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index d32ea2af57..ee7e99af77 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -38,9 +38,9 @@ jobs: id: create_matrix with: matrix: | - network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, node_branch {${{ env.OPAL_NODE_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, fork_source {${{ env.OPAL_REPLICA_FROM }}} - network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, node_branch {${{ env.QUARTZ_NODE_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, fork_source {${{ env.QUARTZ_REPLICA_FROM }}} - network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, node_branch {${{ env.UNIQUE_NODE_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, fork_source {${{ env.UNIQUE_REPLICA_FROM }}} + network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, fork_source {${{ env.OPAL_REPLICA_FROM }}} + network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, fork_source {${{ env.QUARTZ_REPLICA_FROM }}} + network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, fork_source {${{ env.UNIQUE_REPLICA_FROM }}} forkless-data: @@ -97,12 +97,13 @@ jobs: id: mainnet with: container: uniquenetwork/ci-nodata-${{ matrix.network }} - tag: ${{ matrix.network }}-${{ matrix.mainnet_branch }} + tag: ${{ matrix.network }}-${{ env.MAINNET_BRANCH }}-${{ env.MAINNET_HASH}} context: .docker dockerfile: Dockerfile-unique-release args: | --build-arg NETWORK=${{ matrix.network }} - --build-arg UNIQUE_VERSION=${{ matrix.mainnet_branch }} + --build-arg UNIQUE_VERSION=${{ env.MAINNET_BRANCH}} + --build-arg UNIQUE_HASH=${{ env.MAINNET_HASH}} dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} @@ -131,12 +132,13 @@ jobs: id: node with: container: uniquenetwork/ci-data-${{ matrix.network }} - tag: ${{ matrix.network }}-${{ matrix.node_branch }} + tag: ${{ matrix.network }}-${{ env.NODE_BRANCH }}-${{ env.NODE_HASH}} context: .docker dockerfile: Dockerfile-unique-release args: | --build-arg NETWORK=${{ matrix.network }} - --build-arg UNIQUE_VERSION=${{ matrix.node_branch }} + --build-arg UNIQUE_VERSION=${{ env.NODE_BRANCH}} + --build-arg UNIQUE_HASH=${{ env.NODE_HASH}} dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 78a215c729..3230af8100 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -38,9 +38,9 @@ jobs: id: create_matrix with: matrix: | - network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, node_branch {${{ env.OPAL_NODE_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}} - network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, node_branch {${{ env.QUARTZ_NODE_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}} - network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, node_branch {${{ env.UNIQUE_NODE_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}} + network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}} + network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}} + network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}} forkless-nodata: @@ -97,12 +97,13 @@ jobs: id: mainnet with: container: uniquenetwork/ci-nodata-${{ matrix.network }} - tag: ${{ matrix.network }}-${{ matrix.mainnet_branch }} + tag: ${{ matrix.network }}-${{ env.MAINNET_BRANCH }}-${{ env.MAINNET_HASH}} context: .docker dockerfile: Dockerfile-unique-release args: | --build-arg NETWORK=${{ matrix.network }} - --build-arg UNIQUE_VERSION=${{ matrix.mainnet_branch }} + --build-arg UNIQUE_VERSION=${{ env.MAINNET_BRANCH}} + --build-arg UNIQUE_HASH=${{ env.MAINNET_HASH}} dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} @@ -131,12 +132,13 @@ jobs: id: node with: container: uniquenetwork/ci-data-${{ matrix.network }} - tag: ${{ matrix.network }}-${{ matrix.node_branch }} + tag: ${{ matrix.network }}-${{ env.NODE_BRANCH }}-${{ env.NODE_HASH}} context: .docker dockerfile: Dockerfile-unique-release args: | --build-arg NETWORK=${{ matrix.network }} - --build-arg UNIQUE_VERSION=${{ matrix.node_branch }} + --build-arg UNIQUE_VERSION=${{ env.NODE_BRANCH}} + --build-arg UNIQUE_HASH=${{ env.NODE_HASH}} dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} diff --git a/.github/workflows/node-only-update.yml b/.github/workflows/node-only-update.yml index e2c055460a..6bf8cc2e74 100644 --- a/.github/workflows/node-only-update.yml +++ b/.github/workflows/node-only-update.yml @@ -38,9 +38,9 @@ jobs: id: create_matrix with: matrix: | - network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}} - network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}} - network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}} + network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}} + network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}} + network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}} node-only-update: @@ -101,12 +101,12 @@ jobs: id: mainnet with: container: uniquenetwork/ci-node-only-${{ matrix.network }} - tag: ${{ matrix.mainnet_branch }} + tag: ${{ matrix.network }}-${{ env.MAINNET_BRANCH }}-${{ env.MAINNET_HASH}} context: .docker dockerfile: Dockerfile-unique-release args: | --build-arg FEATURES=${{ matrix.network }}-runtime - --build-arg UNIQUE_VERSION=${{ matrix.mainnet_branch }} + --build-arg UNIQUE_VERSION=${{ env.MAINNET_BRANCH }} dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} @@ -123,12 +123,12 @@ jobs: dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - name: Checkout at '${{ matrix.mainnet_branch }}' branch + - name: Checkout at '${{ env.MAINNET_BRANCH }}' branch uses: actions/checkout@v4.1.7 with: #ref: ${{ github.head_ref }} - ref: ${{ matrix.mainnet_branch }} #Checking out head commit - path: ${{ matrix.mainnet_branch }} + ref: ${{ env.MAINNET_BRANCH }} #Checking out head commit + path: ${{ env.MAINNET_BRANCH }} - uses: actions/setup-node@v4.0.2 with: @@ -158,7 +158,7 @@ jobs: ephemeral:snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}, extra_node_mixin={extraArgs: []}) - name: Ensure network is alive - working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + working-directory: ${{ env.MAINNET_BRANCH }}/js-packages/tests id: alive1 if: ${{ !cancelled() && steps.bdk.outcome == 'success' }} run: | @@ -169,7 +169,7 @@ jobs: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} - name: Run Parallel tests before Node Parachain upgrade - working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + working-directory: ${{ env.MAINNET_BRANCH }}/js-packages/tests if: ${{ !cancelled() && steps.alive1.outcome == 'success' }} run: | echo "Ready to start tests" @@ -179,7 +179,7 @@ jobs: - name: Run Sequential tests before Node Parachain upgrade if: ${{ !cancelled() && steps.alive1.outcome == 'success' }} - working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + working-directory: ${{ env.MAINNET_BRANCH }}/js-packages/tests run: NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW} env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} @@ -197,7 +197,7 @@ jobs: snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}) - name: Ensure network is alive - working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + working-directory: ${{ env.MAINNET_BRANCH }}/js-packages/tests id: alive2 if: ${{ !cancelled() && steps.reconcile1.outcome == 'success' }} run: | @@ -217,7 +217,7 @@ jobs: snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}) - name: Ensure network is alive - working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + working-directory: ${{ env.MAINNET_BRANCH }}/js-packages/tests id: alive3 if: ${{ !cancelled() && steps.reconcile2.outcome == 'success' }} run: | @@ -226,7 +226,7 @@ jobs: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} - name: Run Parallel tests after Node Parachain upgrade - working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + working-directory: ${{ env.MAINNET_BRANCH }}/js-packages/tests if: ${{ !cancelled() && steps.alive3.outcome == 'success' }} run: | echo "Ready to start tests" @@ -236,7 +236,7 @@ jobs: - name: Run Sequential tests after Node Parachain upgrade if: ${{ !cancelled() && steps.alive3.outcome == 'success' }} - working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests + working-directory: ${{ env.MAINNET_BRANCH }}/js-packages/tests run: NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW} env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} diff --git a/js-packages/scripts/generateEnv.ts b/js-packages/scripts/generateEnv.ts index 153b2610cc..51bc360687 100644 --- a/js-packages/scripts/generateEnv.ts +++ b/js-packages/scripts/generateEnv.ts @@ -46,18 +46,18 @@ function fixupUnique(version: string): string { // ff('wss://statemint-rpc.polkadot.io/', /^(....)$/, 'release-parachains-v$1').then(v => env = setVar(env, 'STATEMINT_BUILD_BRANCH', v)), ff('wss://acala-rpc-0.aca-api.network/', /^(.)(..)(.)$/, '$1.$2.$3').then(v => env = setVar(env, 'ACALA_BUILD_BRANCH', v)), ff('wss://wss.api.moonbeam.network/', /^(....)$/, 'runtime-$1').then(v => env = setVar(env, 'MOONBEAM_BUILD_BRANCH', v)), - ff('wss://ws.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'UNIQUE_MAINNET_BRANCH', fixupUnique(v))), + ff('wss://ws.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'MAINNET_BRANCH', fixupUnique(v))), // ff('wss://kusama-rpc.polkadot.io/', /^(.)(...)(...)$/, 'v$1.$2.$3').then(v => env = setVar(env, 'KUSAMA_MAINNET_BRANCH', v)), ff('wss://rococo-rpc.polkadot.io/', /^(.)(...)(...)$/, 'v$1.$2.$3').then(v => env = setVar(env, 'KUSAMA_MAINNET_BRANCH', v)), // ff('wss://statemine-rpc.polkadot.io/', /^(....)$/, 'release-parachains-v$1').then(v => env = setVar(env, 'STATEMINE_BUILD_BRANCH', v)), ff('wss://karura-rpc-0.aca-api.network/', /^(.)(..)(.)$/, 'release-karura-$1.$2.$3').then(v => env = setVar(env, 'KARURA_BUILD_BRANCH', v)), ff('wss://wss.api.moonriver.moonbeam.network/', /^(....)$/, 'runtime-$1').then(v => env = setVar(env, 'MOONRIVER_BUILD_BRANCH', v)), - ff('wss://ws-quartz.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'QUARTZ_MAINNET_BRANCH', fixupUnique(v))), + ff('wss://ws-quartz.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'MAINNET_BRANCH', fixupUnique(v))), ff('wss://eu-ws-westend.unique.network/', /^(.)(..)(.)$/, 'release-v$1.$2.$3').then(v => env = setVar(env, 'UNIQUEWEST_MAINNET_BRANCH', v)), ff('wss://westmint-rpc.polkadot.io/', /^(.......)$/, 'bad-branch-v$1').then(v => env = setVar(env, 'WESTMINT_BUILD_BRANCH', v)), - ff('wss://ws-opal.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'OPAL_MAINNET_BRANCH', fixupUnique(v))), + ff('wss://ws-opal.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'MAINNET_BRANCH', fixupUnique(v))), ff('wss://rpc.astar.network/', /^(.+)$/, (_, r) => { switch (r) {