Skip to content

Commit

Permalink
Change bridgenet workflows to work with new featurenets (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikolaj Gasior authored Dec 6, 2023
1 parent 06467c5 commit b200ae4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 43 deletions.
41 changes: 7 additions & 34 deletions .github/workflows/bridgenet-recreate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,17 @@ on:
workflow_dispatch:
inputs:
start:
description: 'aleph-node image to be started'
description: 'mainnet or testnet'
required: true
type: choice
options:
- testnet
- mainnet
default: testnet
destination:
description: Node image tag, ie 7-byte SHA of some existing ECR aleph-node image tag
required: true
type: string
workflow_call:
inputs:
start:
description: 'aleph-node image to be started'
required: true
type: string
destination:
description: Node image tag, ie 7-byte SHA of some existing ECR aleph-node image tag
description: 'mainnet or testnet'
required: true
type: string

Expand All @@ -45,19 +37,12 @@ jobs:
echo "!!! Invalid start network"
exit 1
fi
if [[
"${{ inputs.destination }}" != "" && \
! "${{ inputs.destination }}" =~ ^[a-f0-9]{7}$
]]; then
echo "!!! Expected a 7-byte SHA in destination parameter"
exit 1
fi
delete-bridgenet:
needs: [check-inputs]
name: Delete existing bridgenet
# yamllint disable-line rule:line-length
uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-delete.yml@v3
uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-delete.yml@v5
secrets: inherit
with:
featurenet-name: updnet-bridgenet
Expand All @@ -77,24 +62,12 @@ jobs:
needs: [wait-for-deletion]
name: Create new bridgenet
# yamllint disable-line rule:line-length
uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-create-from-net.yml@v3
uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-create.yml@v5
secrets: inherit
with:
featurenet-name: updnet-bridgenet
start: 'mainnet'
featurenet-name: bridgenet
aleph-node-image: 'testnet'
expiration: 'never'
replicas: '5'
internal: true

update-bridgenet:
needs: [create-bridgenet]
name: Update new bridgenet
# yamllint disable-line rule:line-length
uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-update.yml@v3
secrets: inherit
with:
featurenet-name: updnet-bridgenet
destination: ${{ inputs.destination }}
rolling-update-partition: '0'
replicas: '5'
internal: true
delete-first: false
16 changes: 7 additions & 9 deletions .github/workflows/bridgenet-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ name: Bridgenet - Update
on:
workflow_dispatch:
inputs:
destination:
aleph-node-image:
description: Node image tag, ie 7-byte SHA of some existing ECR aleph-node image tag
required: true
type: string
workflow_call:
inputs:
destination:
aleph-node-image:
description: Node image tag, ie 7-byte SHA of some existing ECR aleph-node image tag
required: true
type: string
Expand All @@ -28,23 +28,21 @@ jobs:
- name: Validate inputs
shell: bash
run: |
if [[
"${{ inputs.destination }}" != "" && \
! "${{ inputs.destination }}" =~ ^[a-f0-9]{7}$
]]; then
echo "!!! Expected a 7-byte SHA in destination parameter"
if [[ ! '${{ inputs.aleph-node-image }}' =~ ^[a-z0-9][a-z0-9\._\-]{1,48}$ ]]; then
echo "!!! Invalid aleph-node image"
exit 1
fi
update-bridgenet:
needs: [check-inputs]
name: Update new bridgenet
# yamllint disable-line rule:line-length
uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-update.yml@v3
uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-create.yml@v5
secrets: inherit
with:
featurenet-name: updnet-bridgenet
destination: ${{ inputs.destination }}
aleph-node-image: ${{ inputs.aleph-node-image }}
rolling-update-partition: '0'
expiration: 'never'
replicas: '5'
internal: true

0 comments on commit b200ae4

Please sign in to comment.