diff --git a/.github/actions/run-e2e-test/action.yml b/.github/actions/run-e2e-test/action.yml index 7ed32bee15..03575852a3 100644 --- a/.github/actions/run-e2e-test/action.yml +++ b/.github/actions/run-e2e-test/action.yml @@ -23,12 +23,12 @@ inputs: description: 'Whether to deploy the adder sample contract to the node.' required: false default: 'false' - image-path: - description: 'Custom path to docker image for aleph-node' + aleph-node-image-artifact-name: + description: 'Name of aleph-node image stored in GH Artifacts' required: false - default: aleph-test-docker - node-image: - description: 'Custom name of aleph-node image' + default: aleph-node-image-test + aleph-node-image-tag: + description: 'Name of aleph-node docker image tag' required: false default: aleph-node:latest compose-file: @@ -61,7 +61,7 @@ runs: - name: Download node docker image uses: actions/download-artifact@v4 with: - name: ${{ inputs.image-path }} + name: ${{ inputs.aleph-node-image-artifact-name }} - name: Load node docker image shell: bash @@ -79,7 +79,7 @@ runs: - name: Run consensus party shell: bash run: | - NODE_IMAGE='${{ inputs.node-image }}' \ + NODE_IMAGE='${{ inputs.aleph-node-image-tag }}' \ DOCKER_COMPOSE='${{ inputs.compose-file }}' \ ./.github/scripts/run_consensus.sh -n '${{ inputs.node-count }}' diff --git a/.github/actions/store-node-and-runtime/action.yml b/.github/actions/store-node-and-runtime/action.yml index f9cd038be1..ffb01c3259 100644 --- a/.github/actions/store-node-and-runtime/action.yml +++ b/.github/actions/store-node-and-runtime/action.yml @@ -3,9 +3,15 @@ name: Store node and runtime description: This workflow stores test or release version of aleph-node and aleph-runtime in S3, in a given bucket inputs: + aleph-node-artifact-name: + required: true + description: 'Name of artifact aleph-node binary' + aleph-runtime-artifact-name: + required: true + description: 'Name of artifact aleph-runtime' profile: required: true - description: test or production + description: 'test or production' aws-access-key-id: required: true description: 'AWS Access Key ID to be used when storing artifacts' @@ -27,33 +33,24 @@ runs: exit 1 fi - - name: Get local envs - id: get-local-envs - shell: bash - env: - CARGO_PROFILE_DIRECTORY: ${{ inputs.profile == 'test' && 'release' || 'production' }} - run: | - cargo_profile_local=${{ env.CARGO_PROFILE_DIRECTORY }} - echo "cargo_profile=$cargo_profile_local" >> $GITHUB_OUTPUT - - name: Checkout aleph-node source code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Call action get-ref-properties id: get-ref-properties - uses: Cardinal-Cryptography/github-actions/get-ref-properties@v1 + uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 - name: Download binary from GH artifacts uses: actions/download-artifact@v4 with: - name: aleph-${{ inputs.profile }}-node - path: target/${{ steps.get-local-envs.outputs.cargo_profile }} + name: ${{ inputs.aleph-node-artifact-name }} + path: target - name: Download runtime from GH artifacts uses: actions/download-artifact@v4 with: - name: aleph-${{ inputs.profile }}-runtime - path: target/${{ steps.get-local-envs.outputs.cargo_profile }}/wbuild/aleph-runtime + name: ${{ inputs.aleph-runtime-artifact-name }} + path: target - name: Configure AWS credentials for S3 AWS uses: aws-actions/configure-aws-credentials@v4 @@ -68,10 +65,10 @@ runs: aws-secret-access-key: ${{ inputs.aws-secret-access-key }} aws-region: ${{ env.AWS_REGION }} - - name: Copy binary to S3 AWS bucket - uses: Cardinal-Cryptography/github-actions/copy-file-to-s3@v1 + - name: Copy aleph-node binary to S3 AWS bucket + uses: Cardinal-Cryptography/github-actions/copy-file-to-s3@v7 with: - source-path: target/${{ steps.get-local-envs.outputs.cargo_profile }} + source-path: target source-filename: aleph-node s3-bucket-path: # yamllint disable-line rule:line-length @@ -83,7 +80,7 @@ runs: - name: Copy runtime to S3 AWS bucket uses: Cardinal-Cryptography/github-actions/copy-file-to-s3@v1 with: - source-path: target/${{ steps.get-local-envs.outputs.cargo_profile }}/wbuild/aleph-runtime + source-path: target source-filename: aleph_runtime.compact.compressed.wasm s3-bucket-path: # yamllint disable-line rule:line-length diff --git a/.github/workflows/_build-aleph-e2e-client-image.yml b/.github/workflows/_build-aleph-e2e-client-image.yml index 1c973e1c1c..5ddcf47e6e 100644 --- a/.github/workflows/_build-aleph-e2e-client-image.yml +++ b/.github/workflows/_build-aleph-e2e-client-image.yml @@ -45,10 +45,10 @@ jobs: - name: Call action get-ref-properties id: get-ref-properties - uses: Cardinal-Cryptography/github-actions/get-ref-properties@v6 + uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 - name: Install Rust toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 with: targets: wasm32-unknown-unknown diff --git a/.github/workflows/_build-aleph-node.yml b/.github/workflows/_build-aleph-node.yml new file mode 100644 index 0000000000..c1f36db2b0 --- /dev/null +++ b/.github/workflows/_build-aleph-node.yml @@ -0,0 +1,91 @@ +--- +# This workflow builds aleph-node binary. It outputs name of artifacts uploaded to GH Artifacts. +name: Build aleph-node +on: + workflow_call: + inputs: + ref: + description: 'git ref: hash, branch, tag to build aleph-node binary from' + type: string + required: true + production: + description: 'Set to true to build production binary, otherwise set to false' + type: boolean + required: true + outputs: + artifact-name-binary: + description: 'Name of artifact aleph-node binary' + value: ${{ jobs.main.outputs.artifact-name-binary }} + artifact-name-image: + description: 'Name of artifact aleph-node image' + value: ${{ jobs.main.outputs.artifact-name-image }} +jobs: + main: + name: Build aleph-node (production=${{ inputs.production }}) + runs-on: [self-hosted, Linux, X64, large] + env: + RUST_BACKTRACE: full + RUSTC_WRAPPER: sccache + CARGO_FOLDER: ${{ inputs.production == true && 'production' || 'release' }} + ARTIFACT_NAME_SUFFIX: ${{ inputs.production == true && 'production' || 'test' }} + outputs: + artifact-name-binary: ${{ steps.get-artifact-name-binary.outputs.name }} + artifact-name-image: ${{ steps.get-artifact-name-image.outputs.name }} + steps: + - name: Checkout aleph-node source code + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + fetch-depth: 0 + + - name: Call action get-ref-properties + id: get-ref-properties + uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 + + - name: Install Rust toolchain + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 + + - name: Build test aleph-node + if: ${{ inputs.production != true }} + run: | + cargo build --release -p aleph-node --features only_legacy + + - name: Build production aleph-node + if: ${{ inputs.production == true }} + run: cargo build --profile production -p aleph-node + + - name: Get binary artifact name + id: get-artifact-name-binary + run: | + echo "name=aleph-node-${{ env.ARTIFACT_NAME_SUFFIX }}" >> $GITHUB_OUTPUT + + - name: Upload binary to GH Artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.get-artifact-name-binary.outputs.name }} + path: target/${{ env.CARGO_FOLDER }}/aleph-node + if-no-files-found: error + retention-days: 7 + + - name: Build aleph-node docker image + run: | + chmod +x target/${{ env.CARGO_FOLDER }}/aleph-node + if [[ ${{ inputs.production }} == true ]]; then + mkdir -p target/release + mv target/production/aleph-node target/release/ + fi + docker build --tag aleph-node:latest -f ./docker/Dockerfile . + docker save -o aleph-node.tar aleph-node:latest + + - name: Get image artifact name + id: get-artifact-name-image + run: | + echo "name=aleph-node-image-${{ env.ARTIFACT_NAME_SUFFIX }}" >> $GITHUB_OUTPUT + + - name: Upload docker to GH Artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.get-artifact-name-image.outputs.name }} + path: aleph-node.tar + if-no-files-found: error + retention-days: 7 diff --git a/.github/workflows/_build-and-push-cliain.yml b/.github/workflows/_build-and-push-cliain.yml index 558b1171d0..ee904fc002 100644 --- a/.github/workflows/_build-and-push-cliain.yml +++ b/.github/workflows/_build-and-push-cliain.yml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v4 - name: Install Rust toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 - name: ${{ env.CARGO_COMMAND }} cliain binary run: | @@ -58,7 +58,7 @@ jobs: - name: Call action get-ref-properties id: get-ref-properties - uses: Cardinal-Cryptography/github-actions/get-ref-properties@v6 + uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 - name: Download cliain from GH artifact uses: actions/download-artifact@v4 @@ -104,7 +104,7 @@ jobs: - name: Copy binary to S3 AWS bucket if: ${{ inputs.check-only != true }} - uses: Cardinal-Cryptography/github-actions/copy-file-to-s3@v6 + uses: Cardinal-Cryptography/github-actions/copy-file-to-s3@v7 with: source-path: bin/cliain/target/release source-filename: cliain diff --git a/.github/workflows/_build-and-push-featurenet-node-image.yml b/.github/workflows/_build-and-push-featurenet-node-image.yml deleted file mode 100644 index fe9c6fcfc0..0000000000 --- a/.github/workflows/_build-and-push-featurenet-node-image.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- -# This workflow builds aleph-node docker imag -name: Build and push PR image to featurenets -on: - workflow_call: - inputs: - ref: - description: 'An aleph-node git ref to build image from.' - type: string - required: true - fqdn-image: - description: 'Full path to ECR docker image.' - type: string - required: true - short-session: - description: 'If true, build aleph-node with short_session enabled.' - type: boolean - required: true -jobs: - build-test-node: - if: ${{ inputs.short-session == true }} - name: Build test node and runtime - uses: ./.github/workflows/_build-test-node.yml - with: - ref: ${{ inputs.ref }} - - build-production-node-and-runtime: - if: ${{ inputs.short-session != true }} - name: Build production node and runtime - uses: ./.github/workflows/_build-production-node-and-runtime.yml - with: - ref: ${{ inputs.ref }} - - build-and-push-featurnet-image-to-ecr: - name: Build and push featurnet image - needs: [build-test-node, build-production-node-and-runtime] - # this job should not be skipped in case one of its parent job is skipped - if: ${{ !cancelled() }} - runs-on: ubuntu-20.04 - steps: - - name: Checkout aleph-node - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref }} - fetch-depth: 0 - - - name: Download aleph-node artifact - uses: actions/download-artifact@v4 - env: - TARGET_PATH: ${{ inputs.short-session == true && 'release' || 'production' }} - ARTIFACT: ${{ inputs.short-session == true && - 'aleph-test-node' || 'aleph-production-node' }} - with: - name: ${{ env.ARTIFACT }} - path: target/release/ - - - name: Build docker image with PR aleph-node binary - run: | - chmod +x target/release/aleph-node - ls -alh target/release/ - ls -alh ./docker/ - docker build \ - --tag '${{ inputs.fqdn-image }}' \ - -f ./docker/Dockerfile . - - - name: Login to ECR - uses: docker/login-action@v3 - with: - registry: ${{ vars.ECR_PUBLIC_HOST }} - username: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }} - password: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }} - - - name: Push image to the ECR registry - id: push-image - run: | - docker push '${{ inputs.fqdn-image }}' diff --git a/.github/workflows/_build-chain-bootstrapper.yml b/.github/workflows/_build-chain-bootstrapper.yml index d3e5293c6c..5c7f056ac3 100644 --- a/.github/workflows/_build-chain-bootstrapper.yml +++ b/.github/workflows/_build-chain-bootstrapper.yml @@ -13,7 +13,13 @@ on: description: 'set to true to use production profile' type: boolean required: true - + outputs: + artifact-name-binary: + description: 'Name of artifact chain-bootstrapper binary' + value: ${{ jobs.main.outputs.artifact-name-binary }} + artifact-name-image: + description: 'Name of artifact chain-bootstrapper image' + value: ${{ jobs.main.outputs.artifact-name-image }} jobs: main: name: Build chain-bootstrapper @@ -23,6 +29,9 @@ jobs: RUSTC_WRAPPER: sccache CARGO_FOLDER: ${{ inputs.production == true && 'production' || 'release' }} ARTIFACT_NAME_SUFFIX: ${{ inputs.production == true && 'release' || 'test' }} + outputs: + artifact-name-binary: ${{ steps.get-artifact-name-binary.outputs.name }} + artifact-name-image: ${{ steps.get-artifact-name-image.outputs.name }} steps: - name: Checkout aleph-node source code uses: actions/checkout@v4 @@ -32,10 +41,10 @@ jobs: - name: Call action get-ref-properties id: get-ref-properties - uses: Cardinal-Cryptography/github-actions/get-ref-properties@v6 + uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 - name: Install Rust toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 with: targets: wasm32-unknown-unknown @@ -50,10 +59,15 @@ jobs: run: | cargo build --profile production -p chain-bootstrapper + - name: Get binary artifact name + id: get-artifact-name-binary + run: | + echo "name=chain-bootstrapper-${{ env.ARTIFACT_NAME_SUFFIX }}" >> $GITHUB_OUTPUT + - name: Upload binary to GH Artifacts uses: actions/upload-artifact@v4 with: - name: chain-bootstrapper-${{ env.ARTIFACT_NAME_SUFFIX }} + name: ${{ steps.get-artifact-name-binary.outputs.name }} path: target/${{ env.CARGO_FOLDER }}/chain-bootstrapper if-no-files-found: error retention-days: 7 @@ -61,7 +75,7 @@ jobs: - name: Build docker id: build-image run: | - chmod +x target/${{ env.CARGO_FOLDER }}/chain-bootstrapper + chmod +x target/${{ env.CARGO_FOLDER }}/chain-bootstrapper if [[ ${{ inputs.production }} == true ]]; then mkdir -p target/release mv target/production/chain-bootstrapper target/release/ @@ -69,10 +83,15 @@ jobs: docker build --tag chain-bootstrapper:latest -f ./bin/chain-bootstrapper/Dockerfile . docker save -o chain-bootstrapper.tar chain-bootstrapper:latest + - name: Get image artifact name + id: get-artifact-name-image + run: | + echo "name=chain-bootstrapper-image-${{ env.ARTIFACT_NAME_SUFFIX }}" >> $GITHUB_OUTPUT + - name: Upload docker image to GH Artifacts uses: actions/upload-artifact@v4 with: - name: chain-bootstrapper-image-${{ env.ARTIFACT_NAME_SUFFIX }} + name: ${{ steps.get-artifact-name-image.outputs.name }} path: chain-bootstrapper.tar if-no-files-found: error retention-days: 7 diff --git a/.github/workflows/_build-production-node-and-runtime.yml b/.github/workflows/_build-production-runtime.yml similarity index 62% rename from .github/workflows/_build-production-node-and-runtime.yml rename to .github/workflows/_build-production-runtime.yml index 05159a7a3a..7e11eb4349 100644 --- a/.github/workflows/_build-production-node-and-runtime.yml +++ b/.github/workflows/_build-production-runtime.yml @@ -1,21 +1,27 @@ --- -# This workflow builds production version of aleph-node and aleph-runtime -name: Build production node and runtime +# This workflow builds production version of aleph-runtime +name: Build production runtime on: workflow_call: inputs: ref: - description: 'git ref: hash, branch, tag to build production aleph-node binary from' + description: 'git ref: hash, branch, tag to build production aleph-runtime from' type: string required: true + outputs: + aleph-runtime-artifact-name: + description: 'Name of artifact aleph-runtime' + value: ${{ jobs.main.outputs.aleph-runtime-artifact-name }} jobs: main: - name: Build production node and runtime + name: Build runs-on: [self-hosted, Linux, X64, large] env: RUST_BACKTRACE: full RUSTC_WRAPPER: sccache + outputs: + aleph-runtime-artifact-name: ${{ steps.get-artifact-name.outputs.name }} steps: - name: Checkout aleph-node source code uses: actions/checkout@v4 @@ -25,32 +31,25 @@ jobs: - name: Call action get-ref-properties id: get-ref-properties - uses: Cardinal-Cryptography/github-actions/get-ref-properties@v6 + uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 - name: Install Rust toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 with: targets: wasm32-unknown-unknown - - name: Build production aleph-node - run: cargo build --profile production -p aleph-node - - - name: Upload release binary to GH artifacts - uses: actions/upload-artifact@v4 - with: - name: aleph-production-node - path: target/production/aleph-node - if-no-files-found: error - retention-days: 7 - - name: Build production aleph-runtime run: cargo build --profile production -p aleph-runtime - # required by _check-runtime-determinism.yml workflow + - name: get aleph-runtime artifact name + id: get-artifact-name + run: | + echo "name=aleph-production-runtime" >> $GITHUB_OUTPUT + - name: Upload release runtime to GH artifacts uses: actions/upload-artifact@v4 with: - name: aleph-production-runtime + name: ${{ steps.get-artifact-name.outputs.name }} path: target/production/wbuild/aleph-runtime/aleph_runtime.compact.compressed.wasm if-no-files-found: error retention-days: 7 diff --git a/.github/workflows/_build-synthetic-node.yml b/.github/workflows/_build-synthetic-node.yml index 92ef959bb8..7418295f88 100644 --- a/.github/workflows/_build-synthetic-node.yml +++ b/.github/workflows/_build-synthetic-node.yml @@ -1,28 +1,35 @@ --- -# This workflow builds synthetic network aleph-node docker -# it requires base aleph-node image +# This workflow builds synthetic network aleph-node docker, based on aleph-node:latest image name: Build production node image and e2e client image on: workflow_call: - + inputs: + aleph-node-image-artifact-name: + description: 'Name of aleph-node image stored in GH Artifacts' + type: string + required: true + outputs: + artifact-name-image: + description: 'Name of artifact aleph-node synthetic network image' + value: ${{ jobs.main.outputs.artifact-name-image }} jobs: main: name: Build synthetic node docker image runs-on: ubuntu-20.04 + outputs: + artifact-name-image: ${{ steps.get-synthetic-network-artifact-image-name.outputs.name }} steps: - name: Checkout Source code uses: actions/checkout@v4 - - name: Download release artifact + - name: Download node docker image uses: actions/download-artifact@v4 with: - name: aleph-production-node - path: target/release/ + name: ${{ inputs.aleph-node-image-artifact-name }} - - name: Build release docker image - run: | - chmod +x target/release/aleph-node - docker build --tag aleph-node:latest -f ./docker/Dockerfile . + - name: Load node docker image + shell: bash + run: docker load -i aleph-node.tar - name: Build synthetic aleph-node image shell: bash @@ -31,10 +38,15 @@ jobs: scripts/synthetic-network/build_synthetic-network.sh docker save -o aleph-node.tar aleph-node:syntheticnet + - name: Get synthetic aleph-node image name + id: get-synthetic-network-artifact-image-name + run: | + echo "name=aleph-release-synthetic-docker" >> $GITHUB_OUTPUT + - name: Upload synthetic aleph-node image uses: actions/upload-artifact@v4 with: - name: aleph-release-synthetic-docker + name: ${{ steps.get-synthetic-network-artifact-image-name.outputs.name }} path: aleph-node.tar if-no-files-found: error retention-days: 7 diff --git a/.github/workflows/_build-test-node.yml b/.github/workflows/_build-test-node.yml deleted file mode 100644 index 876c02615b..0000000000 --- a/.github/workflows/_build-test-node.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -# This workflow builds test version of aleph-node. It MUST NOT be used in the production. -name: Build test node -on: - workflow_call: - inputs: - ref: - description: 'git ref: hash, branch, tag to build test aleph-node binary from' - type: string - required: true - -jobs: - main: - name: Build test node - runs-on: [self-hosted, Linux, X64, large] - env: - RUST_BACKTRACE: full - RUSTC_WRAPPER: sccache - steps: - - name: Checkout aleph-node source code - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref }} - fetch-depth: 0 - - - name: Call action get-ref-properties - id: get-ref-properties - uses: Cardinal-Cryptography/github-actions/get-ref-properties@v6 - - - name: Install Rust toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 - - - name: Build - run: | - cargo build --release -p aleph-node --features only_legacy - - # this is required for some workflows, yet ideally it should not be required - - name: Upload binary to GH Artifacts - uses: actions/upload-artifact@v4 - with: - name: aleph-test-node - path: target/release/aleph-node - if-no-files-found: error - retention-days: 7 - - - name: Build docker - id: build-image - run: | - chmod +x target/release/aleph-node - docker build --tag aleph-node:latest -f ./docker/Dockerfile . - docker save -o aleph-node.tar aleph-node:latest - - # this is required by action/run-e2e-test.yml - - name: Upload docker to GH Artifacts - uses: actions/upload-artifact@v4 - with: - name: aleph-test-docker - path: aleph-node.tar - if-no-files-found: error - retention-days: 7 diff --git a/.github/workflows/_check-code-formatting.yml b/.github/workflows/_check-code-formatting.yml index e57a999442..c71d6a1991 100644 --- a/.github/workflows/_check-code-formatting.yml +++ b/.github/workflows/_check-code-formatting.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v4 - name: Install Nightly Rust Toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 with: channel: nightly-2024-02-14 targets: wasm32-unknown-unknown diff --git a/.github/workflows/_check-excluded-packages.yml b/.github/workflows/_check-excluded-packages.yml index 550a42036d..3e40b57079 100644 --- a/.github/workflows/_check-excluded-packages.yml +++ b/.github/workflows/_check-excluded-packages.yml @@ -20,7 +20,7 @@ jobs: # by this worfklow. Action install-rust-toolchain should have optional parameter path # in which we pass relative path to aleph-client to read its rust-toolchain.toml file - name: Install Rust Toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 # aleph-client and all its dependees still require nightly Rust version - name: Read aleph-client toolchain diff --git a/.github/workflows/_check-production-node-and-runtime.yml b/.github/workflows/_check-production-node-and-runtime.yml index 508c012eff..f7edadef8b 100644 --- a/.github/workflows/_check-production-node-and-runtime.yml +++ b/.github/workflows/_check-production-node-and-runtime.yml @@ -18,10 +18,10 @@ jobs: - name: Call action get-ref-properties id: get-ref-properties - uses: Cardinal-Cryptography/github-actions/get-ref-properties@v6 + uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 - name: Install Rust toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 with: targets: wasm32-unknown-unknown diff --git a/.github/workflows/_check-runtime-determimism.yml b/.github/workflows/_check-runtime-determimism.yml index 325b12e1f6..478c3852c8 100644 --- a/.github/workflows/_check-runtime-determimism.yml +++ b/.github/workflows/_check-runtime-determimism.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v4 - name: Install Rust toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 with: targets: wasm32-unknown-unknown diff --git a/.github/workflows/_check-vars-and-secrets.yml b/.github/workflows/_check-vars-and-secrets.yml index 98b1dd3cbf..fea3c577c9 100644 --- a/.github/workflows/_check-vars-and-secrets.yml +++ b/.github/workflows/_check-vars-and-secrets.yml @@ -15,6 +15,7 @@ jobs: if [[ \ -z '${{ vars.ECR_PUBLIC_HOST }}' || \ -z '${{ vars.ECR_PUBLIC_REGISTRY }}' || \ + -z '${{ vars.ECR_CHAIN_BOOTSTRAPPER_REPO }}' || \ -z '${{ vars.DOCKERHUB_ALEPH_NODE_REPO }}' || \ -z '${{ vars.ECR_ALEPH_NODE_REPO }}' || \ -z '${{ vars.ECR_DEV_ALEPH_NODE_REPO }}' || \ diff --git a/.github/workflows/_push-node-image-to-ecr.yml b/.github/workflows/_push-image-to-ecr.yml similarity index 66% rename from .github/workflows/_push-node-image-to-ecr.yml rename to .github/workflows/_push-image-to-ecr.yml index 3e1865182a..b005444c77 100644 --- a/.github/workflows/_push-node-image-to-ecr.yml +++ b/.github/workflows/_push-image-to-ecr.yml @@ -1,5 +1,5 @@ --- -# This workflow builds arbitrary docker node image based on binary downloaded in GH artifacts +# This workflow builds arbitrary docker image based on binary downloaded in GH artifacts name: Build and push docker image to ECR on: workflow_call: @@ -13,13 +13,17 @@ on: required: true type: string docker-image-name: - description: 'Name of node docker image to be uploaded to ECR' + description: 'Name of docker image to be uploaded to ECR' required: true type: string docker-file-path: description: 'Path to Dockerfile' required: true type: string + docker-image-name-latest: + description: 'Name of latest docker image to be uploaded to ECR' + required: false + type: string jobs: main: @@ -31,7 +35,7 @@ jobs: - name: Call action get-ref-properties id: get-ref-properties - uses: Cardinal-Cryptography/github-actions/get-ref-properties@v6 + uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 - name: Download ${{ inputs.binary-artifact-name }} from artifacts uses: actions/download-artifact@v4 @@ -44,7 +48,7 @@ jobs: run: | chmod +x target/release/${{ inputs.binary-name }} docker build \ - --tag ${{ inputs.docker-image-name }}:latest \ + --tag ${{ inputs.docker-image-name }} \ -f ${{ inputs.docker-file-path }} . - name: Login to Public Amazon ECR @@ -55,15 +59,11 @@ jobs: username: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }} password: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }} - - name: Push ${{ inputs.docker-image-name }} image to ECR - env: - CURRENT_IMAGE: ${{ inputs.docker-image-name }} - ECR_PUSH_IMAGE: ${{ vars.ECR_PUBLIC_REGISTRY }}${{ inputs.docker-image-name }} + - name: Push image to ECR run: | - docker tag '${{ env.CURRENT_IMAGE }}' \ - '${{ env.ECR_PUSH_IMAGE }}:${{ steps.get-ref-properties.outputs.sha }}' - docker push '${{ env.ECR_PUSH_IMAGE }}:${{ steps.get-ref-properties.outputs.sha }}' - if [[ '${{ steps.get-ref-properties.outputs.branch }}' -eq 'main' ]]; then - docker tag '${{ env.CURRENT_IMAGE }}' '${{ env.ECR_PUSH_IMAGE }}:latest' - docker push '${{ env.ECR_PUSH_IMAGE }}:latest' + docker push '${{ inputs.docker-image-name }}' + if [[ '${{ steps.get-ref-properties.outputs.branch }}' -eq 'main' && \ + '${{ inputs.docker-image-name-latest }}' != '' ]]; then + docker tag '${{ inputs.docker-image-name }}' '${{ inputs.docker-image-name-latest }}' + docker push '${{ inputs.docker-image-name-latest }}' fi diff --git a/.github/workflows/_run-e2e-tests.yml b/.github/workflows/_run-e2e-tests.yml index 22174a4cc2..4c7307610a 100644 --- a/.github/workflows/_run-e2e-tests.yml +++ b/.github/workflows/_run-e2e-tests.yml @@ -393,7 +393,7 @@ jobs: uses: actions/checkout@v4 - name: Install Rust toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 with: targets: wasm32-unknown-unknown components: rust-src diff --git a/.github/workflows/_sync-from-snapshot.yml b/.github/workflows/_sync-from-snapshot.yml index c2996f5a5a..f13ebf5ed2 100644 --- a/.github/workflows/_sync-from-snapshot.yml +++ b/.github/workflows/_sync-from-snapshot.yml @@ -21,15 +21,16 @@ jobs: uses: ./.github/workflows/_check-vars-and-secrets.yml secrets: inherit - build-production-node-and-runtime: + build-production-aleph-node: needs: [check-vars-and-secrets] - name: Build production node and runtime - uses: ./.github/workflows/_build-production-node-and-runtime.yml + name: Build production aleph-node + uses: ./.github/workflows/_build-aleph-node.yml with: ref: ${{ github.ref }} + production: true get-snapshot-and-sync: - needs: [build-production-node-and-runtime] + needs: [build-production-aleph-node] name: Download snapshot and run runs-on: [self-hosted, Linux, X64, medium-1000GB] steps: @@ -39,7 +40,7 @@ jobs: - name: Download release artifact uses: actions/download-artifact@v4 with: - name: aleph-production-node + name: ${{ needs.build-production-aleph-node.outputs.artifact-name-binary }} - name: Download snapshot and test sync timeout-minutes: ${{ inputs.timeout }} @@ -70,7 +71,7 @@ jobs: github.event_name != 'workflow_dispatch' steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "failure" env: diff --git a/.github/workflows/_unit-tests-and-static-checks.yml b/.github/workflows/_unit-tests-and-static-checks.yml index af5787ac71..0212d6e60b 100644 --- a/.github/workflows/_unit-tests-and-static-checks.yml +++ b/.github/workflows/_unit-tests-and-static-checks.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v4 - name: Install Rust Toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 - name: Run clippy run: | @@ -39,7 +39,7 @@ jobs: uses: actions/checkout@v4 - name: Install Rust Toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 - name: Run Unit Test Suite run: | @@ -57,7 +57,7 @@ jobs: uses: actions/checkout@v4 - name: Install Nightly Rust Toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 with: channel: nightly-2024-02-14 targets: wasm32-unknown-unknown diff --git a/.github/workflows/_update-node-image-infra.yml b/.github/workflows/_update-node-image-infra.yml index 12255fca67..1bb168bde5 100644 --- a/.github/workflows/_update-node-image-infra.yml +++ b/.github/workflows/_update-node-image-infra.yml @@ -28,7 +28,7 @@ jobs: - name: Call action get-ref-properties id: get-ref-properties - uses: Cardinal-Cryptography/github-actions/get-ref-properties@v6 + uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 - name: Call action Get ECR image names id: get-docker-image-names @@ -40,7 +40,7 @@ jobs: # this step checks indirectly as well that git HEAD has an r-* tag # otherwise ECR image would not exist - name: Check deploy image existence - uses: Cardinal-Cryptography/github-actions/check-image-existence-ecr@v6 + uses: Cardinal-Cryptography/github-actions/check-image-existence-ecr@v7 with: ecr-image: ${{ steps.get-docker-image-names.outputs.ecr-deploy-image }} diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index d49bb6436d..167b8bda33 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 - name: Install Rust toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 - name: rustdoc | Build aleph-client docs run: | diff --git a/.github/workflows/deploy-to-devnet.yml b/.github/workflows/deploy-to-devnet.yml index 135eac8bbc..9c00992628 100644 --- a/.github/workflows/deploy-to-devnet.yml +++ b/.github/workflows/deploy-to-devnet.yml @@ -149,7 +149,7 @@ jobs: if: always() steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "failure" env: diff --git a/.github/workflows/deploy-to-mainnet.yml b/.github/workflows/deploy-to-mainnet.yml index 690d9a3ac1..f70bc60277 100644 --- a/.github/workflows/deploy-to-mainnet.yml +++ b/.github/workflows/deploy-to-mainnet.yml @@ -30,14 +30,14 @@ jobs: - name: Get Testnet node commit SHA id: get-testnet-node-commit-sha - uses: Cardinal-Cryptography/github-actions/get-node-system-version@v6 + uses: Cardinal-Cryptography/github-actions/get-node-system-version@v7 with: env: testnet - name: Call action get-ref-properties id: get-ref-properties # yamllint disable-line rule:line-length - uses: Cardinal-Cryptography/github-actions/get-ref-properties@v6 + uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 - name: Compare Testnet node SHA version with currently deployed SHA if: inputs.force != true @@ -91,7 +91,7 @@ jobs: if: always() steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "always" env: diff --git a/.github/workflows/deploy-to-testnet.yml b/.github/workflows/deploy-to-testnet.yml index 033d629559..b88506588f 100644 --- a/.github/workflows/deploy-to-testnet.yml +++ b/.github/workflows/deploy-to-testnet.yml @@ -54,7 +54,7 @@ jobs: if: always() steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "always" env: diff --git a/.github/workflows/featurenet-create.yml b/.github/workflows/featurenet-create.yml index 445a6106bf..aaaf18c157 100644 --- a/.github/workflows/featurenet-create.yml +++ b/.github/workflows/featurenet-create.yml @@ -106,40 +106,86 @@ jobs: needs: [check-vars-and-secrets] runs-on: ubuntu-20.04 outputs: - fqdn-image: ${{ steps.get-aleph-node-fqdn-image.outputs.fqdn-image }} - ref: ${{ steps.get-aleph-node-fqdn-image.outputs.ref }} - image-exists: ${{ steps.get-aleph-node-fqdn-image.outputs.image-exists }} + fqdn-image: ${{ steps.get-fqdns.outputs.fqdn-image }} + ref: ${{ steps.get-fqdns.outputs.ref }} + image-exists: ${{ steps.get-fqdns.outputs.image-exists }} + # yamllint disable-line rule:line-length + chain-bootstrapper-image-exists: ${{ steps.get-fqdns.outputs.chain-bootstrapper-image-exists }} + chain-bootstrapper-fqdn-image: ${{ steps.get-fqdns.outputs.chain-bootstrapper-fqdn-image }} steps: - name: Get aleph-node fqdn path - id: get-aleph-node-fqdn-image - uses: Cardinal-Cryptography/github-actions/get-aleph-node-fqdn-image@v6 + id: get-fqdns + uses: Cardinal-Cryptography/github-actions/get-aleph-node-fqdn-image@v7 with: ref: ${{ inputs.ref }} test-binary: ${{ inputs.short-session == true && 'true' || 'false' }} ecr-dev-node-repo: ${{ vars.ECR_DEV_ALEPH_NODE_REPO }} ecr-prod-node-repo: ${{ vars.ECR_ALEPH_NODE_REPO }} + ecr-chain-bootstrapper-repo: ${{ vars.ECR_CHAIN_BOOTSTRAPPER_REPO }} + only-aleph-nope-production-repo: 'false' - build-and-push-featurenet-node-image: + build-aleph-node: + name: Build aleph-node + if: ${{ needs.get-full-docker-image-path.outputs.image-exists != 'true' }} needs: [get-full-docker-image-path] + uses: ./.github/workflows/_build-aleph-node.yml + with: + ref: ${{ needs.get-full-docker-image-path.outputs.ref }} + production: ${{ !inputs.short-session }} + + push-aleph-node-image-to-ecr: + name: Build and push aleph-node image to ECR if: ${{ needs.get-full-docker-image-path.outputs.image-exists != 'true' }} - name: Build and push PR test docker image - uses: ./.github/workflows/_build-and-push-featurenet-node-image.yml + needs: + - build-aleph-node + - get-full-docker-image-path + uses: ./.github/workflows/_push-image-to-ecr.yml + secrets: inherit + with: + binary-artifact-name: ${{ needs.build-aleph-node.outputs.artifact-name-binary }} + docker-image-name: ${{ needs.get-full-docker-image-path.outputs.fqdn-image }} + binary-name: aleph-node + docker-file-path: ./docker/Dockerfile + + build-chain-bootstrapper: + needs: [get-full-docker-image-path] + if: ${{ needs.get-full-docker-image-path.outputs.chain-bootstrapper-image-exists != 'true' }} + name: Build chain-bootstrapper + uses: ./.github/workflows/_build-chain-bootstrapper.yml with: ref: ${{ needs.get-full-docker-image-path.outputs.ref }} - fqdn-image: ${{ needs.get-full-docker-image-path.outputs.fqdn-image }} - short-session: ${{ inputs.short-session }} + production: ${{ !inputs.short-session }} + + push-chain-bootstrapper-image-to-ecr: + name: Push chain-bootstrapper docker image to ECR + if: ${{ needs.get-full-docker-image-path.outputs.chain-bootstrapper-image-exists != 'true' }} + needs: + - get-full-docker-image-path + - build-chain-bootstrapper + uses: ./.github/workflows/_push-image-to-ecr.yml secrets: inherit + with: + binary-artifact-name: ${{ needs.build-chain-bootstrapper.outputs.artifact-name-binary }} + # yamllint disable-line rule:line-length + docker-image-name: ${{ needs.get-full-docker-image-path.outputs.chain-bootstrapper-fqdn-image }} + binary-name: chain-bootstrapper + docker-file-path: ./bin/chain-bootstrapper/Dockerfile create-featurenet: - needs: [get-full-docker-image-path, build-and-push-featurenet-node-image] + needs: + - get-full-docker-image-path + - push-aleph-node-image-to-ecr + - push-chain-bootstrapper-image-to-ecr # to prevent this job to be skipped when on of the parent jobs is skipped if: ${{ !cancelled() }} - name: Create featurenet - uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-create.yml@v6 + name: Create featurenet from ${{ inputs.ref }} + uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-create.yml@v7 secrets: inherit with: featurenet-name: ${{ inputs.featurenet-name }} aleph-node-image: ${{ needs.get-full-docker-image-path.outputs.fqdn-image }} + # yamllint disable-line rule:line-length + chain-bootstrapper-image: ${{ needs.get-full-docker-image-path.outputs.chain-bootstrapper-fqdn-image }} validators: ${{ inputs.validators }} expiration: ${{ inputs.expiration }} internal: ${{ inputs.internal && true || false }} diff --git a/.github/workflows/featurenet-delete.yml b/.github/workflows/featurenet-delete.yml index 2256045a04..51558441ce 100644 --- a/.github/workflows/featurenet-delete.yml +++ b/.github/workflows/featurenet-delete.yml @@ -24,7 +24,7 @@ jobs: delete-featurenet: needs: [check-vars-and-secrets] name: Delete featurenet - uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-delete.yml@v6 + uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-delete.yml@v7 secrets: inherit with: featurenet-name: ${{ inputs.featurenet-name }} diff --git a/.github/workflows/featurenet-update.yml b/.github/workflows/featurenet-update.yml index 375aa6f802..878e405b49 100644 --- a/.github/workflows/featurenet-update.yml +++ b/.github/workflows/featurenet-update.yml @@ -74,36 +74,52 @@ jobs: needs: [check-vars-and-secrets] runs-on: ubuntu-20.04 outputs: - fqdn-image: ${{ steps.get-aleph-node-fqdn-image.outputs.fqdn-image }} - ref: ${{ steps.get-aleph-node-fqdn-image.outputs.ref }} - image-exists: ${{ steps.get-aleph-node-fqdn-image.outputs.image-exists }} + fqdn-image: ${{ steps.get-fqdns.outputs.fqdn-image }} + ref: ${{ steps.get-fqdns.outputs.ref }} + image-exists: ${{ steps.get-fqdns.outputs.image-exists }} steps: - name: Get aleph-node fqdn path - id: get-aleph-node-fqdn-image - uses: Cardinal-Cryptography/github-actions/get-aleph-node-fqdn-image@v6 + id: get-fqdns + uses: Cardinal-Cryptography/github-actions/get-aleph-node-fqdn-image@v7 with: ref: ${{ inputs.ref }} test-binary: ${{ inputs.short-session == true && 'true' || 'false' }} ecr-dev-node-repo: ${{ vars.ECR_DEV_ALEPH_NODE_REPO }} ecr-prod-node-repo: ${{ vars.ECR_ALEPH_NODE_REPO }} + ecr-chain-bootstrapper-repo: ${{ vars.ECR_CHAIN_BOOTSTRAPPER_REPO }} + only-aleph-nope-production-repo: 'false' - build-and-push-featurenet-node-image: - needs: [get-full-docker-image-path] + build-aleph-node: + name: Build aleph-node if: ${{ needs.get-full-docker-image-path.outputs.image-exists != 'true' }} - name: Build and push PR test docker image - uses: ./.github/workflows/_build-and-push-featurenet-node-image.yml + needs: [get-full-docker-image-path] + uses: ./.github/workflows/_build-aleph-node.yml with: ref: ${{ needs.get-full-docker-image-path.outputs.ref }} - fqdn-image: ${{ needs.get-full-docker-image-path.outputs.fqdn-image }} - short-session: ${{ inputs.short-session }} + production: ${{ !inputs.short-session }} + + push-aleph-node-image-to-ecr: + name: Build and push aleph-node image to ECR + if: ${{ needs.get-full-docker-image-path.outputs.image-exists != 'true' }} + needs: + - get-full-docker-image-path + - build-aleph-node + uses: ./.github/workflows/_push-image-to-ecr.yml secrets: inherit + with: + binary-artifact-name: ${{ needs.build-aleph-node.outputs.artifact-name-binary }} + docker-image-name: ${{ needs.get-full-docker-image-path.outputs.fqdn-image }} + binary-name: aleph-node + docker-file-path: ./docker/Dockerfile update-featurenet: - needs: [get-full-docker-image-path, build-and-push-featurenet-node-image] + needs: + - get-full-docker-image-path + - push-aleph-node-image-to-ecr # to prevent this job to be skipped when on of the parent jobs is skipped if: ${{ !cancelled() }} name: Update featurenet - uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-update.yml@v6 + uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-update.yml@v7 secrets: inherit with: featurenet-name: ${{ inputs.featurenet-name }} diff --git a/.github/workflows/nightly-check-node-features-build.yml b/.github/workflows/nightly-check-node-features-build.yml index cb3d503c84..2b715dad0d 100644 --- a/.github/workflows/nightly-check-node-features-build.yml +++ b/.github/workflows/nightly-check-node-features-build.yml @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@v4 - name: Install Rust toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 with: targets: wasm32-unknown-unknown @@ -54,7 +54,7 @@ jobs: github.event_name != 'workflow_dispatch' steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "failure" env: diff --git a/.github/workflows/nightly-e2e-logic-tests.yml b/.github/workflows/nightly-e2e-logic-tests.yml index b000358030..81594b3fee 100644 --- a/.github/workflows/nightly-e2e-logic-tests.yml +++ b/.github/workflows/nightly-e2e-logic-tests.yml @@ -19,11 +19,12 @@ jobs: uses: ./.github/workflows/_check-vars-and-secrets.yml secrets: inherit - build-test-node: - name: Build test node and runtime - uses: ./.github/workflows/_build-test-node.yml + build-test-aleph-node: + name: Build test aleph-node + uses: ./.github/workflows/_build-aleph-node.yml with: ref: ${{ github.ref }} + production: false build-chain-bootstrapper-test: name: Build chain-bootstrapper @@ -44,7 +45,7 @@ jobs: run-e2e-tests: name: Run e2e tests needs: - - build-test-node + - build-test-aleph-node - build-chain-bootstrapper-test - build-aleph-e2e-client-image uses: ./.github/workflows/_run-e2e-tests.yml @@ -53,7 +54,9 @@ jobs: aleph-e2e-client-image: ${{ needs.build-aleph-e2e-client-image.outputs.aleph-e2e-client-image }} run-recover-after-abft-update-test: - needs: [build-test-node, build-chain-bootstrapper-test] + needs: + - build-test-aleph-node + - build-chain-bootstrapper-test name: Run recovery test after abft update runs-on: [self-hosted, Linux, X64, medium] steps: @@ -63,13 +66,13 @@ jobs: - name: Download test node from GH artifacts uses: actions/download-artifact@v4 with: - name: aleph-test-node + name: ${{ needs.build-test-aleph-node.outputs.artifact-name-binary }} path: target/release/ - name: Download chain-bootstrapper from GH artifacts uses: actions/download-artifact@v4 with: - name: chain-bootstrapper-test + name: ${{ needs.build-chain-bootstrapper-test.outputs.artifact-name-binary }} path: target/release/ - name: Run test @@ -101,7 +104,7 @@ jobs: github.event_name != 'workflow_dispatch' steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "failure" env: diff --git a/.github/workflows/nightly-fe-e2e-tests.yml b/.github/workflows/nightly-fe-e2e-tests.yml index f4edbac263..aa15e0b097 100644 --- a/.github/workflows/nightly-fe-e2e-tests.yml +++ b/.github/workflows/nightly-fe-e2e-tests.yml @@ -29,41 +29,84 @@ jobs: needs: [check-vars-and-secrets] runs-on: ubuntu-20.04 outputs: - fqdn-image: ${{ steps.get-aleph-node-fqdn-image.outputs.fqdn-image }} - ref: ${{ steps.get-aleph-node-fqdn-image.outputs.ref }} - image-exists: ${{ steps.get-aleph-node-fqdn-image.outputs.image-exists }} + fqdn-image: ${{ steps.get-fqdns.outputs.fqdn-image }} + ref: ${{ steps.get-fqdns.outputs.ref }} + image-exists: ${{ steps.get-fqdns.outputs.image-exists }} + # yamllint disable-line rule:line-length + chain-bootstrapper-image-exists: ${{ steps.get-fqdns.outputs.chain-bootstrapper-image-exists }} + chain-bootstrapper-fqdn-image: ${{ steps.get-fqdns.outputs.chain-bootstrapper-fqdn-image }} steps: - name: Get aleph-node fqdn path from ${{ github.ref }} - id: get-aleph-node-fqdn-image - uses: Cardinal-Cryptography/github-actions/get-aleph-node-fqdn-image@v6 + id: get-fqdns + uses: Cardinal-Cryptography/github-actions/get-aleph-node-fqdn-image@v7 with: ref: ${{ github.ref }} test-binary: 'false' ecr-dev-node-repo: ${{ vars.ECR_DEV_ALEPH_NODE_REPO }} ecr-prod-node-repo: ${{ vars.ECR_ALEPH_NODE_REPO }} + ecr-chain-bootstrapper-repo: ${{ vars.ECR_CHAIN_BOOTSTRAPPER_REPO }} - build-and-push-featurenet-node-image: + build-aleph-node: + name: Build aleph-node + if: ${{ needs.get-full-docker-image-path.outputs.image-exists != 'true' }} needs: [get-full-docker-image-path] + uses: ./.github/workflows/_build-aleph-node.yml + with: + ref: ${{ needs.get-full-docker-image-path.outputs.ref }} + production: true + + push-aleph-node-image-to-ecr: + name: Build and push aleph-node image to ECR if: ${{ needs.get-full-docker-image-path.outputs.image-exists != 'true' }} - name: Build and push PR test docker image from ${{ github.ref }} - uses: ./.github/workflows/_build-and-push-featurenet-node-image.yml + needs: + - get-full-docker-image-path + - build-aleph-node + uses: ./.github/workflows/_push-image-to-ecr.yml + secrets: inherit + with: + binary-artifact-name: ${{ needs.build-aleph-node.outputs.artifact-name-binary }} + docker-image-name: ${{ needs.get-full-docker-image-path.outputs.fqdn-image }} + binary-name: aleph-node + docker-file-path: ./docker/Dockerfile + + build-chain-bootstrapper: + needs: [get-full-docker-image-path] + if: ${{ needs.get-full-docker-image-path.outputs.chain-bootstrapper-image-exists != 'true' }} + name: Build chain-bootstrapper + uses: ./.github/workflows/_build-chain-bootstrapper.yml with: ref: ${{ needs.get-full-docker-image-path.outputs.ref }} - fqdn-image: ${{ needs.get-full-docker-image-path.outputs.fqdn-image }} - short-session: false + production: ${{ !inputs.short-session }} + + push-chain-bootstrapper-image-to-ecr: + name: Push chain-bootstrapper docker image to ECR + if: ${{ needs.get-full-docker-image-path.outputs.chain-bootstrapper-image-exists != 'true' }} + needs: + - get-full-docker-image-path + - build-chain-bootstrapper + uses: ./.github/workflows/_push-image-to-ecr.yml secrets: inherit + with: + binary-artifact-name: ${{ needs.build-chain-bootstrapper.outputs.artifact-name-binary }} + # yamllint disable-line rule:line-length + docker-image-name: ${{ needs.get-full-docker-image-path.outputs.chain-bootstrapper-fqdn-image }} + binary-name: chain-bootstrapper + docker-file-path: ./bin/chain-bootstrapper/Dockerfile create-featurenet: needs: - get-full-docker-image-path - - build-and-push-featurenet-node-image + - push-aleph-node-image-to-ecr + - push-chain-bootstrapper-image-to-ecr if: ${{ !cancelled() }} name: Create featurenet from ${{ github.ref }} - uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-create.yml@v6 + uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-create.yml@v7 secrets: inherit with: featurenet-name: 'ops-finalization-e2e' aleph-node-image: ${{ needs.get-full-docker-image-path.outputs.fqdn-image }} + # yamllint disable-line rule:line-length + chain-bootstrapper-image: ${{ needs.get-full-docker-image-path.outputs.chain-bootstrapper-fqdn-image }} validators: '6' expiration: '3h' internal: true @@ -104,7 +147,7 @@ jobs: needs: - runs-finalization-e2e-test-on-fe name: Delete featurenet - uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-delete.yml@v6 + uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-delete.yml@v7 secrets: inherit with: featurenet-name: 'ops-finalization-e2e' @@ -118,7 +161,7 @@ jobs: github.event_name != 'workflow_dispatch' steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "failure" env: diff --git a/.github/workflows/nightly-integration-tests.yml b/.github/workflows/nightly-integration-tests.yml index a8d646e2cb..c78fbc90f3 100644 --- a/.github/workflows/nightly-integration-tests.yml +++ b/.github/workflows/nightly-integration-tests.yml @@ -29,14 +29,14 @@ jobs: uses: actions/checkout@v4 - name: Install Rust Toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 - name: Run Test Suite run: | cargo test --workspace --exclude baby-liminal-extension - name: Install Rust Toolchain For Chain Extension Tests - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 + uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 with: channel: nightly-2024-02-14 targets: wasm32-unknown-unknown @@ -52,7 +52,7 @@ jobs: if: ${{ !cancelled() }} steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "failure" env: diff --git a/.github/workflows/nightly-normal-session-e2e-tests.yml b/.github/workflows/nightly-normal-session-e2e-tests.yml index 7c602e45a4..dfa7e97d53 100644 --- a/.github/workflows/nightly-normal-session-e2e-tests.yml +++ b/.github/workflows/nightly-normal-session-e2e-tests.yml @@ -25,17 +25,21 @@ jobs: push: true secrets: inherit - build-production-node-and-runtime: + build-production-aleph-node: needs: [check-vars-and-secrets] - name: Build production node and runtime - uses: ./.github/workflows/_build-production-node-and-runtime.yml + name: Build production aleph-node + uses: ./.github/workflows/_build-aleph-node.yml with: ref: ${{ github.ref }} + production: true build-synthetic-node: - needs: [build-production-node-and-runtime] + needs: [build-production-aleph-node] name: Build synthetic node uses: ./.github/workflows/_build-synthetic-node.yml + with: + # yamllint disable-line rule:line-length + aleph-node-image-artifact-name: ${{ needs.build-production-aleph-node.outputs.artifact-name-image }} build-chain-bootstrapper-production: name: Build chain-bootstrapper @@ -59,8 +63,9 @@ jobs: uses: ./.github/actions/run-e2e-test with: test-case: high_out_latency_for_all - image-path: aleph-release-synthetic-docker - node-image: aleph-node:syntheticnet + # yamllint disable-line rule:line-length + aleph-node-image-artifact-name: ${{ needs.build-synthetic-node.outputs.artifact-name-image }} + aleph-node-image-tag: aleph-node:syntheticnet chain-bootstrapper-image: chain-bootstrapper-image-release compose-file: docker/docker-compose.synthetic-network.yml # yamllint disable-line rule:line-length @@ -87,8 +92,9 @@ jobs: VALIDATOR_COUNT: 7 with: test-case: test::sync::one_node_catching_up_and_then_becoming_necessary_for_consensus - image-path: aleph-release-synthetic-docker - node-image: aleph-node:syntheticnet + # yamllint disable-line rule:line-length + aleph-node-image-artifact-name: ${{ needs.build-synthetic-node.outputs.artifact-name-image }} + aleph-node-image-tag: aleph-node:syntheticnet chain-bootstrapper-image: chain-bootstrapper-image-release compose-file: docker/docker-compose.synthetic-network_sync-tests.yml node-count: 7 @@ -115,8 +121,9 @@ jobs: VALIDATOR_COUNT: 7 with: test-case: test::sync::one_node_catching_up - image-path: aleph-release-synthetic-docker - node-image: aleph-node:syntheticnet + # yamllint disable-line rule:line-length + aleph-node-image-artifact-name: ${{ needs.build-synthetic-node.outputs.artifact-name-image }} + aleph-node-image-tag: aleph-node:syntheticnet chain-bootstrapper-image: chain-bootstrapper-image-release compose-file: docker/docker-compose.synthetic-network_sync-tests.yml node-count: 7 @@ -144,8 +151,9 @@ jobs: VALIDATOR_COUNT: 7 with: test-case: test::sync::into_two_groups_and_one_quorum_and_switch_quorum_between_them - image-path: aleph-release-synthetic-docker - node-image: aleph-node:syntheticnet + # yamllint disable-line rule:line-length + aleph-node-image-artifact-name: ${{ needs.build-synthetic-node.outputs.artifact-name-image }} + aleph-node-image-tag: aleph-node:syntheticnet chain-bootstrapper-image: chain-bootstrapper-image-release compose-file: docker/docker-compose.synthetic-network_sync-tests.yml node-count: 7 @@ -172,8 +180,9 @@ jobs: VALIDATOR_COUNT: 7 with: test-case: test::sync::into_multiple_groups_of_two - image-path: aleph-release-synthetic-docker - node-image: aleph-node:syntheticnet + # yamllint disable-line rule:line-length + aleph-node-image-artifact-name: ${{ needs.build-synthetic-node.outputs.artifact-name-image }} + aleph-node-image-tag: aleph-node:syntheticnet chain-bootstrapper-image: chain-bootstrapper-image-release compose-file: docker/docker-compose.synthetic-network_sync-tests.yml node-count: 7 @@ -201,8 +210,9 @@ jobs: VALIDATOR_COUNT: 7 with: test-case: test::sync::into_two_equal_size_groups_with_no_quorum - image-path: aleph-release-synthetic-docker - node-image: aleph-node:syntheticnet + # yamllint disable-line rule:line-length + aleph-node-image-artifact-name: ${{ needs.build-synthetic-node.outputs.artifact-name-image }} + aleph-node-image-tag: aleph-node:syntheticnet chain-bootstrapper-image: chain-bootstrapper-image-release compose-file: docker/docker-compose.synthetic-network_sync-tests.yml node-count: 7 @@ -230,8 +240,9 @@ jobs: VALIDATOR_COUNT: 7 with: test-case: test::sync::into_two_groups_one_with_quorum - image-path: aleph-release-synthetic-docker - node-image: aleph-node:syntheticnet + # yamllint disable-line rule:line-length + aleph-node-image-artifact-name: ${{ needs.build-synthetic-node.outputs.artifact-name-image }} + aleph-node-image-tag: aleph-node:syntheticnet chain-bootstrapper-image: chain-bootstrapper-image-release compose-file: docker/docker-compose.synthetic-network_sync-tests.yml node-count: 7 @@ -259,8 +270,9 @@ jobs: TIMEOUT_MINUTES: "60m" with: test-case: test::sync::large_finalization_stall - image-path: aleph-release-synthetic-docker - node-image: aleph-node:syntheticnet + # yamllint disable-line rule:line-length + aleph-node-image-artifact-name: ${{ needs.build-synthetic-node.outputs.artifact-name-image }} + aleph-node-image-tag: aleph-node:syntheticnet chain-bootstrapper-image: chain-bootstrapper-image-release compose-file: docker/docker-compose.finalization_stall_with_pruning.yml # yamllint disable-line rule:line-length @@ -268,7 +280,9 @@ jobs: timeout-minutes: 60 run-major-sync-test: - needs: [build-production-node-and-runtime, build-chain-bootstrapper-production] + needs: + - build-production-aleph-node + - build-chain-bootstrapper-production name: Run major sync test runs-on: ubuntu-20.04 steps: @@ -278,13 +292,13 @@ jobs: - name: Download node binary from GH artifact uses: actions/download-artifact@v4 with: - name: aleph-production-node + name: ${{ needs.build-production-aleph-node.outputs.artifact-name-binary }} path: target/release/ - name: Download chain-bootstrapper from GH artifacts uses: actions/download-artifact@v4 with: - name: chain-bootstrapper-release + name: ${{ needs.build-chain-bootstrapper-production.outputs.artifact-name-binary }} path: target/release/ - name: Run test @@ -296,7 +310,9 @@ jobs: --testcase test_major_sync run-force-reorg-test: - needs: [build-production-node-and-runtime, build-chain-bootstrapper-production] + needs: + - build-production-aleph-node + - build-chain-bootstrapper-production name: Run force reorgs test runs-on: [self-hosted, Linux, X64, medium] steps: @@ -306,13 +322,13 @@ jobs: - name: Download node binary from GH artifact uses: actions/download-artifact@v4 with: - name: aleph-production-node + name: ${{ needs.build-production-aleph-node.outputs.artifact-name-binary }} path: target/release/ - name: Download chain-bootstrapper from GH artifacts uses: actions/download-artifact@v4 with: - name: chain-bootstrapper-release + name: ${{ needs.build-chain-bootstrapper-production.outputs.artifact-name-binary }} path: target/release/ - name: Run test @@ -338,8 +354,9 @@ jobs: uses: ./.github/actions/run-e2e-test with: test-case: high_out_latency_for_each_quorum - image-path: aleph-release-synthetic-docker - node-image: aleph-node:syntheticnet + # yamllint disable-line rule:line-length + aleph-node-image-artifact-name: ${{ needs.build-synthetic-node.outputs.artifact-name-image }} + aleph-node-image-tag: aleph-node:syntheticnet compose-file: docker/docker-compose.synthetic-network.yml chain-bootstrapper-image: chain-bootstrapper-image-release # yamllint disable-line rule:line-length @@ -376,7 +393,7 @@ jobs: github.event_name != 'workflow_dispatch' steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "failure" env: diff --git a/.github/workflows/nightly-update-test-mainnet-testnet.yml b/.github/workflows/nightly-update-test-mainnet-testnet.yml index 16b82af11a..5a422b1f16 100644 --- a/.github/workflows/nightly-update-test-mainnet-testnet.yml +++ b/.github/workflows/nightly-update-test-mainnet-testnet.yml @@ -63,7 +63,7 @@ jobs: github.event_name != 'workflow_dispatch' steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "failure" env: diff --git a/.github/workflows/nightly-update-test-testnet-main.yml b/.github/workflows/nightly-update-test-testnet-main.yml index cf8d0675c2..a7ba3a757a 100644 --- a/.github/workflows/nightly-update-test-testnet-main.yml +++ b/.github/workflows/nightly-update-test-testnet-main.yml @@ -63,7 +63,7 @@ jobs: github.event_name != 'workflow_dispatch' steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "failure" env: diff --git a/.github/workflows/on-main-or-release-branch-commit.yml b/.github/workflows/on-main-or-release-branch-commit.yml index 011aaa661d..3b96a9306c 100644 --- a/.github/workflows/on-main-or-release-branch-commit.yml +++ b/.github/workflows/on-main-or-release-branch-commit.yml @@ -13,6 +13,31 @@ jobs: uses: ./.github/workflows/_check-vars-and-secrets.yml secrets: inherit + get-full-docker-image-path: + name: Get aleph-node and chain-bootstrapper fqdn paths + needs: [check-vars-and-secrets] + runs-on: ubuntu-20.04 + outputs: + fqdn-image: ${{ steps.get-fqdns.outputs.fqdn-image }} + ref: ${{ steps.get-fqdns.outputs.ref }} + image-exists: ${{ steps.get-fqdns.outputs.image-exists }} + # yamllint disable-line rule:line-length + chain-bootstrapper-image-exists: ${{ steps.get-fqdns.outputs.chain-bootstrapper-image-exists }} + chain-bootstrapper-fqdn-image: ${{ steps.get-fqdns.outputs.chain-bootstrapper-fqdn-image }} + # yamllint disable-line rule:line-length + chain-bootstrapper-fqdn-image-latest: ${{ steps.get-fqdns.outputs.chain-bootstrapper-fqdn-image-latest }} + + steps: + - name: Get FQDNs + id: get-fqdns + uses: Cardinal-Cryptography/github-actions/get-aleph-node-fqdn-image@v7 + with: + ref: ${{ github.ref }} + ecr-dev-node-repo: ${{ vars.ECR_DEV_ALEPH_NODE_REPO }} + ecr-prod-node-repo: ${{ vars.ECR_ALEPH_NODE_REPO }} + ecr-chain-bootstrapper-repo: ${{ vars.ECR_CHAIN_BOOTSTRAPPER_REPO }} + test-binary: 'false' + build-chain-bootstrapper: needs: [check-vars-and-secrets] name: Build chain-bootstrapper @@ -22,13 +47,18 @@ jobs: production: true push-chain-bootstrapper-image-to-ecr: + needs: + - build-chain-bootstrapper + - get-full-docker-image-path name: Push chain-bootstrapper docker image to ECR - needs: [build-chain-bootstrapper] - uses: ./.github/workflows/_push-node-image-to-ecr.yml + uses: ./.github/workflows/_push-image-to-ecr.yml secrets: inherit with: - binary-artifact-name: chain-bootstrapper-release - docker-image-name: chain-bootstrapper + binary-artifact-name: ${{ needs.build-chain-bootstrapper.outputs.artifact-name-binary }} + # yamllint disable-line rule:line-length + docker-image-name: ${{ needs.get-full-docker-image-path.outputs.chain-bootstrapper-fqdn-image }} + # yamllint disable-line rule:line-length + docker-image-name-latest: ${{ needs.get-full-docker-image-path.outputs.chain-bootstrapper-fqdn-image-latest }} binary-name: chain-bootstrapper docker-file-path: ./bin/chain-bootstrapper/Dockerfile @@ -49,21 +79,31 @@ jobs: push: true secrets: inherit - build-production-node-and-runtime: + build-production-aleph-node: + needs: [check-vars-and-secrets] + name: Build production aleph-node + uses: ./.github/workflows/_build-aleph-node.yml + with: + ref: ${{ github.ref }} + production: true + + build-production-runtime: needs: [check-vars-and-secrets] - name: Build production node and runtime - uses: ./.github/workflows/_build-production-node-and-runtime.yml + name: Build production runtime + uses: ./.github/workflows/_build-production-runtime.yml with: ref: ${{ github.ref }} check-runtime-determinism: - needs: [build-production-node-and-runtime] + needs: [build-production-runtime] uses: ./.github/workflows/_check-runtime-determimism.yml store-production-node-and-runtime-in-mainnet-s3: name: Store production node and runtime in Mainnet bucket runs-on: ubuntu-20.04 - needs: [build-production-node-and-runtime] + needs: + - build-production-aleph-node + - build-production-runtime steps: - name: Checkout aleph-node source code uses: actions/checkout@v4 @@ -72,18 +112,25 @@ jobs: uses: ./.github/actions/store-node-and-runtime with: profile: production + # yamllint disable-line rule:line-length + aleph-node-artifact-name: ${{ needs.build-production-aleph-node.outputs.artifact-name-binary }} + # yamllint disable-line rule:line-length + aleph-runtime-artifact-name: ${{ needs.build-production-runtime.outputs.aleph-runtime-artifact-name }} aws-access-key-id: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }} aws-bucket: ${{ secrets.CI_MAINNET_S3BUCKET_NAME }} push-production-node-image-to-ecr: name: Push production node docker image to ECR - needs: [build-production-node-and-runtime] - uses: ./.github/workflows/_push-node-image-to-ecr.yml + needs: + - build-production-aleph-node + - get-full-docker-image-path + uses: ./.github/workflows/_push-image-to-ecr.yml secrets: inherit with: - binary-artifact-name: aleph-production-node - docker-image-name: aleph-node + binary-artifact-name: ${{ needs.build-production-aleph-node.outputs.artifact-name-binary }} + docker-image-name: ${{ needs.get-full-docker-image-path.outputs.fqdn-image }} + docker-image-name-latest: ${{ needs.get-full-docker-image-path.outputs.fqdn-image-latest }} binary-name: aleph-node docker-file-path: ./docker/Dockerfile @@ -97,7 +144,7 @@ jobs: uses: actions/checkout@v4 - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "always" env: @@ -110,7 +157,7 @@ jobs: needs: [push-production-node-image-to-ecr] steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "failure" env: diff --git a/.github/workflows/on-pull-request-change.yml b/.github/workflows/on-pull-request-change.yml index 5930d998ca..c1e774f6ae 100644 --- a/.github/workflows/on-pull-request-change.yml +++ b/.github/workflows/on-pull-request-change.yml @@ -23,6 +23,6 @@ jobs: - name: VALIDATE | Check PR title # yamllint disable-line rule:line-length - uses: Cardinal-Cryptography/github-actions/check-pr-title@v6 + uses: Cardinal-Cryptography/github-actions/check-pr-title@v7 with: pr-title: ${{ github.event.pull_request.title }} diff --git a/.github/workflows/on-pull-request-commit.yml b/.github/workflows/on-pull-request-commit.yml index 1775c57335..128283f087 100644 --- a/.github/workflows/on-pull-request-commit.yml +++ b/.github/workflows/on-pull-request-commit.yml @@ -38,11 +38,12 @@ jobs: name: Check production node and runtime uses: ./.github/workflows/_check-production-node-and-runtime.yml - build-test-node: - name: Build test node - uses: ./.github/workflows/_build-test-node.yml + build-test-aleph-node: + name: Build test aleph-node + uses: ./.github/workflows/_build-aleph-node.yml with: ref: ${{ github.ref }} + production: false build-chain-bootstrapper: name: Build chain-bootstrapper @@ -61,7 +62,7 @@ jobs: run-e2e-finalization-test: name: Run e2e finalization test needs: - - build-test-node + - build-test-aleph-node - build-aleph-e2e-client-image - build-chain-bootstrapper runs-on: ubuntu-20.04 @@ -79,7 +80,7 @@ jobs: run-e2e-token-transfer-test: name: Run e2e token transfer test needs: - - build-test-node + - build-test-aleph-node - build-aleph-e2e-client-image - build-chain-bootstrapper runs-on: ubuntu-20.04 diff --git a/.github/workflows/on-push-release-tag.yml b/.github/workflows/on-push-release-tag.yml index f98f6290bd..f143d62fb3 100644 --- a/.github/workflows/on-push-release-tag.yml +++ b/.github/workflows/on-push-release-tag.yml @@ -21,7 +21,7 @@ jobs: - name: Call action get-ref-properties id: get-ref-properties - uses: Cardinal-Cryptography/github-actions/get-ref-properties@v6 + uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 - name: Read node version id: read-node-version @@ -72,7 +72,7 @@ jobs: # fail, as there would be no aleph-node- image on ECR for that is not on main # or release branch, see on-main-or-release-branch-commit.yml - name: Check release candidate docker image existence - uses: Cardinal-Cryptography/github-actions/check-image-existence-ecr@v6 + uses: Cardinal-Cryptography/github-actions/check-image-existence-ecr@v7 with: ecr-image: ${{ steps.get-docker-image-names.outputs.ecr-rc-image }} @@ -93,7 +93,7 @@ jobs: if: always() steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "always" env: diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml index 7366dbf643..20e4616e6d 100644 --- a/.github/workflows/on-release.yml +++ b/.github/workflows/on-release.yml @@ -27,7 +27,7 @@ jobs: - name: Call action get-ref-properties id: get-ref-properties - uses: Cardinal-Cryptography/github-actions/get-ref-properties@v6 + uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 @@ -81,7 +81,7 @@ jobs: if: always() steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "always" env: diff --git a/.github/workflows/push-foundation-repo.yml b/.github/workflows/push-foundation-repo.yml index 298b1cf938..66eecc1425 100644 --- a/.github/workflows/push-foundation-repo.yml +++ b/.github/workflows/push-foundation-repo.yml @@ -51,7 +51,7 @@ jobs: - name: Call action get-ref-properties id: get-ref-properties # yamllint disable-line rule:line-length - uses: Cardinal-Cryptography/github-actions/get-ref-properties@v6 + uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 - name: Push to Aleph-Zero-Foundation # yamllint disable rule:line-length @@ -72,7 +72,7 @@ jobs: - name: Call action get-ref-properties id: get-ref-properties # yamllint disable-line rule:line-length - uses: Cardinal-Cryptography/github-actions/get-ref-properties@v6 + uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 - name: Checkout Aleph-Zero-Foundation repository uses: actions/checkout@v4 diff --git a/.github/workflows/weekly-featurenets-short-session-branch.yml b/.github/workflows/weekly-featurenets-short-session-branch.yml index 758fcacdf2..3fcc9d3af1 100644 --- a/.github/workflows/weekly-featurenets-short-session-branch.yml +++ b/.github/workflows/weekly-featurenets-short-session-branch.yml @@ -48,7 +48,7 @@ jobs: github.event_name != 'workflow_dispatch' steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "failure" env: diff --git a/.github/workflows/weekly-featurenets-short-session-full-sha.yml b/.github/workflows/weekly-featurenets-short-session-full-sha.yml index f3c1d9c7b4..0ae89d6a96 100644 --- a/.github/workflows/weekly-featurenets-short-session-full-sha.yml +++ b/.github/workflows/weekly-featurenets-short-session-full-sha.yml @@ -48,7 +48,7 @@ jobs: github.event_name != 'workflow_dispatch' steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "failure" env: diff --git a/.github/workflows/weekly-featurenets-short-session-tag.yml b/.github/workflows/weekly-featurenets-short-session-tag.yml index d9d9225777..ac4adf661b 100644 --- a/.github/workflows/weekly-featurenets-short-session-tag.yml +++ b/.github/workflows/weekly-featurenets-short-session-tag.yml @@ -48,7 +48,7 @@ jobs: github.event_name != 'workflow_dispatch' steps: - name: Send Slack message - uses: Cardinal-Cryptography/github-actions/slack-notification@v6 + uses: Cardinal-Cryptography/github-actions/slack-notification@v7 with: notify-on: "failure" env: diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yaml-lint.yml index 23fecabfe9..0d6abce8c1 100644 --- a/.github/workflows/yaml-lint.yml +++ b/.github/workflows/yaml-lint.yml @@ -19,4 +19,4 @@ jobs: steps: - name: LINT | Execute YAML linter # yamllint disable-line rule:line-length - uses: Cardinal-Cryptography/github-actions/yaml-lint@v6 + uses: Cardinal-Cryptography/github-actions/yaml-lint@v7 diff --git a/.github/workflows/yaml-validate.yml b/.github/workflows/yaml-validate.yml index c8750ac36a..129fb346d8 100644 --- a/.github/workflows/yaml-validate.yml +++ b/.github/workflows/yaml-validate.yml @@ -19,4 +19,4 @@ jobs: steps: - name: VALIDATE | Execute github-actions-validator # yamllint disable-line rule:line-length - uses: Cardinal-Cryptography/github-actions/yaml-validate@v6 + uses: Cardinal-Cryptography/github-actions/yaml-validate@v7 diff --git a/bin/chain-bootstrapper/src/main.rs b/bin/chain-bootstrapper/src/main.rs index 4ba27a10a9..1ff8e27474 100644 --- a/bin/chain-bootstrapper/src/main.rs +++ b/bin/chain-bootstrapper/src/main.rs @@ -1,6 +1,10 @@ mod chain_spec; -use sc_cli::clap::{self, Parser, Subcommand as ClapSubcommand}; +use sc_chain_spec::ChainSpec; +use sc_cli::{ + clap::{self, Parser, Subcommand as ClapSubcommand}, + SubstrateCli, +}; use crate::chain_spec::{BootstrapChainCmd, ConvertChainspecToRawCmd}; @@ -10,6 +14,36 @@ struct Cli { pub subcommand: Option, } +impl SubstrateCli for Cli { + fn impl_name() -> String { + panic!("This is not used.") + } + + fn impl_version() -> String { + panic!("This is not used.") + } + + fn description() -> String { + panic!("This is not used.") + } + + fn author() -> String { + panic!("This is not used.") + } + + fn support_url() -> String { + panic!("This is not used.") + } + + fn copyright_start_year() -> i32 { + panic!("This is not used.") + } + + fn load_spec(&self, _id: &str) -> Result, String> { + panic!("This is not used.") + } +} + #[allow(clippy::large_enum_variant)] #[derive(Debug, ClapSubcommand)] pub enum Subcommand { @@ -18,6 +52,10 @@ pub enum Subcommand { /// Takes a chainspec and generates a corresponding raw chainspec ConvertChainspecToRaw(ConvertChainspecToRawCmd), + + /// Key management cli utilities + #[command(subcommand)] + Key(sc_cli::KeySubcommand), } fn main() -> sc_cli::Result<()> { @@ -26,6 +64,7 @@ fn main() -> sc_cli::Result<()> { match &cli.subcommand { Some(Subcommand::BootstrapChain(cmd)) => cmd.run(), Some(Subcommand::ConvertChainspecToRaw(cmd)) => cmd.run(), + Some(Subcommand::Key(cmd)) => cmd.run(&cli), None => Err("Command was required!".into()), }