Skip to content

Nightly update net tests #35

Nightly update net tests

Nightly update net tests #35

---
# 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 }}