diff --git a/.github/workflows/featurenet-create.yml b/.github/workflows/featurenet-create.yml index 2d7a18ac..445a6106 100644 --- a/.github/workflows/featurenet-create.yml +++ b/.github/workflows/featurenet-create.yml @@ -41,7 +41,41 @@ on: sudo-account-id: description: 'Sudo account ID' type: string + required: false + default: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY' + workflow_call: + inputs: + featurenet-name: + description: 'Name of the featurenet' + type: string + required: true + ref: + description: "git ref: full commit hash, branch, tag - or 'mainnet' or 'testnet'" + type: string + required: true + expiration: + description: 'Time after which featurenet will be removed' required: true + type: string + default: '48h' + validators: + description: 'Number of validators to start, from 0 to 50' + required: true + default: '5' + type: string + internal: + description: 'Internal network, accessible from VPN only' + required: true + type: boolean + default: false + short-session: + description: 'Use short session aleph-node binary' + required: true + type: boolean + sudo-account-id: + description: 'Sudo account ID' + type: string + required: false default: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY' jobs: @@ -100,7 +134,7 @@ jobs: needs: [get-full-docker-image-path, build-and-push-featurenet-node-image] # to prevent this job to be skipped when on of the parent jobs is skipped if: ${{ !cancelled() }} - name: Create featurenet from branch + name: Create featurenet uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-create.yml@v6 secrets: inherit with: diff --git a/.github/workflows/featurenet-delete.yml b/.github/workflows/featurenet-delete.yml index 943a969a..1b44bc76 100644 --- a/.github/workflows/featurenet-delete.yml +++ b/.github/workflows/featurenet-delete.yml @@ -24,7 +24,6 @@ jobs: delete-featurenet: needs: [check-vars-and-secrets] name: Delete featurenet - # yamllint disable-line rule:line-length uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-delete.yml@v5 secrets: inherit with: diff --git a/.github/workflows/featurenet-update.yml b/.github/workflows/featurenet-update.yml index 1946a81e..8cf07e62 100644 --- a/.github/workflows/featurenet-update.yml +++ b/.github/workflows/featurenet-update.yml @@ -24,6 +24,28 @@ on: description: 'Use short session aleph-node binary' required: true type: boolean + workflow_call: + inputs: + featurenet-name: + description: 'Name of featurenet' + required: true + type: string + ref: + description: 'git ref: full commit hash, branch, tag' + required: true + type: string + rolling-update-partition: + description: | + A number from 0 to N-1, where N is a number of validators. + All aleph-node-validator-N with an ordinal N that is great than or equal to the partition + will be updated. If not specified, all nodes will be updated. + required: true + default: "0" + type: string + short-session: + description: 'Use short session aleph-node binary' + required: true + type: boolean jobs: validate-inputs: diff --git a/.github/workflows/nightly-update-net-tests.yml b/.github/workflows/nightly-update-net-tests.yml deleted file mode 100644 index e0c44343..00000000 --- a/.github/workflows/nightly-update-net-tests.yml +++ /dev/null @@ -1,190 +0,0 @@ ---- -# This workflow performs two updates: from Testnet to the latest main and -# from Mainnet to the latest main -name: Nightly update net tests -on: - workflow_dispatch: - schedule: - - cron: '00 02 * * *' - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: false - -jobs: - check-vars-and-secrets: - name: Check vars and secrets - uses: ./.github/workflows/_check-vars-and-secrets.yml - secrets: inherit - - get-net-names: - needs: [check-vars-and-secrets] - name: Get aleph-node main SHA - outputs: - updatenet-testnet-name: ${{ steps.get-featurenet-name.outputs.updatenet-testnet-name }} - updatenet-mainnet-name: ${{ steps.get-featurenet-name.outputs.updatenet-mainnet-name }} - aleph-node-main-hash: ${{ steps.get-update-hashes.outputs.update-hash }} - runs-on: ubuntu-20.04 - steps: - - name: Get featurenet name - id: get-featurenet-name - run: | - echo "updatenet-testnet-name=ops-updatenet-testnet" >> $GITHUB_OUTPUT - echo "updatenet-mainnet-name=ops-updatenet-mainnet" >> $GITHUB_OUTPUT - - get-full-docker-image-path-testnet: - name: Get full aleph-node full docker path path for testnet - 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 }} - steps: - - name: Get aleph-node fqdn path - id: get-aleph-node-fqdn-image - uses: Cardinal-Cryptography/github-actions/get-aleph-node-fqdn-image@v6 - with: - ref: 'testnet' - test-binary: 'false' - ecr-dev-node-repo: ${{ vars.ECR_DEV_ALEPH_NODE_REPO }} - ecr-prod-node-repo: ${{ vars.ECR_ALEPH_NODE_REPO }} - - get-full-docker-image-path-mainnet: - name: Get full aleph-node full docker path path for mainnet - 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 }} - steps: - - name: Get aleph-node fqdn path - id: get-aleph-node-fqdn-image - uses: Cardinal-Cryptography/github-actions/get-aleph-node-fqdn-image@v6 - with: - ref: 'mainnet' - test-binary: 'false' - ecr-dev-node-repo: ${{ vars.ECR_DEV_ALEPH_NODE_REPO }} - ecr-prod-node-repo: ${{ vars.ECR_ALEPH_NODE_REPO }} - - get-full-docker-image-path-main-branch: - name: Get full aleph-node full docker path path for mainnet - 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 }} - steps: - - name: Get aleph-node fqdn path - id: get-aleph-node-fqdn-image - uses: Cardinal-Cryptography/github-actions/get-aleph-node-fqdn-image@v6 - with: - ref: 'main' - test-binary: 'false' - ecr-dev-node-repo: ${{ vars.ECR_DEV_ALEPH_NODE_REPO }} - ecr-prod-node-repo: ${{ vars.ECR_ALEPH_NODE_REPO }} - - create-featurenet-from-testnet: - needs: - - get-net-names - - get-full-docker-image-path-testnet - name: Create featurenet from testnet - uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-create.yml@v6 - secrets: inherit - with: - featurenet-name: ${{ needs.get-net-names.outputs.updatenet-testnet-name }} - aleph-node-image: ${{ needs.get-full-docker-image-path-testnet.outputs.fqdn-image }} - expiration: '4h' - validators: '7' - internal: true - delete-first: true - - create-featurenet-from-mainnet: - needs: - - get-net-names - - create-featurenet-from-testnet - - get-full-docker-image-path-mainnet - name: Create featurenet from mainnet - uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-create.yml@v6 - secrets: inherit - with: - featurenet-name: ${{ needs.get-net-names.outputs.updatenet-mainnet-name }} - aleph-node-image: ${{ needs.get-full-docker-image-path-mainnet.outputs.fqdn-image }} - expiration: '4h' - validators: '7' - internal: true - delete-first: true - - update-featurenet-from-testnet: - needs: - - get-net-names - - create-featurenet-from-mainnet - - get-full-docker-image-path-main-branch - name: Update featurenet from testnet to main image - uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-create.yml@v6 - secrets: inherit - with: - featurenet-name: ${{ needs.get-net-names.outputs.updatenet-testnet-name }} - aleph-node-image: ${{ needs.get-full-docker-image-path-main-branch.outputs.fqdn-image }} - expiration: '4h' - rolling-update-partition: '0' - validators: '7' - internal: true - - update-featurenet-from-mainnet: - needs: - - get-net-names - - update-featurenet-from-testnet - - get-full-docker-image-path-main-branch - name: Update featurenet from mainnet to main branch - uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-create.yml@v6 - secrets: inherit - with: - featurenet-name: ${{ needs.get-net-names.outputs.updatenet-mainnet-name }} - aleph-node-image: ${{ needs.get-full-docker-image-path-main-branch.outputs.fqdn-image }} - expiration: '4h' - rolling-update-partition: '0' - validators: '7' - internal: true - - delete-featurenet-from-testnet: - if: ${{ always() }} - needs: - - get-net-names - - update-featurenet-from-mainnet - name: Delete featurenet from testnet - uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-delete.yml@v5 - secrets: inherit - with: - featurenet-name: ${{ needs.get-net-names.outputs.updatenet-testnet-name }} - - delete-featurenet-from-mainnet: - if: ${{ always() }} - needs: - - get-net-names - - delete-featurenet-from-testnet - name: Delete featurenet from mainnet - uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-delete.yml@v5 - secrets: inherit - with: - featurenet-name: ${{ needs.get-net-names.outputs.updatenet-mainnet-name }} - - slack-notification: - name: Slack notification - runs-on: ubuntu-20.04 - needs: [delete-featurenet-from-testnet, delete-featurenet-from-mainnet] - if: > - !cancelled() && - github.event_name != 'workflow_dispatch' - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Send Slack message - uses: ./.github/actions/slack-notification - with: - notify-on: "failure" - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DEV_ONDUTY }} diff --git a/.github/workflows/nightly-update-test-mainnet-testnet.yml b/.github/workflows/nightly-update-test-mainnet-testnet.yml new file mode 100644 index 00000000..d3b5c157 --- /dev/null +++ b/.github/workflows/nightly-update-test-mainnet-testnet.yml @@ -0,0 +1,73 @@ +--- +# This workflow performs from Mainnet to Testnet update. +# Test means that net starts from plain (empty) aleph-node chain, bootstraped using starting +# node image, and then performs rolling restart to target node image +# What this test validates are changes in finalization area to aleph-node binary + +name: Nightly update net test from Mainnet to Testnet +on: + workflow_dispatch: + # Daily at 02:00 + schedule: + - cron: '00 02 * * *' + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: false + +jobs: + check-vars-and-secrets: + name: Check vars and secrets + uses: ./.github/workflows/_check-vars-and-secrets.yml + secrets: inherit + + create-featurenet-from-mainnet: + needs: [check-vars-and-secrets] + name: Create featurenet from mainnet + uses: ./.github/workflows/featurenet-create.yml + secrets: inherit + with: + featurenet-name: 'ops-updatenet-mainnet' + ref: 'mainnet' + expiration: '4h' + validators: '7' + internal: true + short-session: false + + update-featurenet-to-testnet: + needs: [create-featurenet-from-mainnet] + name: Update featurenet to Testnet + uses: ./.github/workflows/featurenet-update.yml + secrets: inherit + with: + featurenet-name: 'ops-updatenet-mainnet' + ref: 'testnet' + rolling-update-partition: '0' + short-session: false + + delete-featurenet: + if: ${{ always() }} + needs: [update-featurenet-to-testnet] + name: Delete featurenet + uses: ./.github/workflows/featurenet-delete.yml + secrets: inherit + with: + featurenet-name: 'ops-updatenet-mainnet' + + slack-notification: + name: Slack notification + runs-on: ubuntu-20.04 + needs: [delete-featurenet] + if: > + !cancelled() && + github.event_name != 'workflow_dispatch' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Send Slack message + uses: ./.github/actions/slack-notification + with: + notify-on: "failure" + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DEV_ONDUTY }} diff --git a/.github/workflows/nightly-update-test-testnet-main.yml b/.github/workflows/nightly-update-test-testnet-main.yml new file mode 100644 index 00000000..54542c50 --- /dev/null +++ b/.github/workflows/nightly-update-test-testnet-main.yml @@ -0,0 +1,73 @@ +--- +# This workflow performs from Testnet to the latest main update. +# Test means that net starts from plain (empty) aleph-node chain, bootstraped using starting +# node image, and then performs rolling restart to target node image +# What this test validates are changes in finalization area to aleph-node binary + +name: Nightly update net test from Testnet to main +on: + workflow_dispatch: + # Daily at 02:20 + schedule: + - cron: '20 02 * * *' + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: false + +jobs: + check-vars-and-secrets: + name: Check vars and secrets + uses: ./.github/workflows/_check-vars-and-secrets.yml + secrets: inherit + + create-featurenet-from-testnet: + needs: [check-vars-and-secrets] + name: Create featurenet from testnet + uses: ./.github/workflows/featurenet-create.yml + secrets: inherit + with: + featurenet-name: 'ops-updatenet-testnet' + ref: 'testnet' + expiration: '4h' + validators: '8' + internal: true + short-session: false + + update-featurenet-to-main: + needs: [create-featurenet-from-testnet] + name: Update featurenet to main + uses: ./.github/workflows/featurenet-update.yml + secrets: inherit + with: + featurenet-name: 'ops-updatenet-testnet' + ref: 'main' + rolling-update-partition: '0' + short-session: false + + delete-featurenet: + if: ${{ always() }} + needs: [update-featurenet-to-main] + name: Delete featurenet + uses: ./.github/workflows/featurenet-delete.yml + secrets: inherit + with: + featurenet-name: 'ops-updatenet-testnet' + + slack-notification: + name: Slack notification + runs-on: ubuntu-20.04 + needs: [delete-featurenet] + if: > + !cancelled() && + github.event_name != 'workflow_dispatch' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Send Slack message + uses: ./.github/actions/slack-notification + with: + notify-on: "failure" + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DEV_ONDUTY }} diff --git a/.github/workflows/weekly-featurenets-short-session-branch.yml b/.github/workflows/weekly-featurenets-short-session-branch.yml new file mode 100644 index 00000000..50627281 --- /dev/null +++ b/.github/workflows/weekly-featurenets-short-session-branch.yml @@ -0,0 +1,58 @@ +--- +name: Weekly test featurenets create (short session, branch) + +on: + # At 03:00 on Wednesday + schedule: + - cron: '0 3 * * 3' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + check-vars-and-secrets: + name: Check vars and secrets + uses: ./.github/workflows/_check-vars-and-secrets.yml + secrets: inherit + + create-featurenet-via-branch: + needs: [check-vars-and-secrets] + name: Create featurenet from main branch + uses: ./.github/workflows/featurenet-create.yml + secrets: inherit + with: + featurenet-name: 'ops-test-main-branch' + ref: 'main' + expiration: '4h' + validators: '7' + internal: true + short-session: true + + delete-featurenet: + if: ${{ always() }} + needs: [create-featurenet-via-branch] + name: Delete featurenet + uses: ./.github/workflows/featurenet-delete.yml + secrets: inherit + with: + featurenet-name: 'ops-test-main-branch' + + slack: + name: Slack notification + runs-on: ubuntu-20.04 + needs: [delete-featurenet] + if: > + !cancelled() && + github.event_name != 'workflow_dispatch' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Send Slack message + uses: ./.github/actions/slack-notification + with: + notify-on: "failure" + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DEV_ONDUTY }} diff --git a/.github/workflows/weekly-featurenets-short-session-full-sha.yml b/.github/workflows/weekly-featurenets-short-session-full-sha.yml new file mode 100644 index 00000000..26078aac --- /dev/null +++ b/.github/workflows/weekly-featurenets-short-session-full-sha.yml @@ -0,0 +1,58 @@ +--- +name: Weekly test featurenets create (short session, full sha) + +on: + # At 03:20 on Wednesday + schedule: + - cron: '20 3 * * 3' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + check-vars-and-secrets: + name: Check vars and secrets + uses: ./.github/workflows/_check-vars-and-secrets.yml + secrets: inherit + + create-featurenet-from-full-sha: + needs: [check-vars-and-secrets] + name: Create featurenet from full SHA + uses: ./.github/workflows/featurenet-create.yml + secrets: inherit + with: + featurenet-name: 'ops-test-full-hash' + ref: '787c39186884aaf86ed48f46f575a8cd8cfd13e8' + expiration: '2h' + validators: '5' + internal: true + short-session: true + + delete-featurenet: + if: ${{ always() }} + needs: [create-featurenet-from-full-sha] + name: Delete featurenet + uses: ./.github/workflows/featurenet-delete.yml + secrets: inherit + with: + featurenet-name: 'ops-test-full-hash' + + slack: + name: Slack notification + runs-on: ubuntu-20.04 + needs: [delete-featurenet] + if: > + !cancelled() && + github.event_name != 'workflow_dispatch' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Send Slack message + uses: ./.github/actions/slack-notification + with: + notify-on: "failure" + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DEV_ONDUTY }} diff --git a/.github/workflows/weekly-featurenets-short-session-tag.yml b/.github/workflows/weekly-featurenets-short-session-tag.yml new file mode 100644 index 00000000..0716fbfe --- /dev/null +++ b/.github/workflows/weekly-featurenets-short-session-tag.yml @@ -0,0 +1,58 @@ +--- +name: Weekly test featurenets create (short session, tag) + +on: + # At 03:40 on Wednesday + schedule: + - cron: '40 3 * * 3' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + check-vars-and-secrets: + name: Check vars and secrets + uses: ./.github/workflows/_check-vars-and-secrets.yml + secrets: inherit + + create-featurenet-from-tag: + needs: [check-vars-and-secrets] + name: Create featurenet from tag + uses: ./.github/workflows/featurenet-create.yml + secrets: inherit + with: + featurenet-name: 'ops-test-tag' + ref: 'r-12.2' + expiration: '5h' + validators: '8' + internal: true + short-session: true + + delete-featurenet: + if: ${{ always() }} + needs: [create-featurenet-from-tag] + name: Delete featurenet + uses: ./.github/workflows/featurenet-delete.yml + secrets: inherit + with: + featurenet-name: 'ops-test-tag' + + slack: + name: Slack notification + runs-on: ubuntu-20.04 + needs: [delete-featurenet] + if: > + !cancelled() && + github.event_name != 'workflow_dispatch' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Send Slack message + uses: ./.github/actions/slack-notification + with: + notify-on: "failure" + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DEV_ONDUTY }}