diff --git a/.github/actions/README.md b/.github/actions/README.md index 5f841416ea..6619940bed 100644 --- a/.github/actions/README.md +++ b/.github/actions/README.md @@ -1,49 +1,5 @@ This directory gathers useful actions for Github pipelines. -## `restore-cache` -This action restores and saves cache dedicated for Rust builds -(in particular we keep Cargo files, target directories and make use of sccache). - -### Usage -Sample usage: -```yaml -steps: -- uses: Cardinal-Cryptography/github-actions/restore-cache@cache-v1 - -- run: cargo build - -- uses: Cardinal-Cryptography/github-actions/post-cache@v1 -``` - -For building packages excluded from main workspace, you can add corresponding input parameter: -```yaml -steps: -- uses: Cardinal-Cryptography/github-actions/restore-cache@cache-v1 - with: - cargo-targets: | - excluded_package_1/target/ - aux_tool/excluded_package_2/target/ -``` - -### Notes - -**Note:** Currently we only support runners using `ubuntu:latest` image. - -**Note:** Requires calling `post-cache` action to stop sccache server. - -**Note:** There is a problem with using `cargo clippy` with `sccache` - check: https://github.com/mozilla/sccache/issues/966. -Effectively, you have to override environment variables like this: -```shell -export RUSTC_WRAPPER="" -export RUSTC_WORKSPACE_WRAPPER=sccache -cargo clippy -``` - ---- - -## `post-cache` -Stops sccache server. Use together with `restore-cache`. - --- ## `run-e2e-test` diff --git a/.github/actions/cleanup-workspace/action.yml b/.github/actions/cleanup-workspace/action.yml index 45f042703d..d10b82f770 100644 --- a/.github/actions/cleanup-workspace/action.yml +++ b/.github/actions/cleanup-workspace/action.yml @@ -1,3 +1,4 @@ +--- name: Clean runner workspace description: Removes all the files from the runner working directory diff --git a/.github/actions/destroy-feature-environment/action.yml b/.github/actions/destroy-feature-environment/action.yml index 5f6e3a915c..5b20972934 100644 --- a/.github/actions/destroy-feature-environment/action.yml +++ b/.github/actions/destroy-feature-environment/action.yml @@ -1,3 +1,4 @@ +--- name: 'Destroy Feature Environment' description: 'Action used for feature environment deletion' @@ -19,9 +20,6 @@ outputs: deployment-name: description: 'Output with a deployment name for working with deployments' value: ${{ steps.get_branch.outputs.branch_name }} - - - runs: using: "composite" steps: @@ -75,15 +73,19 @@ runs: ARGOCD_URL: argocd.dev.azero.dev run: | ## Install argocd CLI tool - curl -sSL -o argocd https://github.com/argoproj/argo-cd/releases/download/v2.3.3/argocd-linux-amd64 + curl -sSL -o argocd \ + https://github.com/argoproj/argo-cd/releases/download/v2.3.3/argocd-linux-amd64 chmod +x argocd && mv argocd /usr/local/bin/ - /usr/local/bin/argocd app get fe-root-application --hard-refresh --auth-token ${{ inputs.argo-sync-user-token }} --server ${{ env.ARGOCD_URL }} - /usr/local/bin/argocd app wait fe-root-application --auth-token ${{ inputs.argo-sync-user-token }} --server ${{ env.ARGOCD_URL }} + /usr/local/bin/argocd app get fe-root-application --hard-refresh \ + --auth-token ${{ inputs.argo-sync-user-token }} --server ${{ env.ARGOCD_URL }} + /usr/local/bin/argocd app wait fe-root-application --auth-token \ + ${{ inputs.argo-sync-user-token }} --server ${{ env.ARGOCD_URL }} - name: Clean S3 storage shell: bash env: BRANCH_NAME: ${{ steps.get_branch.outputs.branch_name }} run: | - aws s3 rm --recursive s3://fe-alephzero-devnet-eu-central-1-keys-bucket/fe-${{ env.BRANCH_NAME }} \ No newline at end of file + aws s3 rm --recursive \ + s3://fe-alephzero-devnet-eu-central-1-keys-bucket/fe-${{ env.BRANCH_NAME }} diff --git a/.github/actions/get-branch/action.yaml b/.github/actions/get-branch/action.yaml index 5d1d8b38dc..e679aa5b7a 100644 --- a/.github/actions/get-branch/action.yaml +++ b/.github/actions/get-branch/action.yaml @@ -1,3 +1,4 @@ +--- name: Get branch details description: Gets branch name and commit SHA @@ -25,5 +26,6 @@ runs: HEAD_REF: ${{ github.head_ref || github.ref }} run: | echo "##[set-output name=branch_name;]$(echo ${HEAD_REF#refs/heads/} | tr / -)" - echo "##[set-output name=branch_appname;]$(printf ${HEAD_REF#refs/heads/} | tr / - | tr '[:upper:]' '[:lower:]' | tr -c '[a-z0-9-.]' '-')" + echo "##[set-output name=branch_appname;]$(printf ${HEAD_REF#refs/heads/} \ + | tr / - | tr '[:upper:]' '[:lower:]' | tr -c '[a-z0-9-.]' '-')" echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" diff --git a/.github/actions/post-cache/action.yml b/.github/actions/post-cache/action.yml deleted file mode 100644 index b615bcc82b..0000000000 --- a/.github/actions/post-cache/action.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: "Rust cache cleanup" -description: | - Run this at the end of your workflow if you're running `rust-cache`. - -runs: - using: "composite" - steps: - - name: Prune unused packages from cargo cache - uses: actions-rs/cargo@v1 - with: - command: cache - args: clean-unref - - - name: Prune sources from cargo cache - uses: actions-rs/cargo@v1 - with: - command: cache - args: --autoclean - - - name: Stop sccache server - run: sccache --stop-server || true - shell: bash diff --git a/.github/actions/restore-cache/action.yml b/.github/actions/restore-cache/action.yml deleted file mode 100644 index 9141c8c93f..0000000000 --- a/.github/actions/restore-cache/action.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: "Restore rust cache" -description: | - Restore/save rust caches. - - This action combines 3 caches: - - 1. The ~/.cargo cache - 2. The ./target cache - 3. The sccache cache along with starting the sccache server - - All caches are keyed with cache-version along with a hash of all Cargo.lock files in the project. As a fallback they - take the newest cache with any hash of Cargo.lock files to rebuild from a partial cache in case of a Cargo.lock change. - -inputs: - cache-version: - description: "String indicating the version of the caches, change it to clean caches." - required: false - default: "v1" - target-key: - description: > - If you have multiple workflows that generate different contents of the target directory, then you can set this key - differently for them, so that they don't interfere with each other. - required: false - default: "" - cargo-key: - description: > - If you have multiple workflows that generate different contents of the ~/.cargo directory, then you can set this key - differently for them, so that they don't interfere with each other. - required: false - default: "" - sccache-version: - description: "Version number of sccache to use." - required: false - default: v0.3.0 - sccache-size: - description: "Size specifier for scache's cache" - required: false - default: "1G" - cargo-targets: - description: "Additional directories to include in the target cache" - required: false - default: "" - -runs: - using: "composite" - - steps: - - name: Restore cargo cache - uses: actions/cache@v3 - env: - SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10" - with: - path: | - ~/.cargo - key: ${{ runner.os }}-cargo-${{ inputs.cargo-key }}-${{ inputs.cache-version }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-${{ inputs.cargo-key }}-${{ inputs.cache-version }} - - - name: Restore target cache - uses: actions/cache@v3 - with: - path: | - target - ${{ inputs.cargo-targets }} - key: ${{ runner.os }}-target-${{ inputs.target-key }}-${{ inputs.cache-version }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-target-${{ inputs.target-key }}-${{ inputs.cache-version }} - - - name: Install sccache for ubuntu-20.04 - shell: bash - run: | - LINK=https://github.com/mozilla/sccache/releases/download - SCCACHE_FILE=sccache-${{ inputs.sccache-version }}-x86_64-unknown-linux-musl - - mkdir -p $HOME/.local/bin - curl -L "$LINK/${{ inputs.sccache-version }}/$SCCACHE_FILE.tar.gz" | tar xz - mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache - chmod +x $HOME/.local/bin/sccache - - echo "$HOME/.local/bin" >> $GITHUB_PATH - - - name: Restore sccache - uses: actions/cache@v3 - with: - path: /home/runner/.cache/sccache - key: ${{ runner.os }}-sccache-${{ inputs.target-key }}-${{ inputs.cache-version }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-sccache-${{ inputs.target-key }}-${{ inputs.cache-version }} - - - name: Start sccache server - env: - SCCACHE_CACHE_SIZE: ${{ inputs.sccache-size }} - shell: bash - run: sccache --start-server - - - name: Set RUSTC_WRAPPER - shell: bash - run: | - echo "RUSTC_WRAPPER=$HOME/.local/bin/sccache" >> $GITHUB_ENV - - - name: Install cargo-cache - uses: actions-rs/cargo@v1 - with: - command: install - args: cargo-cache diff --git a/.github/actions/run-e2e-test/action.yml b/.github/actions/run-e2e-test/action.yml index 7eb9a95ea3..7151a6d29f 100644 --- a/.github/actions/run-e2e-test/action.yml +++ b/.github/actions/run-e2e-test/action.yml @@ -1,3 +1,4 @@ +--- name: 'Run e2e test' description: 'Run single e2e test.' @@ -58,7 +59,11 @@ runs: - name: Run consensus party shell: bash - run: NODE_IMAGE=${{ inputs.node-image }} DOCKER_COMPOSE=${{ inputs.compose-file }} ./.github/scripts/run_consensus.sh -m ${{ inputs.min-validator-count }} -n ${{ inputs.node-count }} + run: | + NODE_IMAGE=${{ inputs.node-image }} \ + DOCKER_COMPOSE=${{ inputs.compose-file }} \ + ./.github/scripts/run_consensus.sh \ + -m ${{ inputs.min-validator-count }} -n ${{ inputs.node-count }} - name: Sleep shell: bash @@ -91,7 +96,7 @@ runs: RESERVED_SEATS="${{ inputs.reserved-seats }}" NON_RESERVED_SEATS="${{ inputs.non-reserved-seats }}" - + if [[ -n "${RANDOMIZED}" ]]; then ARGS+=(-r "${RANDOMIZED}") fi @@ -116,4 +121,6 @@ runs: - name: Run finalization e2e test if: inputs.follow-up-finalization-check == 'true' shell: bash - run: ./.github/scripts/run_e2e_test.sh -t finalization::finalization -m "${{ inputs.min-validator-count }}" + run: | + ./.github/scripts/run_e2e_test.sh \ + -t finalization::finalization -m "${{ inputs.min-validator-count }}" diff --git a/.github/actions/slack-notification/action.yml b/.github/actions/slack-notification/action.yml index bd4bc072a8..d87ef6aca4 100644 --- a/.github/actions/slack-notification/action.yml +++ b/.github/actions/slack-notification/action.yml @@ -1,6 +1,8 @@ +--- name: 'Send Slack notifiction' -description: 'Action used to send Slack notifications about workflow status in channel specified in SLACK_WEBHOOK' - +description: | + Action used to send Slack notifications about workflow status in channel specified in + SLACK_WEBHOOK inputs: notify-on: description: "Choose when Slack messages should be sent" diff --git a/.github/scripts/docker-compose.no_quorum_without_old.override.yml b/.github/scripts/docker-compose.no_quorum_without_old.override.yml index 47369bd581..7cf2e29ca1 100644 --- a/.github/scripts/docker-compose.no_quorum_without_old.override.yml +++ b/.github/scripts/docker-compose.no_quorum_without_old.override.yml @@ -1,3 +1,4 @@ +--- services: Node0: environment: diff --git a/.github/workflows/build-and-push-cliain.yaml b/.github/workflows/build-and-push-cliain.yaml index 5e05a604b3..63bb41da8d 100644 --- a/.github/workflows/build-and-push-cliain.yaml +++ b/.github/workflows/build-and-push-cliain.yaml @@ -1,9 +1,11 @@ +--- name: Build and push cliain docker image on: push: paths: - 'bin/cliain/**' + - .github/workflows/build-and-push-cliain.yaml workflow_dispatch: jobs: @@ -17,12 +19,6 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: '3.6.1' - repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Cargo | Build release binary run: | cd ./bin/cliain && cargo build --release @@ -47,7 +43,9 @@ jobs: - name: Build and push latest docker image id: build-image env: - RELEASE_IMAGE: public.ecr.aws/p6e8q1z1/cliain:${{ steps.get_branch.outputs.branch_name == 'main' && 'latest' || steps.get_branch.outputs.branch_name }} + RELEASE_IMAGE: > + public.ecr.aws/p6e8q1z1/cliain:${{ steps.get_branch.outputs.branch_name == 'main' + && 'latest' || steps.get_branch.outputs.branch_name }} uses: docker/build-push-action@v2 with: context: ./bin/cliain diff --git a/.github/workflows/build-docs.yaml b/.github/workflows/build-docs.yaml index af24cdbdef..2a864d2e99 100644 --- a/.github/workflows/build-docs.yaml +++ b/.github/workflows/build-docs.yaml @@ -1,8 +1,12 @@ +--- # this workflow builds rustdoc for aleph-node crates name: build-docs on: - push: + pull_request: + paths: + - 'aleph-client/**' + - .github/workflows/build-docs.yaml jobs: build-aleph-client-docs: diff --git a/.github/workflows/build-node-and-runtime.yml b/.github/workflows/build-node-and-runtime.yml index 52de31dd48..b6fb4a383f 100644 --- a/.github/workflows/build-node-and-runtime.yml +++ b/.github/workflows/build-node-and-runtime.yml @@ -1,3 +1,4 @@ +--- name: Build aleph-node and aleph-runtime on: @@ -61,7 +62,9 @@ jobs: - name: S3 CI MAINNET | Configure AWS credentials - if: env.SECRETS_AWS_MAINNET_ACCESS_KEY_ID != '' && env.SECRETS_AWS_MAINNET_SECRET_ACCESS_KEY != '' + if: > + env.SECRETS_AWS_MAINNET_ACCESS_KEY_ID != '' && + env.SECRETS_AWS_MAINNET_SECRET_ACCESS_KEY != '' uses: aws-actions/configure-aws-credentials@v1 env: AWS_ACCESS_KEY_ID: "" @@ -75,11 +78,14 @@ jobs: aws-region: ${{ env.AWS_REGION }} - name: S3 CI MAINNET | Copy release binary to S3 bucket - if: env.SECRETS_AWS_MAINNET_ACCESS_KEY_ID != '' && env.SECRETS_AWS_MAINNET_SECRET_ACCESS_KEY != '' + if: > + env.SECRETS_AWS_MAINNET_ACCESS_KEY_ID != '' && + env.SECRETS_AWS_MAINNET_SECRET_ACCESS_KEY != '' shell: bash env: BINARY_DIR: target/production BINARY_FILE: aleph-node + # yamllint disable-line rule:line-length S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.get_branch.outputs.sha_short }}/aleph-node S3BUCKET_FILE: aleph-node-${{ steps.get_branch.outputs.sha_short }}.tar.gz run: | @@ -87,11 +93,14 @@ jobs: aws s3 cp ${{ env.S3BUCKET_FILE }} ${{ env.S3BUCKET_URL }}/${{ env.S3BUCKET_FILE }} - name: S3 CI MAINNET | Copy release runtime to S3 bucket - if: env.SECRETS_AWS_MAINNET_ACCESS_KEY_ID != '' && env.SECRETS_AWS_MAINNET_SECRET_ACCESS_KEY != '' + if: > + env.SECRETS_AWS_MAINNET_ACCESS_KEY_ID != '' && + env.SECRETS_AWS_MAINNET_SECRET_ACCESS_KEY != '' shell: bash env: BINARY_DIR: target/production/wbuild/aleph-runtime BINARY_FILE: aleph_runtime.compact.wasm + # yamllint disable-line rule:line-length S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.get_branch.outputs.sha_short }}/aleph-runtime S3BUCKET_FILE: aleph-runtime-${{ steps.get_branch.outputs.sha_short }}.tar.gz run: | @@ -100,7 +109,9 @@ jobs: - name: Build test binary - run: cargo build --release -p aleph-node --features "short_session enable_treasury_proposals only_legacy" + run: | + cargo build --release -p aleph-node \ + --features "short_session enable_treasury_proposals only_legacy" - name: Upload test binary uses: actions/upload-artifact@v2 @@ -119,11 +130,14 @@ jobs: retention-days: 7 - name: S3 CI MAINNET | Copy test binary to S3 bucket - if: env.SECRETS_AWS_MAINNET_ACCESS_KEY_ID != '' && env.SECRETS_AWS_MAINNET_SECRET_ACCESS_KEY != '' + if: > + env.SECRETS_AWS_MAINNET_ACCESS_KEY_ID != '' && + env.SECRETS_AWS_MAINNET_SECRET_ACCESS_KEY != '' shell: bash env: BINARY_DIR: target/release BINARY_FILE: aleph-node + # yamllint disable-line rule:line-length S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.get_branch.outputs.sha_short }}/aleph-test-node S3BUCKET_FILE: aleph-test-node-${{ steps.get_branch.outputs.sha_short }}.tar.gz run: | @@ -131,11 +145,14 @@ jobs: aws s3 cp ${{ env.S3BUCKET_FILE }} ${{ env.S3BUCKET_URL }}/${{ env.S3BUCKET_FILE }} - name: S3 CI MAINNET | Copy test runtime to S3 bucket - if: env.SECRETS_AWS_MAINNET_ACCESS_KEY_ID != '' && env.SECRETS_AWS_MAINNET_SECRET_ACCESS_KEY != '' + if: > + env.SECRETS_AWS_MAINNET_ACCESS_KEY_ID != '' && + env.SECRETS_AWS_MAINNET_SECRET_ACCESS_KEY != '' shell: bash env: BINARY_DIR: target/release/wbuild/aleph-runtime BINARY_FILE: aleph_runtime.compact.wasm + # yamllint disable-line rule:line-length S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.get_branch.outputs.sha_short }}/aleph-test-runtime S3BUCKET_FILE: aleph-test-runtime-${{ steps.get_branch.outputs.sha_short }}.tar.gz run: | diff --git a/.github/workflows/build-send-postsync-hook-runtime-image.yml b/.github/workflows/build-send-postsync-hook-runtime-image.yml index e2253bb80d..f17132dfbc 100644 --- a/.github/workflows/build-send-postsync-hook-runtime-image.yml +++ b/.github/workflows/build-send-postsync-hook-runtime-image.yml @@ -1,3 +1,4 @@ +--- name: Build, send and deploy postsync hook image. on: @@ -8,6 +9,7 @@ on: paths: - 'bin/cliain/**' - 'docker-runtime-hook/**' + - .github/workflows/build-send-postsync-hook-runtime-image.yml concurrency: group: ${{ github.ref }}-${{ github.workflow }} @@ -47,7 +49,8 @@ jobs: - name: Build runtime-update-hook run: | - docker build -f docker-runtime-hook/Dockerfile . -t runtime-update-hook:${{ steps.vars.outputs.sha_short }} + docker build -f docker-runtime-hook/Dockerfile . \ + -t runtime-update-hook:${{ steps.vars.outputs.sha_short }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 @@ -69,7 +72,8 @@ jobs: - name: Push postsync hook current Image to Public ECR env: CURRENT_IMAGE: runtime-update-hook:${{ steps.vars.outputs.sha_short }} - ECR_PUSH_IMAGE: public.ecr.aws/p6e8q1z1/runtime-update-hook:${{ steps.vars.outputs.sha_short }} + ECR_PUSH_IMAGE: + public.ecr.aws/p6e8q1z1/runtime-update-hook:${{ steps.vars.outputs.sha_short }} ECR_LATEST: public.ecr.aws/p6e8q1z1/runtime-update-hook:latest run: | docker tag ${{ env.CURRENT_IMAGE }} ${{ env.ECR_PUSH_IMAGE }} @@ -92,7 +96,8 @@ jobs: - name: Update postsync hook docker image env: - RELEASE_IMAGE: public.ecr.aws/p6e8q1z1/runtime-update-hook:${{ steps.vars.outputs.sha_short }} + RELEASE_IMAGE: + public.ecr.aws/p6e8q1z1/runtime-update-hook:${{ steps.vars.outputs.sha_short }} REGIONS_AWS: 'eu-central-1' run: | # Deploy new image version for postsync hook diff --git a/.github/workflows/check-excluded-packages.yml b/.github/workflows/check-excluded-packages.yml index b1e2cdf69f..d3cabb9c2c 100644 --- a/.github/workflows/check-excluded-packages.yml +++ b/.github/workflows/check-excluded-packages.yml @@ -1,14 +1,19 @@ +--- name: Check excluded packages on: pull_request: - branches: - - '**' - push: - paths-ignore: - - '*.md' - branches: - - main + paths: + - 'flooder/**' + - 'e2e-tests/**' + - 'aleph-client/**' + - 'fork-off/**' + - 'bin/cliain/**' + - 'benches/**' + - 'contracts/**' + # TODO this package needs to be moved to /bin + - 'scripts/synthetic-network/synthetic-link/**' + - .github/workflows/check-excluded-packages.yml concurrency: group: ${{ github.ref }}-${{ github.workflow }} @@ -38,7 +43,8 @@ jobs: - name: Format output id: format_output run: | - packages="$(echo ${{ steps.read_excluded.outputs.value }} | sed 's/[][,]/ /g' | sed 's/\s\+/\n/g' | sed '/^$/d')" + packages="$(echo ${{ steps.read_excluded.outputs.value }} \ + | sed 's/[][,]/ /g' | sed 's/\s\+/\n/g' | sed '/^$/d')" targets="$(echo "$packages" | sed -r 's/[A-Za-z0-9_/-]+/&\/target\//g')" packages="${packages//$'\n'/'%0A'}" diff --git a/.github/workflows/deploy-feature-envs.yaml b/.github/workflows/deploy-feature-envs.yaml index 88248c76a3..16d05eea50 100644 --- a/.github/workflows/deploy-feature-envs.yaml +++ b/.github/workflows/deploy-feature-envs.yaml @@ -1,3 +1,4 @@ +--- name: Deploy Feature Environment on: @@ -28,13 +29,17 @@ env: jobs: ## After that job run, artefact with aleph-node is created with name: aleph-release-node build_aleph_node_binary: - if: (github.event.label.name == '[AZERO] DEPLOY-FEATURE-ENV') || (github.event.label.name == '[AZERO] DEPLOY-HOT-FEATURE-ENV') + if: > + (github.event.label.name == '[AZERO] DEPLOY-FEATURE-ENV') || + (github.event.label.name == '[AZERO] DEPLOY-HOT-FEATURE-ENV') name: Build runtime and aleph-node binary artefacts uses: ./.github/workflows/build-node-and-runtime.yml secrets: inherit push_pr_image: - if: (github.event.label.name == '[AZERO] DEPLOY-FEATURE-ENV') || (github.event.label.name == '[AZERO] DEPLOY-HOT-FEATURE-ENV') + if: > + (github.event.label.name == '[AZERO] DEPLOY-FEATURE-ENV') || + (github.event.label.name == '[AZERO] DEPLOY-HOT-FEATURE-ENV') needs: [build_aleph_node_binary] name: Build, prepare and push aleph-node image from PR to ECR runs-on: ubuntu-20.04 @@ -54,12 +59,14 @@ jobs: - name: Build docker image with PR aleph-node binary env: - IMAGE_TAG: ${{ env.FE_IMAGETAG_PREFIX }}${{ steps.get_branch.outputs.branch_imagetag_full }} + IMAGE_TAG: + ${{ env.FE_IMAGETAG_PREFIX }}${{ steps.get_branch.outputs.branch_imagetag_full }} run: | chmod +x target/release/aleph-node ls -alh target/release/ ls -alh ./docker/ - docker build --tag ${{ env.FE_ALEPHNODE_REGISTRY }}:${{ env.IMAGE_TAG }} -f ./docker/Dockerfile . + docker build --tag ${{ env.FE_ALEPHNODE_REGISTRY }}:${{ env.IMAGE_TAG }} \ + -f ./docker/Dockerfile . - name: Login to ECR uses: docker/login-action@v1 @@ -70,13 +77,16 @@ jobs: - name: Push FE aleph-node image to the feature-env-aleph-node registry env: - IMAGE_TAG: ${{ env.FE_IMAGETAG_PREFIX }}${{ steps.get_branch.outputs.branch_imagetag_full }} + IMAGE_TAG: + ${{ env.FE_IMAGETAG_PREFIX }}${{ steps.get_branch.outputs.branch_imagetag_full }} run: | docker push ${{ env.FE_ALEPHNODE_REGISTRY }}:${{ env.IMAGE_TAG }} deploy_feature_env: - if: (github.event.label.name == '[AZERO] DEPLOY-FEATURE-ENV') || (github.event.label.name == '[AZERO] DEPLOY-HOT-FEATURE-ENV') + if: > + (github.event.label.name == '[AZERO] DEPLOY-FEATURE-ENV') || + (github.event.label.name == '[AZERO] DEPLOY-HOT-FEATURE-ENV') name: Deploy feature environment based on the PR runs-on: ubuntu-20.04 outputs: @@ -132,8 +142,11 @@ jobs: env: BRANCH_NAME: ${{ steps.get_branch.outputs.branch_name }} CHAIN_ID: a0fenet + # yamllint disable rule:line-length run: | - COMMIT_ID=$(curl -s -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "system_version"}' ${{ env.RPC_TESTNET_URL }} | jq -r '.result' | cut -d "-" -f 2 | head -c 7) + COMMIT_ID=$(curl -s -H "Content-Type: application/json" \ + -d '{"id":1, "jsonrpc":"2.0", "method": "system_version"}' ${{ env.RPC_TESTNET_URL }} \ + | jq -r '.result' | cut -d "-" -f 2 | head -c 7) echo $COMMIT_ID TESTNET_IMAGE="${{ env.PUBLIC_ALEPHNODE_REGISTRY }}:$COMMIT_ID" @@ -141,29 +154,43 @@ jobs: aws s3 cp s3://${{ env.FE_KEYS_S3BUCKET }}/data data --recursive # rename validator paths - declare -A NAMES=([aleph-node-validator-0]=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY [aleph-node-validator-1]=5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty [aleph-node-validator-2]=5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y [aleph-node-validator-3]=5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy [aleph-node-validator-4]=5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw) + declare -A \ + NAMES=([aleph-node-validator-0]=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY \ + [aleph-node-validator-1]=5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty \ + [aleph-node-validator-2]=5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y \ + [aleph-node-validator-3]=5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy \ + [aleph-node-validator-4]=5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw) for NAME in "${!NAMES[@]}"; do mv -v data/$NAME data/${NAMES[$NAME]} done # Generate chainspec skeleton, it will reuse keys from the synced keystore - docker run -v $(pwd)/data:/data --env RUST_BACKTRACE=1 --entrypoint "/usr/local/bin/aleph-node" $TESTNET_IMAGE bootstrap-chain --raw --base-path /data --chain-id $CHAIN_ID --account-ids 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty,5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy,5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw --sudo-account-id 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY --faucet-account-id 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY > chainspec.json - - # Generate chainspec from skeleton - # docker run -v $(pwd):/app --env RUST_LOG=info ${{ env.FORKOFF_IMAGE }} --ws-rpc-endpoint=${{ env.WSS_TESTNET_URL }} --initial-spec-path=chainspec.skeleton.json --combined-spec-path=chainspec.json - #--storage-keep-state=Aura,Aleph,Sudo,Staking,Session,Elections,Balances - - aws s3 cp chainspec.json s3://${{ env.FE_KEYS_S3BUCKET }}/${{ env.FE_KEYS_S3PATH_PREFIX }}${{ env.BRANCH_NAME }}/chainspec.json - aws s3 cp s3://${{ env.FE_KEYS_S3BUCKET }}/data/ s3://${{ env.FE_KEYS_S3BUCKET }}/${{ env.FE_KEYS_S3PATH_PREFIX }}${{ env.BRANCH_NAME }}/data/ --recursive + docker run -v $(pwd)/data:/data --env RUST_BACKTRACE=1 \ + --entrypoint "/usr/local/bin/aleph-node" $TESTNET_IMAGE bootstrap-chain --raw \ + --base-path /data --chain-id $CHAIN_ID \ + --account-ids 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty,5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy,5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw \ + --sudo-account-id 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY \ + --faucet-account-id 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY > chainspec.json + + aws s3 cp chainspec.json \ + s3://${{ env.FE_KEYS_S3BUCKET }}/${{ env.FE_KEYS_S3PATH_PREFIX }}${{ env.BRANCH_NAME }}/chainspec.json + aws s3 cp \ + s3://${{ env.FE_KEYS_S3BUCKET }}/data/ \ + s3://${{ env.FE_KEYS_S3BUCKET }}/${{ env.FE_KEYS_S3PATH_PREFIX }}${{ env.BRANCH_NAME }}/data/ \ + --recursive + # yamllint enable rule:line-length - name: Build chainspec for Hotnet FE and send it to S3 if: contains( github.event.pull_request.labels.*.name, env.LABEL_DEPLOY_HOT) env: BRANCH_NAME: ${{ steps.get_branch.outputs.branch_name }} CHAIN_ID: a0fenet + # yamllint disable rule:line-length run: | - SYSTEM_VERSION=$(curl -s -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "system_version"}' ${{ env.RPC_MAINNET_URL }} | jq -r '.result') + SYSTEM_VERSION=$(curl -s -H "Content-Type: application/json" \ + -d '{"id":1, "jsonrpc":"2.0", "method": "system_version"}' ${{ env.RPC_MAINNET_URL }} \ + | jq -r '.result') SUFFIX="-x86_64-linux-gnu" LONG_COMMIT_ID=${SYSTEM_VERSION/%$SUFFIX} COMMIT_ID=${LONG_COMMIT_ID: -7} @@ -174,21 +201,34 @@ jobs: aws s3 cp s3://${{ env.FE_KEYS_S3BUCKET }}/data data --recursive # rename validator paths - declare -A NAMES=([aleph-node-validator-0]=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY [aleph-node-validator-1]=5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty [aleph-node-validator-2]=5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y [aleph-node-validator-3]=5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy [aleph-node-validator-4]=5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw) + declare -A \ + NAMES=([aleph-node-validator-0]=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY \ + [aleph-node-validator-1]=5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty \ + [aleph-node-validator-2]=5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y \ + [aleph-node-validator-3]=5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy \ + [aleph-node-validator-4]=5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw) for NAME in "${!NAMES[@]}"; do mv -v data/$NAME data/${NAMES[$NAME]} done # Generate chainspec skeleton, it will reuse keys from the synced keystore - docker run -v $(pwd)/data:/data --env RUST_BACKTRACE=1 --entrypoint "/usr/local/bin/aleph-node" $MAINNET_IMAGE bootstrap-chain --raw --base-path /data --chain-id $CHAIN_ID --account-ids 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty,5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy,5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw --sudo-account-id 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY > chainspec.json + docker run -v $(pwd)/data:/data --env RUST_BACKTRACE=1 \ + --entrypoint "/usr/local/bin/aleph-node" $MAINNET_IMAGE bootstrap-chain --raw \ + --base-path /data --chain-id $CHAIN_ID \ + --account-ids 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty,5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy,5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw \ + --sudo-account-id 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY > chainspec.json # Generate chainspec from skeleton # docker run -v $(pwd):/app --env RUST_LOG=info ${{ env.FORKOFF_IMAGE }} --ws-rpc-endpoint=${{ env.RPC_MAINNET_URL }} --initial-spec-path=chainspec.skeleton.json --combined-spec-path=chainspec.json - - aws s3 cp chainspec.json s3://${{ env.FE_KEYS_S3BUCKET }}/${{ env.FE_KEYS_S3PATH_PREFIX }}${{ env.BRANCH_NAME }}/chainspec.json - aws s3 cp s3://${{ env.FE_KEYS_S3BUCKET }}/data/ s3://${{ env.FE_KEYS_S3BUCKET }}/${{ env.FE_KEYS_S3PATH_PREFIX }}${{ env.BRANCH_NAME }}/data/ --recursive - + aws s3 cp \ + chainspec.json \ + s3://${{ env.FE_KEYS_S3BUCKET }}/${{ env.FE_KEYS_S3PATH_PREFIX }}${{ env.BRANCH_NAME }}/chainspec.json + aws s3 cp \ + s3://${{ env.FE_KEYS_S3BUCKET }}/data/ \ + s3://${{ env.FE_KEYS_S3BUCKET }}/${{ env.FE_KEYS_S3PATH_PREFIX }}${{ env.BRANCH_NAME }}/data/ \ + --recursive + # yamllint enable rule:line-length - name: GIT | Checkout aleph-apps repo uses: actions/checkout@master @@ -207,19 +247,35 @@ jobs: CREATE_HOOK: false run: | # Set up envs - COMMIT_ID=$(curl -s -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "system_version"}' ${{ env.RPC_TESTNET_URL }} | jq -r '.result' | cut -d "-" -f 2 | head -c 7) + COMMIT_ID=$(curl -s -H "Content-Type: application/json" \ + -d '{"id":1, "jsonrpc":"2.0", "method": "system_version"}' ${{ env.RPC_TESTNET_URL }} \ + | jq -r '.result' | cut -d "-" -f 2 | head -c 7) TESTNET_IMAGE="${{ env.PUBLIC_ALEPHNODE_REGISTRY_ESCAPED }}:$COMMIT_ID" ALEPH_PATH=$(pwd) # Create application manifest from template - sed "s/APP_NAME/${{ env.APP_NAME }}/g" $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/app-template/app-template.yaml > $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml + sed "s/APP_NAME/${{ env.APP_NAME }}/g" \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/app-template/app-template.yaml > \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml - sed "s/CREATE_HOOK/${{ env.CREATE_HOOK }}/g" $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml + sed "s/CREATE_HOOK/${{ env.CREATE_HOOK }}/g" \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && \ + mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml - sed "s/NAMESPACE/${{ env.NAMESPACE }}/g" $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml + sed "s/NAMESPACE/${{ env.NAMESPACE }}/g" \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && \ + mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml - sed "s/NODE_IMAGE/$TESTNET_IMAGE/g" $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml + sed "s/NODE_IMAGE/$TESTNET_IMAGE/g" \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && \ + mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml - name: Start mainnet image on feature environment if: contains( github.event.pull_request.labels.*.name, env.LABEL_DEPLOY_HOT) @@ -230,7 +286,9 @@ jobs: CREATE_HOOK: false run: | # Set up envs - SYSTEM_VERSION=$(curl -s -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "system_version"}' ${{ env.RPC_MAINNET_URL }} | jq -r '.result') + SYSTEM_VERSION=$(curl -s -H "Content-Type: application/json" \ + -d '{"id":1, "jsonrpc":"2.0", "method": "system_version"}' ${{ env.RPC_MAINNET_URL }} | \ + jq -r '.result') SUFFIX="-x86_64-linux-gnu" LONG_COMMIT_ID=${SYSTEM_VERSION/%$SUFFIX} COMMIT_ID=${LONG_COMMIT_ID: -7} @@ -239,13 +297,27 @@ jobs: # Create application manifest from template - sed "s/APP_NAME/${{ env.APP_NAME }}/g" $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/app-template/app-template.yaml > $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml + sed "s/APP_NAME/${{ env.APP_NAME }}/g" \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/app-template/app-template.yaml > \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml - sed "s/CREATE_HOOK/${{ env.CREATE_HOOK }}/g" $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml + sed "s/CREATE_HOOK/${{ env.CREATE_HOOK }}/g" \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && \ + mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml - sed "s/NAMESPACE/${{ env.NAMESPACE }}/g" $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml + sed "s/NAMESPACE/${{ env.NAMESPACE }}/g" \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && \ + mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml - sed "s/NODE_IMAGE/$MAINNET_IMAGE/g" $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml + sed "s/NODE_IMAGE/$MAINNET_IMAGE/g" \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && \ + mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml - name: GIT | Commit changes to aleph-apps repository. uses: EndBug/add-and-commit@v5.1.0 @@ -266,15 +338,19 @@ jobs: ARGOCD_URL: argocd.dev.azero.dev run: | ## Install argocd CLI tool - curl -sSL -o argocd https://github.com/argoproj/argo-cd/releases/download/v2.3.3/argocd-linux-amd64 + curl -sSL -o argocd \ + https://github.com/argoproj/argo-cd/releases/download/v2.3.3/argocd-linux-amd64 chmod +x argocd && mv argocd /usr/local/bin/ ## Sync argo to start deployment - /usr/local/bin/argocd app get fe-root-application --hard-refresh --auth-token ${{ secrets.ARGO_SYNC_USER_TOKEN }} --server ${{ env.ARGOCD_URL }} + /usr/local/bin/argocd app get fe-root-application --hard-refresh --auth-token \ + ${{ secrets.ARGO_SYNC_USER_TOKEN }} --server ${{ env.ARGOCD_URL }} ## Wait for the app to be deployed - /usr/local/bin/argocd app wait fe-root-application --auth-token ${{ secrets.ARGO_SYNC_USER_TOKEN }} --server ${{ env.ARGOCD_URL }} - /usr/local/bin/argocd app wait ${{ env.APP_NAME }} --auth-token ${{ secrets.ARGO_SYNC_USER_TOKEN }} --server ${{ env.ARGOCD_URL }} + /usr/local/bin/argocd app wait fe-root-application --auth-token \ + ${{ secrets.ARGO_SYNC_USER_TOKEN }} --server ${{ env.ARGOCD_URL }} + /usr/local/bin/argocd app wait ${{ env.APP_NAME }} --auth-token \ + ${{ secrets.ARGO_SYNC_USER_TOKEN }} --server ${{ env.ARGOCD_URL }} - name: Wait for the testnet aleph-node binary to accept some blocks uses: juliangruber/sleep-action@v1.0.1 @@ -282,8 +358,10 @@ jobs: time: 5m update_feature_env_image: - if: (github.event.label.name == '[AZERO] DEPLOY-FEATURE-ENV') || (github.event.label.name == '[AZERO] DEPLOY-HOT-FEATURE-ENV') - needs: [push_pr_image,deploy_feature_env] + if: > + (github.event.label.name == '[AZERO] DEPLOY-FEATURE-ENV') || + (github.event.label.name == '[AZERO] DEPLOY-HOT-FEATURE-ENV') + needs: [push_pr_image, deploy_feature_env] name: Update feature environment to the latest PR aleph-node image runs-on: ubuntu-20.04 steps: @@ -304,7 +382,8 @@ jobs: - name: Update feature environment to the latest PR image env: - IMAGE_TAG: ${{ env.FE_IMAGETAG_PREFIX }}${{ steps.get_branch.outputs.branch_imagetag_full }} + IMAGE_TAG: + ${{ env.FE_IMAGETAG_PREFIX }}${{ steps.get_branch.outputs.branch_imagetag_full }} APP_NAME: ${{ env.FE_APP_PREFIX }}${{ steps.get_branch.outputs.branch_appname }} ARGOCD_URL: argocd.dev.azero.dev NAMESPACE: ${{ env.FE_APP_PREFIX }}${{ steps.get_branch.outputs.branch_appname }} @@ -314,24 +393,41 @@ jobs: PR_IMAGE="${{ env.FE_ALEPHNODE_REGISTRY_ESCAPED }}\:${{ env.IMAGE_TAG }}" ALEPH_PATH=$(pwd) - sed "s/APP_NAME/${{ env.APP_NAME }}/g" $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/app-template/app-template.yaml > $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml + sed "s/APP_NAME/${{ env.APP_NAME }}/g" \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/app-template/app-template.yaml > \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml - sed "s/CREATE_HOOK/${{ env.CREATE_HOOK }}/g" $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml + sed "s/CREATE_HOOK/${{ env.CREATE_HOOK }}/g" \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && \ + mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml - sed "s/NAMESPACE/${{ env.NAMESPACE }}/g" $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml + sed "s/NAMESPACE/${{ env.NAMESPACE }}/g" \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && \ + mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml - sed "s/NODE_IMAGE/$PR_IMAGE/g" $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml + sed "s/NODE_IMAGE/$PR_IMAGE/g" \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml > \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp && \ + mv $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml.temp \ + $ALEPH_PATH/aleph-apps/argocd/overlays/devnet/fe-apps/${{ env.APP_NAME }}.yaml - name: GIT | Commit changes to aleph-apps repository. uses: EndBug/add-and-commit@v5.1.0 env: - IMAGE_TAG: ${{ env.FE_IMAGETAG_PREFIX }}${{ steps.get_branch.outputs.branch_imagetag_full }} + IMAGE_TAG: + ${{ env.FE_IMAGETAG_PREFIX }}${{ steps.get_branch.outputs.branch_imagetag_full }} APP_NAME: ${{ env.FE_APP_PREFIX }}${{ steps.get_branch.outputs.branch_appname }} GITHUB_TOKEN: ${{ secrets.CI_GH_TOKEN }} with: author_name: AlephZero Automation author_email: alephzero@10clouds.com - message: "Image changed for the feature environment to: ${{ env.FE_ALEPHNODE_REGISTRY }}:${{ env.IMAGE_TAG }}" + message: + "Image changed for the feature environment to: + ${{ env.FE_ALEPHNODE_REGISTRY }}:${{ env.IMAGE_TAG }}" add: "*.yaml" cwd: "aleph-apps" branch: main @@ -342,15 +438,19 @@ jobs: ARGOCD_URL: argocd.dev.azero.dev run: | ## Install argocd CLI tool - curl -sSL -o argocd https://github.com/argoproj/argo-cd/releases/download/v2.3.3/argocd-linux-amd64 + curl -sSL -o argocd \ + https://github.com/argoproj/argo-cd/releases/download/v2.3.3/argocd-linux-amd64 chmod +x argocd && mv argocd /usr/local/bin/ ## Sync argo to start deployment - /usr/local/bin/argocd app get fe-root-application --hard-refresh --auth-token ${{ secrets.ARGO_SYNC_USER_TOKEN }} --server ${{ env.ARGOCD_URL }} + /usr/local/bin/argocd app get fe-root-application --hard-refresh \ + --auth-token ${{ secrets.ARGO_SYNC_USER_TOKEN }} --server ${{ env.ARGOCD_URL }} ## Wait for the app to be deployed - /usr/local/bin/argocd app wait fe-root-application --auth-token ${{ secrets.ARGO_SYNC_USER_TOKEN }} --server ${{ env.ARGOCD_URL }} - /usr/local/bin/argocd app wait ${{ env.APP_NAME }} --auth-token ${{ secrets.ARGO_SYNC_USER_TOKEN }} --server ${{ env.ARGOCD_URL }} + /usr/local/bin/argocd app wait fe-root-application \ + --auth-token ${{ secrets.ARGO_SYNC_USER_TOKEN }} --server ${{ env.ARGOCD_URL }} + /usr/local/bin/argocd app wait ${{ env.APP_NAME }} \ + --auth-token ${{ secrets.ARGO_SYNC_USER_TOKEN }} --server ${{ env.ARGOCD_URL }} - name: Remove testnet deployment request label if exists if: contains( github.event.pull_request.labels.*.name, env.LABEL_DEPLOY) @@ -388,6 +488,7 @@ jobs: status: ${{ job.status }} env: ${{ steps.get_branch.outputs.branch_name }} deployment_id: ${{ needs.deploy_feature_env.outputs.deployment-id }} + # yamllint disable-line rule:line-length env_url: https://dev.azero.dev/?rpc=wss%3A%2F%2Fws-${{ env.FE_APP_PREFIX }}${{ steps.get_branch.outputs.branch_appname }}.dev.azero.dev#/explorer ref: ${{ github.head_ref }} @@ -450,7 +551,10 @@ jobs: environment: ${{ steps.delete_fe.outputs.deployment-name }} destroy_feature_env_on_close: - if: (github.event.action == 'closed' && !contains( github.event.pull_request.labels.*.name, 'DESTROYED') && contains( github.event.pull_request.labels.*.name, 'DEPLOYED')) + if: > + github.event.action == 'closed' && + !contains(github.event.pull_request.labels.*.name, 'DESTROYED') && + contains(github.event.pull_request.labels.*.name, 'DEPLOYED') name: Destroy feature env when PR closed runs-on: ubuntu-20.04 steps: diff --git a/.github/workflows/deploy-mainnet.yml b/.github/workflows/deploy-mainnet.yml index b984fb29d6..fcca47550f 100644 --- a/.github/workflows/deploy-mainnet.yml +++ b/.github/workflows/deploy-mainnet.yml @@ -1,3 +1,4 @@ +--- name: Deploy to Mainnet on: @@ -13,7 +14,7 @@ jobs: runs-on: ubuntu-20.04 environment: 'mainnet' env: - AWS_REGION: us-east-1 # this region is used by all public ECR repos + AWS_REGION: us-east-1 # this region is used by all public ECR repos steps: - name: GIT | Checkout uses: actions/checkout@v2 @@ -62,7 +63,8 @@ jobs: - name: Tag and push image of Mainnet to DockerHub env: MAINNET_IMAGE: public.ecr.aws/p6e8q1z1/aleph-node:${{ steps.vars.outputs.branch }} - DOCKERHUB_MAINNET_IMAGE: cardinalcryptography/aleph-zero:mainnet-${{ steps.vars.outputs.branch }} + DOCKERHUB_MAINNET_IMAGE: + cardinalcryptography/aleph-zero:mainnet-${{ steps.vars.outputs.branch }} DOCKERHUB_MAINNET_LATEST_IMAGE: cardinalcryptography/aleph-zero:mainnet-latest run: | echo "FROM ${{ env.MAINNET_IMAGE }}" > Dockerfile.dockerhub @@ -84,6 +86,7 @@ jobs: - name: S3 CI | Download release runtime from S3 bucket shell: bash env: + # yamllint disable-line rule:line-length S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.vars.outputs.sha_short }}/aleph-runtime S3BUCKET_FILE: aleph-runtime-${{ steps.vars.outputs.sha_short }}.tar.gz run: | @@ -119,11 +122,13 @@ jobs: for i in "${region_array[@]}"; do # Deploy new image version for archivist cd ${aleph_path}/aleph-apps/aleph-node-archivists/overlays/mainnet/${i} - kustomize edit set image "aleph-node-archivist-image-placeholder=${{ env.MAINNET_IMAGE }}" + kustomize edit set image \ + "aleph-node-archivist-image-placeholder=${{ env.MAINNET_IMAGE }}" # Deploy new image version for validator cd ${aleph_path}/aleph-apps/aleph-node-validators/overlays/mainnet/${i} - kustomize edit set image "aleph-node-validator-image-placeholder=${{ env.MAINNET_IMAGE }}" + kustomize edit set image \ + "aleph-node-validator-image-placeholder=${{ env.MAINNET_IMAGE }}" done - name: GIT | Commit changes to aleph-apps repository. diff --git a/.github/workflows/deploy-testnet.yml b/.github/workflows/deploy-testnet.yml index 8c3a740c70..eb152991e2 100644 --- a/.github/workflows/deploy-testnet.yml +++ b/.github/workflows/deploy-testnet.yml @@ -1,3 +1,4 @@ +--- name: Deploy to Testnet on: @@ -11,10 +12,10 @@ jobs: deploy-testnet: name: Deploy new aleph-node image to Testnet EKS runs-on: ubuntu-20.04 - environment: + environment: name: testnet env: - AWS_REGION: us-east-1 # this region is used by all public ECR repos + AWS_REGION: us-east-1 # this region is used by all public ECR repos steps: - name: GIT | Checkout uses: actions/checkout@v2 @@ -46,10 +47,12 @@ jobs: DEVNET_IMAGE: public.ecr.aws/p6e8q1z1/aleph-node:${{ steps.vars.outputs.sha_short }} TESTNET_IMAGE: public.ecr.aws/p6e8q1z1/aleph-node:${{ steps.vars.outputs.branch }} run: | - export image_not_exist=$(docker manifest inspect ${{ env.DEVNET_IMAGE }} &> /dev/null ; echo $?) + export image_not_exist=$(docker manifest inspect ${{ env.DEVNET_IMAGE }} \ + &> /dev/null ; echo $?) if [ $image_not_exist -eq 1 ]; then - echo "::error title=Wrong docker image tag::Docker image ${{ env.DEVNET_IMAGE }} doesn't exist" + echo "::error title=Wrong docker image tag::Docker image ${{ env.DEVNET_IMAGE }} \ + doesn't exist" exit 1 else docker pull ${{ env.DEVNET_IMAGE }} @@ -67,7 +70,8 @@ jobs: - name: Tag and push image of Testnet to DockerHub env: TESTNET_IMAGE: public.ecr.aws/p6e8q1z1/aleph-node:${{ steps.vars.outputs.branch }} - DOCKERHUB_TESTNET_IMAGE: cardinalcryptography/aleph-zero:testnet-${{ steps.vars.outputs.branch }} + DOCKERHUB_TESTNET_IMAGE: + cardinalcryptography/aleph-zero:testnet-${{ steps.vars.outputs.branch }} DOCKERHUB_TESTNET_LATEST_IMAGE: cardinalcryptography/aleph-zero:testnet-latest run: | echo "FROM ${{ env.TESTNET_IMAGE }}" > Dockerfile.dockerhub @@ -80,6 +84,7 @@ jobs: - name: S3 CI | Download release runtime from S3 bucket shell: bash env: + # yamllint disable-line rule:line-length S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.vars.outputs.sha_short }}/aleph-runtime S3BUCKET_FILE: aleph-runtime-${{ steps.vars.outputs.sha_short }}.tar.gz run: | @@ -115,11 +120,13 @@ jobs: for i in "${region_array[@]}"; do # Deploy new image version for archivist cd ${aleph_path}/aleph-apps/aleph-node-archivists/overlays/testnet/${i} - kustomize edit set image "aleph-node-archivist-image-placeholder=${{ env.TESTNET_IMAGE }}" + kustomize edit set image \ + "aleph-node-archivist-image-placeholder=${{ env.TESTNET_IMAGE }}" # Deploy new image version for validator cd ${aleph_path}/aleph-apps/aleph-node-validators/overlays/testnet/${i} - kustomize edit set image "aleph-node-validator-image-placeholder=${{ env.TESTNET_IMAGE }}" + kustomize edit set image \ + "aleph-node-validator-image-placeholder=${{ env.TESTNET_IMAGE }}" done - name: GIT | Commit changes to aleph-apps repository. @@ -127,7 +134,8 @@ jobs: with: author_name: AlephZero Automation author_email: alephzero@10clouds.com - message: "Updating Testnet docker image tag for pre-release: ${{ steps.vars.outputs.branch }}" + message: + "Updating Testnet docker image tag for pre-release: ${{ steps.vars.outputs.branch }}" add: "*.yaml" cwd: "aleph-apps" branch: testnet diff --git a/.github/workflows/deploy-to-devnet.yml b/.github/workflows/deploy-to-devnet.yml index 9687480835..6938f7833e 100644 --- a/.github/workflows/deploy-to-devnet.yml +++ b/.github/workflows/deploy-to-devnet.yml @@ -1,3 +1,4 @@ +--- name: Deploy to Devnet # This workflow performs automatic deployment of aleph-node to the Devnet environment @@ -59,7 +60,17 @@ jobs: #!/bin/bash aws s3 cp s3://alephzero-devnet-eu-central-1-keys-bucket/data data --recursive # rename validator paths - declare -A NAMES=([aleph-node-validator-0]=5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH [aleph-node-validator-1]=5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o [aleph-node-validator-2]=5Dfis6XL8J2P6JHUnUtArnFWndn62SydeP8ee8sG2ky9nfm9 [aleph-node-validator-3]=5F4H97f7nQovyrbiq4ZetaaviNwThSVcFobcA5aGab6167dK [aleph-node-validator-4]=5DiDShBWa1fQx6gLzpf3SFBhMinCoyvHM1BWjPNsmXS8hkrW [aleph-node-validator-5]=5EFb84yH9tpcFuiKUcsmdoF7xeeY3ajG1ZLQimxQoFt9HMKR [aleph-node-validator-6]=5DZLHESsfGrJ5YzT3HuRPXsSNb589xQ4Unubh1mYLodzKdVY [aleph-node-validator-7]=5GHJzqvG6tXnngCpG7B12qjUvbo5e4e9z8Xjidk3CQZHxTPZ [aleph-node-validator-8]=5CUnSsgAyLND3bxxnfNhgWXSe9Wn676JzLpGLgyJv858qhoX [aleph-node-validator-9]=5CVKn7HAZW1Ky4r7Vkgsr7VEW88C2sHgUNDiwHY9Ct2hjU8q) + declare -A \ + NAMES=([aleph-node-validator-0]=5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH \ + [aleph-node-validator-1]=5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o \ + [aleph-node-validator-2]=5Dfis6XL8J2P6JHUnUtArnFWndn62SydeP8ee8sG2ky9nfm9 \ + [aleph-node-validator-3]=5F4H97f7nQovyrbiq4ZetaaviNwThSVcFobcA5aGab6167dK \ + [aleph-node-validator-4]=5DiDShBWa1fQx6gLzpf3SFBhMinCoyvHM1BWjPNsmXS8hkrW \ + [aleph-node-validator-5]=5EFb84yH9tpcFuiKUcsmdoF7xeeY3ajG1ZLQimxQoFt9HMKR \ + [aleph-node-validator-6]=5DZLHESsfGrJ5YzT3HuRPXsSNb589xQ4Unubh1mYLodzKdVY \ + [aleph-node-validator-7]=5GHJzqvG6tXnngCpG7B12qjUvbo5e4e9z8Xjidk3CQZHxTPZ \ + [aleph-node-validator-8]=5CUnSsgAyLND3bxxnfNhgWXSe9Wn676JzLpGLgyJv858qhoX \ + [aleph-node-validator-9]=5CVKn7HAZW1Ky4r7Vkgsr7VEW88C2sHgUNDiwHY9Ct2hjU8q) for NAME in "${!NAMES[@]}"; do mv -v data/$NAME data/${NAMES[$NAME]} done @@ -68,11 +79,17 @@ jobs: env: RELEASE_TAG: ${{ steps.vars.outputs.sha_short }} + # yamllint disable rule:line-length run: | #!/bin/bash aws s3 cp s3://alephzero-devnet-eu-central-1-keys-bucket/data data --recursive - docker run -i -v $(pwd)/data:/data --env RUST_BACKTRACE=1 --entrypoint "/usr/local/bin/aleph-node" public.ecr.aws/p6e8q1z1/aleph-node:${RELEASE_TAG} bootstrap-chain --raw --base-path /data --chain-id a0dnet1 --account-ids 5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH,5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o,5Dfis6XL8J2P6JHUnUtArnFWndn62SydeP8ee8sG2ky9nfm9,5F4H97f7nQovyrbiq4ZetaaviNwThSVcFobcA5aGab6167dK,5DiDShBWa1fQx6gLzpf3SFBhMinCoyvHM1BWjPNsmXS8hkrW,5EFb84yH9tpcFuiKUcsmdoF7xeeY3ajG1ZLQimxQoFt9HMKR,5DZLHESsfGrJ5YzT3HuRPXsSNb589xQ4Unubh1mYLodzKdVY,5GHJzqvG6tXnngCpG7B12qjUvbo5e4e9z8Xjidk3CQZHxTPZ,5CUnSsgAyLND3bxxnfNhgWXSe9Wn676JzLpGLgyJv858qhoX,5CVKn7HAZW1Ky4r7Vkgsr7VEW88C2sHgUNDiwHY9Ct2hjU8q --sudo-account-id 5F4SvwaUEQubiqkPF8YnRfcN77cLsT2DfG4vFeQmSXNjR7hD > chainspec.json + docker run -i -v $(pwd)/data:/data --env RUST_BACKTRACE=1 --entrypoint \ + "/usr/local/bin/aleph-node" public.ecr.aws/p6e8q1z1/aleph-node:${RELEASE_TAG} \ + bootstrap-chain --raw --base-path /data --chain-id a0dnet1 \ + --account-ids 5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH,5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o,5Dfis6XL8J2P6JHUnUtArnFWndn62SydeP8ee8sG2ky9nfm9,5F4H97f7nQovyrbiq4ZetaaviNwThSVcFobcA5aGab6167dK,5DiDShBWa1fQx6gLzpf3SFBhMinCoyvHM1BWjPNsmXS8hkrW,5EFb84yH9tpcFuiKUcsmdoF7xeeY3ajG1ZLQimxQoFt9HMKR,5DZLHESsfGrJ5YzT3HuRPXsSNb589xQ4Unubh1mYLodzKdVY,5GHJzqvG6tXnngCpG7B12qjUvbo5e4e9z8Xjidk3CQZHxTPZ,5CUnSsgAyLND3bxxnfNhgWXSe9Wn676JzLpGLgyJv858qhoX,5CVKn7HAZW1Ky4r7Vkgsr7VEW88C2sHgUNDiwHY9Ct2hjU8q \ + --sudo-account-id 5F4SvwaUEQubiqkPF8YnRfcN77cLsT2DfG4vFeQmSXNjR7hD > chainspec.json aws s3 cp chainspec.json s3://alephzero-devnet-eu-central-1-keys-bucket/chainspec.json + # yamllint enable rule:line-length - name: Stop and purge db Devnet run: | @@ -89,7 +106,8 @@ jobs: #!/bin/bash cd aleph-apps/aleph-node-validators/overlays/devnet/eu-central-1 - kustomize edit set image "aleph-node-validator-image-placeholder=public.ecr.aws/p6e8q1z1/aleph-node:${RELEASE_TAG}" + kustomize edit set image \ + "aleph-node-validator-image-placeholder=public.ecr.aws/p6e8q1z1/aleph-node:${RELEASE_TAG}" kustomize build . | kubectl apply -f - sleep 2 kubectl rollout status --watch --timeout=3600s statefulset/aleph-node-validator -n devnet diff --git a/.github/workflows/e2e-tests-main-devnet.yml b/.github/workflows/e2e-tests-main-devnet.yml index 15aeab33a0..9e5ae3e504 100644 --- a/.github/workflows/e2e-tests-main-devnet.yml +++ b/.github/workflows/e2e-tests-main-devnet.yml @@ -1,18 +1,21 @@ +--- name: e2e-tests-main-devnet on: pull_request: paths-ignore: - - '*.md' + - 'fork-off/**' + - 'flooder/**' branches: - main - - "release-*" + - 'release-*' push: paths-ignore: - - '*.md' + - 'fork-off/**' + - 'flooder/**' branches: - main - - "release-*" + - 'release-*' workflow_dispatch: concurrency: @@ -135,7 +138,8 @@ jobs: run: | cd e2e-tests/ rm -f target/release/deps/aleph_e2e_client* - cp $(cargo test --no-run --release --message-format=json | jq -r .executable | grep aleph_e2e_client) target/release/aleph-e2e-client + cp $(cargo test --no-run --release --message-format=json | jq -r .executable | \ + grep aleph_e2e_client) target/release/aleph-e2e-client docker build --tag aleph-e2e-client:latest -f Dockerfile . docker save -o aleph-e2e-client.tar aleph-e2e-client:latest @@ -151,7 +155,8 @@ jobs: needs: [build-test-docker] name: Checks if runtime file in aleph-client is up-to-date # disabling this check as it causes troubles - # this should be reworked to sth like https://github.com/paritytech/subxt/blob/master/examples/examples/metadata_compatibility.rs + # this should be reworked to sth like + # https://github.com/paritytech/subxt/blob/master/examples/examples/metadata_compatibility.rs if: false runs-on: ubuntu-20.04 steps: @@ -168,7 +173,9 @@ jobs: run: | cd aleph-client docker pull public.ecr.aws/p6e8q1z1/subxt-client-integration:latest - docker run --rm --network host --mount type=bind,source="$(pwd)/..",target=/subxt/aleph-node public.ecr.aws/p6e8q1z1/subxt-client-integration:latest + docker run --rm --network host \ + --mount type=bind,source="$(pwd)/..",target=/subxt/aleph-node \ + public.ecr.aws/p6e8q1z1/subxt-client-integration:latest run-e2e-finalization-test: needs: [build-test-docker, build-test-client] @@ -491,7 +498,7 @@ jobs: timeout-minutes: 15 run-e2e-permissionless-ban: - needs: [ build-test-docker, build-test-client ] + needs: [build-test-docker, build-test-client] name: Run permissionless ban test runs-on: ubuntu-20.04 steps: @@ -545,87 +552,6 @@ jobs: test-case: adder timeout-minutes: 10 -# The tests below were written under the assumption that nonfinalized blocks are being produced, they need a rewrite before being reenabled. -# TODO(A0-1644): Reenable these tests. -# run-e2e-failing-version-upgrade: -# needs: [build-test-docker, build-test-client] -# name: Run basic (failing) version-upgrade test -# runs-on: ubuntu-20.04 -# steps: -# - name: Checkout source code -# uses: actions/checkout@v2 -# -# - name: Run e2e test -# uses: ./.github/actions/run-e2e-test -# with: -# test-case: doomed_version_upgrade -# env: -# OVERRIDE_DOCKER_COMPOSE: ./.github/scripts/docker-compose.no_quorum_without_old.override.yml -# UPGRADE_VERSION: 1 -# UPGRADE_SESSION: 3 -# UPGRADE_FINALIZATION_WAIT_SESSIONS: 2 -# ONLY_LEGACY: true -# timeout-minutes: 10 -# run-e2e-version-upgrade-catchup: -# needs: [build-test-docker, build-cliain-image] -# name: Run series of tests where some of the nodes need to do version-upgrade during catch-up -# runs-on: ubuntu-20.04 -# strategy: -# matrix: -# include: -# - nodes: "Node1" -# ports: "9934" -# ext_status: "finalized" -# upgrade_before_disable: "true" -# -# - nodes: "Node1" -# ports: "9934" -# ext_status: "finalized" -# upgrade_before_disable: "false" -# -# - nodes: "Node1:Node2" -# ports: "9934:9935" -# ext_status: "in-block" -# upgrade_before_disable: "true" -# -# - nodes: "Node1:Node2" -# ports: "9934:9935" -# ext_status: "in-block" -# upgrade_before_disable: "false" -# steps: -# - name: Checkout source code -# uses: actions/checkout@v2 -# -# - name: Download artifact with docker image for aleph-node -# uses: actions/download-artifact@v2 -# with: -# name: aleph-test-docker -# -# - name: Load node docker image -# shell: bash -# run: docker load -i aleph-node.tar -# -# - name: Download artifact with docker image for cliain -# uses: actions/download-artifact@v2 -# with: -# name: cliain-docker -# -# - name: Load cliain docker image -# shell: bash -# run: docker load -i cliain.tar -# -# - name: Call catchup_test.sh -# timeout-minutes: 10 -# env: -# UPGRADE_BLOCK: 31 -# NODES: ${{ matrix.nodes }} -# PORTS: ${{ matrix.ports }} -# EXT_STATUS: ${{ matrix.ext_status }} -# UPGRADE_BEFORE_DISABLE: ${{ matrix.upgrade_before_disable }} -# DOCKER_COMPOSE: docker/docker-compose.bridged.yml -# run: | -# ./scripts/catchup_version_upgrade_test.sh - run-e2e-finality-version-change: needs: [build-test-docker, build-test-client] name: Run finality version change test @@ -674,8 +600,8 @@ jobs: name: Check e2e test suite completion runs-on: ubuntu-20.04 steps: - - name: All e2e tests completed - run: echo "All e2e tests completed." + - name: All e2e tests completed + run: echo "All e2e tests completed." push-image: @@ -729,7 +655,8 @@ jobs: CURRENT_IMAGE: aleph-node ECR_PUSH_IMAGE: public.ecr.aws/p6e8q1z1/aleph-node run: | - docker tag ${{ env.CURRENT_IMAGE }} ${{ env.ECR_PUSH_IMAGE }}:${{ steps.vars.outputs.sha_short }} + docker tag ${{ env.CURRENT_IMAGE }} \ + ${{ env.ECR_PUSH_IMAGE }}:${{ steps.vars.outputs.sha_short }} docker tag ${{ env.CURRENT_IMAGE }} ${{ env.ECR_PUSH_IMAGE }}:latest docker push ${{ env.ECR_PUSH_IMAGE }}:${{ steps.vars.outputs.sha_short }} docker push ${{ env.ECR_PUSH_IMAGE }}:latest @@ -813,7 +740,7 @@ jobs: build-new-runtime-and-try_runtime: name: Build new runtime and try_runtime tool - needs: [ check-runtime-change ] + needs: [check-runtime-change] # Disbled check, reenable once we fix the issue with try-runtime test # if: ${{ needs.check-runtime-change.outputs.runtime-updated != 0 }} if: ${{ false }} @@ -855,7 +782,7 @@ jobs: test-runtime-update: name: Test runtime update with try-runtime tool runs-on: self-hosted - needs: [ build-new-runtime-and-try_runtime ] + needs: [build-new-runtime-and-try_runtime] steps: - name: Checkout source code uses: actions/checkout@v3 diff --git a/.github/workflows/nightly-pipeline.yaml b/.github/workflows/nightly-pipeline.yaml index 5356c26b1c..b775743f38 100644 --- a/.github/workflows/nightly-pipeline.yaml +++ b/.github/workflows/nightly-pipeline.yaml @@ -1,8 +1,9 @@ +--- name: Nightly pipeline on: schedule: - - cron: '00 23 * * *' + - cron: '00 23 * * *' concurrency: group: "${{ github.ref }}-${{ github.workflow }}-nightly" @@ -125,7 +126,8 @@ jobs: run: | cd e2e-tests/ rm -f target/release/deps/aleph_e2e_client* - cp $(cargo test --no-run --release --message-format=json | jq -r .executable | grep aleph_e2e_client) target/release/aleph-e2e-client + cp $(cargo test --no-run --release --message-format=json | jq -r .executable \ + | grep aleph_e2e_client) target/release/aleph-e2e-client docker build --tag aleph-e2e-client:latest -f Dockerfile . docker save -o aleph-e2e-client.tar aleph-e2e-client:latest diff --git a/.github/workflows/push-foundation-repo.yml b/.github/workflows/push-foundation-repo.yml index 5632c8487e..05666b33cb 100644 --- a/.github/workflows/push-foundation-repo.yml +++ b/.github/workflows/push-foundation-repo.yml @@ -1,17 +1,21 @@ +--- name: Sync Cardinal-Cryptography repo with Aleph-Zero-Foundation repo on: push: branches: - main - - release-** + - 'release-*' tags: - - r-* + - 'r-*' jobs: sync-main: runs-on: ubuntu-20.04 - if: github.repository == 'Cardinal-Cryptography/aleph-node' && startsWith(github.ref, 'refs/heads/') && github.ref_name == 'main' + if: > + github.repository == 'Cardinal-Cryptography/aleph-node' && + startsWith(github.ref, 'refs/heads/') && + github.ref_name == 'main' steps: - name: Checkout uses: actions/checkout@v3 @@ -20,12 +24,16 @@ jobs: token: ${{ secrets.SYNCAZF }} - name: Push to Aleph-Zero-Foundation + # yamllint disable-line rule:line-length run: git push https://x-access-token:${{ secrets.SYNCAZF }}@github.com/aleph-zero-foundation/aleph-node.git sync-release-branch: runs-on: ubuntu-20.04 - if: github.repository == 'Cardinal-Cryptography/aleph-node' && startsWith(github.ref, 'refs/heads/') && startsWith(github.ref_name, 'release-') + if: > + github.repository == 'Cardinal-Cryptography/aleph-node' && + startsWith(github.ref, 'refs/heads/') && + startsWith(github.ref_name, 'release-') steps: - name: GIT | Checkout uses: actions/checkout@v3 @@ -43,8 +51,12 @@ jobs: echo sha_short=$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT - name: Push to Aleph-Zero-Foundation + # yamllint disable rule:line-length run: | - git push 'https://x-access-token:${{ secrets.SYNCAZF }}@github.com/aleph-zero-foundation/aleph-node.git' ${{ steps.get_branch.outputs.branch_name }}:${{ steps.get_branch.outputs.branch_name }} + git push \ + 'https://x-access-token:${{ secrets.SYNCAZF }}@github.com/aleph-zero-foundation/aleph-node.git' \ + ${{ steps.get_branch.outputs.branch_name }}:${{ steps.get_branch.outputs.branch_name }} + # yamllint disable rule:line-length sync-release-tag: diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index d84ae3b03d..1ed35403ed 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -1,14 +1,14 @@ +--- name: unit-tests on: pull_request: - branches: - - '**' - push: paths-ignore: - - '*.md' + - 'fork-off/**' + - 'flooder/**' + push: branches: - - main + - 'release-*' concurrency: group: ${{ github.ref }}-${{ github.workflow }} diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yaml-lint.yml index 69b31b74be..bb99ae0d8d 100644 --- a/.github/workflows/yaml-lint.yml +++ b/.github/workflows/yaml-lint.yml @@ -4,8 +4,8 @@ name: GH Action YAML linter on: pull_request: paths: - - ".github/**/**.yml" - - ".github/**/**.yaml" + - '.github/**.yml' + - '.github/**.yaml' concurrency: group: ${{ github.ref }}-${{ github.workflow }} @@ -22,18 +22,9 @@ jobs: repository: Cardinal-Cryptography/aleph-node token: ${{ secrets.CI_GH_TOKEN }} - - name: GIT | Check diff - id: check-diff - run: | - git fetch --quiet origin ${GITHUB_BASE_REF}:refs/remotes/origin/${GITHUB_BASE_REF} - YAML_FILES=`git --no-pager diff origin/${GITHUB_BASE_REF} --name-only \ - | grep -E ".github\/.*\/.*(.yaml|.yml)" | tr '\n' ' '` - echo "Changed YAML files: ${YAML_FILES}" - echo "YAML_FILES=`echo $YAML_FILES`" >> $GITHUB_ENV - - name: LINT | Execute yaml-lint uses: ibiqlik/action-yamllint@v3.1.1 with: strict: true - file_or_dir: ${{ env.YAML_FILES }} + file_or_dir: .github config_file: .yamllint