2022-12-08 17:30:12 +00:00
|
|
|
name: Start Chain
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
chain-id:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
aws-region:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
ssm-document-name:
|
2023-04-05 23:43:27 +00:00
|
|
|
required: true
|
|
|
|
type: string
|
2022-12-08 17:30:12 +00:00
|
|
|
playbook-name:
|
2023-04-05 23:43:27 +00:00
|
|
|
required: true
|
|
|
|
type: string
|
2022-12-08 17:30:12 +00:00
|
|
|
playbook-infrastructure-branch:
|
2023-04-05 23:43:27 +00:00
|
|
|
required: true
|
|
|
|
type: string
|
2022-12-08 17:30:12 +00:00
|
|
|
secrets:
|
|
|
|
CI_AWS_KEY_ID:
|
|
|
|
required: true
|
|
|
|
CI_AWS_KEY_SECRET:
|
|
|
|
required: true
|
|
|
|
KAVA_PRIVATE_GITHUB_ACCESS_TOKEN:
|
|
|
|
required: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
# start kava, allow nodes to start processing requests from users once they are synced to live
|
|
|
|
serve-traffic:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout repo from current commit
|
2023-11-08 22:06:03 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-12-08 17:30:12 +00:00
|
|
|
- name: take the chain offline
|
2023-04-05 23:43:27 +00:00
|
|
|
run: bash ${GITHUB_WORKSPACE}/.github/scripts/put-all-chain-nodes-on-standby.sh
|
2022-12-08 17:30:12 +00:00
|
|
|
env:
|
|
|
|
CHAIN_ID: ${{ inputs.chain-id }}
|
|
|
|
AWS_REGION: ${{ inputs.aws-region }}
|
|
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_KEY_ID }}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_KEY_SECRET }}
|
|
|
|
- name: checkout infrastructure repo
|
2023-11-08 22:06:03 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-12-08 17:30:12 +00:00
|
|
|
with:
|
|
|
|
repository: Kava-Labs/infrastructure
|
|
|
|
token: ${{ secrets.KAVA_PRIVATE_GITHUB_ACCESS_TOKEN }}
|
|
|
|
path: infrastructure
|
2022-12-08 18:35:20 +00:00
|
|
|
ref: master
|
2023-11-08 22:06:03 +00:00
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v4
|
2022-12-08 17:30:12 +00:00
|
|
|
with:
|
2023-11-08 22:06:03 +00:00
|
|
|
go-version-file: go.mod
|
2022-12-08 17:30:12 +00:00
|
|
|
- name: build kava node updater
|
2023-04-05 23:43:27 +00:00
|
|
|
run: cd infrastructure/cli/kava-node-updater && make install && cd ../../../
|
2022-12-08 17:30:12 +00:00
|
|
|
- name: run start-chain playbook on all chain nodes
|
|
|
|
run: |
|
|
|
|
kava-node-updater \
|
|
|
|
--debug \
|
|
|
|
--max-retries=2 \
|
|
|
|
--aws-ssm-document-name=$SSM_DOCUMENT_NAME \
|
|
|
|
--infrastructure-git-pointer=$PLAYBOOK_INFRASTRUCTURE_BRANCH \
|
|
|
|
--update-playbook-filename=$PLAYBOOK_NAME \
|
|
|
|
--chain-id=$CHAIN_ID \
|
|
|
|
--max-upgrade-batch-size=0 \
|
|
|
|
--node-states=Standby \
|
|
|
|
--wait-for-node-sync-after-upgrade=true
|
|
|
|
env:
|
|
|
|
SSM_DOCUMENT_NAME: ${{ inputs.ssm-document-name }}
|
|
|
|
PLAYBOOK_NAME: ${{ inputs.playbook-name }}
|
|
|
|
CHAIN_ID: ${{ inputs.chain-id }}
|
|
|
|
AWS_REGION: ${{ inputs.aws-region }}
|
|
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_KEY_ID }}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_KEY_SECRET }}
|
|
|
|
AWS_SDK_LOAD_CONFIG: 1
|
|
|
|
PLAYBOOK_INFRASTRUCTURE_BRANCH: ${{ inputs.playbook-infrastructure-branch }}
|
|
|
|
- name: bring the chain online
|
2023-04-05 23:43:27 +00:00
|
|
|
run: bash ${GITHUB_WORKSPACE}/.github/scripts/exit-standby-all-chain-nodes.sh
|