From 2c210a19f9ff9d3cab8832bc4f625d3c0c3fdd01 Mon Sep 17 00:00:00 2001 From: Marcin Date: Tue, 21 May 2024 13:45:48 +0000 Subject: [PATCH] A0-4278: Support for finality version in FE engine (#52) * A0-4278: Support for finality version in FE create * Testing * Typo * Another typo * Revert "Testing" This reverts commit 4e33c4e69bcc39f9f71aadc6efc13028909fe2c9. * Testing * Removed trailing whitespaces in bash script * Changed finality-version type to string * Revert testing --- .github/workflows/_featurenet-create.yml | 5 +++++ create-featurenet/action.yml | 13 ++++++++++--- get-aleph-node-fqdn-image/action.yml | 5 +++-- update-featurenet/action.yml | 10 +++++----- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/_featurenet-create.yml b/.github/workflows/_featurenet-create.yml index 6e471c1..e530d34 100644 --- a/.github/workflows/_featurenet-create.yml +++ b/.github/workflows/_featurenet-create.yml @@ -49,6 +49,10 @@ on: type: string required: false default: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY' + finality-version: + description: 'Finality version to start FE with. Must be a cardinal number' + type: string + required: false outputs: ws-hostname: description: Hostname of the WS endpoint @@ -142,6 +146,7 @@ jobs: git-commit-email: ${{ secrets.AUTOCOMMIT_EMAIL }} wait-for-finalized-heads: "true" sudo-account-id: ${{ inputs.sudo-account-id }} + finality-version: ${{ inputs.finality-version }} - name: Finish featurenet Deployment uses: bobheadxi/deployments@v1 diff --git a/create-featurenet/action.yml b/create-featurenet/action.yml index b294f7e..7b02b4e 100644 --- a/create-featurenet/action.yml +++ b/create-featurenet/action.yml @@ -63,6 +63,9 @@ inputs: description: 'Sudo account ID' required: false default: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY' + finality-version: + description: 'Finality version to start FE with. Must be a cardinal number' + required: false outputs: ws-hostname: description: Hostname of the WS endpoint @@ -124,6 +127,10 @@ runs: echo "!!! Invalid sudo-account-id" exit 1 fi + if [[ ! '${{ inputs.finality-version }}' =~ ^[0-9]+$ ]]; then + echo "!!! finality-version must be a cardinal number" + exit 1 + fi - name: Checkout featurenet template repo uses: actions/checkout@v4 @@ -152,10 +159,10 @@ runs: '${{ inputs.rolling-update-partition }}' \ '${{ inputs.expiration }}' \ '${{ inputs.sudo-account-id }}' \ - 'not-used' \ '${{ inputs.featurenet-chain-bootstrapper-image }}' \ - ${{ inputs.internal == 'true' && '-i' || '' }} \ - -c -g | tee -a tmp-opssh-createfeaturenet-output.txt + '${{ inputs.finality-version }}' \ + ${{ inputs.internal == 'true' && '-i' || '' }} \ + -c -g | tee -a tmp-opssh-createfeaturenet-output.txt ws_hostname=$(cat tmp-opssh-createfeaturenet-output.txt | grep '^__output:ws-hostname:' | cut -d: -f3) echo "ws-hostname=${ws_hostname}" >> $GITHUB_OUTPUT diff --git a/get-aleph-node-fqdn-image/action.yml b/get-aleph-node-fqdn-image/action.yml index 84860a6..e135c5d 100644 --- a/get-aleph-node-fqdn-image/action.yml +++ b/get-aleph-node-fqdn-image/action.yml @@ -222,8 +222,9 @@ runs: if [[ '${{ steps.check-fqdn-prod-node-image-in-dev-repo.outputs.image-exists }}' != '' ]]; then image_exists='${{ steps.check-fqdn-prod-node-image-in-dev-repo.outputs.image-exists }}' fi - chain_bootstrapper_fqdn_image='not-required' - chain_bootstrapper_fqdn_image_latest='not-required' + chain_bootstrapper_fqdn_image='does-not-exist-yet' + chain_bootstrapper_fqdn_image_latest='does-not-exist-yet' + # fallback is to not build boostrapper image when it was not part of the aleph-node repo yet chain_bootstrapper_image_exists='true' if [[ '${{ steps.check-chain-bootstrapper-crate-existence.outputs.exists }}' == 'true' ]]; then chain_bootstrapper_image_exists='${{ steps.check-chain-bootstrapper-image-exists.outputs.image-exists }}' diff --git a/update-featurenet/action.yml b/update-featurenet/action.yml index e931117..3a2de68 100644 --- a/update-featurenet/action.yml +++ b/update-featurenet/action.yml @@ -99,12 +99,12 @@ runs: ./upsert-featurenet.sh \ '${{ inputs.featurenet-name }}' \ '${{ inputs.featurenet-aleph-node-image }}' \ - 'not-used-because-update' \ + 'replicas-not-used-because-update' \ '${{ inputs.rolling-update-partition }}' \ - 'not-used-because-update' \ - 'not-used-because-update' \ - 'not-used-because-update' \ - 'not-used-because-update' \ + 'expiration-not-used-because-update' \ + 'sudo-not-used-because-update' \ + 'chain-bootstrapper-not-used-because-update' \ + 'finality-version-not-used-because-update' \ -u \ -c -g | tee -a tmp-opssh-updatefeaturenet-output.txt