-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: update internal testnet reset workflow #2035
Merged
+27
−303
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,45 @@ | ||
name: Continuous Deployment (Internal Testnet) | ||
# run after every successful CI job of new commits to the master branch | ||
# if deploy version or config has changed | ||
|
||
## run after every successful CI job of new commits to the master branch, or on manual dispatch | ||
on: | ||
workflow_run: | ||
workflows: [Continuous Integration (Kava Master)] | ||
types: | ||
- completed | ||
workflow_dispatch: | ||
|
||
jobs: | ||
# when not manually dispatched, we only want merges to master that change the relevant files | ||
# to trigger the network reset | ||
changed_files: | ||
runs-on: ubuntu-latest | ||
# define output for first job forwarding output of changedInternalTestnetConfig job | ||
outputs: | ||
changedInternalTestnetConfig: ${{ steps.changed-internal-testnet-config.outputs.any_changed }} | ||
changedInternalTestnetConfig: ${{ steps.changed-internal-testnet-config.outputs.any_changed }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. | ||
- name: Get all changed internal testnet files | ||
id: changed-internal-testnet-config | ||
uses: tj-actions/changed-files@v42 | ||
with: | ||
# Avoid using single or double quotes for multiline patterns | ||
files: | | ||
ci/env/kava-internal-testnet/** | ||
|
||
# in order: | ||
# enter standby (prevents autoscaling group from killing node during deploy) | ||
# stop kava | ||
# take ebs + zfs snapshots | ||
# download updated binary and genesis | ||
# reset application database state (only done on internal testnet) | ||
reset-chain-to-zero-state: | ||
needs: [changed_files] | ||
# only start cd pipeline if last ci run was successful | ||
if: ${{ github.event.workflow_run.conclusion == 'success' && needs.changed_files.outputs.changedInternalTestnetConfig == 'true' }} | ||
uses: ./.github/workflows/cd-reset-internal-testnet.yml | ||
with: | ||
aws-region: us-east-1 | ||
chain-id: kava_2221-17000 | ||
ssm-document-name: kava-testnet-internal-node-update | ||
playbook-name: reset-internal-testnet-playbook.yml | ||
playbook-infrastructure-branch: master | ||
secrets: inherit | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. | ||
- name: Get all changed internal testnet files | ||
id: changed-internal-testnet-config | ||
uses: tj-actions/changed-files@v42 | ||
with: | ||
# Avoid using single or double quotes for multiline patterns | ||
files: | | ||
ci/env/kava-internal-testnet/** | ||
|
||
# start kava with new binary and genesis state on api, peer and seed nodes, place nodes in service once they start and are synched to live | ||
start-chain-api: | ||
uses: ./.github/workflows/cd-start-chain.yml | ||
reset-and-restart-chain: | ||
# only start cd pipeline if last ci run was successful (or it this is being manually dispatched) | ||
if: | | ||
github.event_name == 'workflow_dispatch' || | ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && needs.changed_files.outputs.changedInternalTestnetConfig == 'true') | ||
Comment on lines
+32
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is the logic for whether or not to actually reset the network. it amounts to:
|
||
uses: ./.github/workflows/cd-reset-network.yml | ||
with: | ||
aws-region: us-east-1 | ||
chain-id: kava_2221-17000 | ||
ssm-document-name: kava-testnet-internal-node-update | ||
playbook-name: start-chain-api-playbook.yml | ||
ssm-document-name: kava-internal-testnet-instance-update | ||
playbook-infrastructure-branch: master | ||
secrets: inherit | ||
needs: [reset-chain-to-zero-state] | ||
needs: [changed_files] | ||
|
||
# setup test and development accounts and balances, deploy contracts by calling the chain's api | ||
seed-chain-state: | ||
|
@@ -65,9 +50,10 @@ jobs: | |
seed-script-filename: seed-internal-testnet.sh | ||
erc20-deployer-network-name: internal_testnet | ||
genesis_validator_addresses: "kavavaloper1xcgtffvv2yeqmgs3yz4gv29kgjrj8usxrnrlwp kavavaloper1w66m9hdzwgd6uc8g93zqkcumgwzrpcw958sh3s" | ||
kava_version_filepath: ./ci/env/kava-internal-testnet/KAVA.VERSION | ||
kava_version_filepath: ./ci/env/kava-internal-testnet/KAVA.VERSION | ||
secrets: inherit | ||
needs: [start-chain-api] | ||
needs: [reset-and-restart-chain] | ||
|
||
post-pipeline-metrics: | ||
uses: ./.github/workflows/metric-pipeline.yml | ||
if: always() # always run so we metric failures and successes | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great to see re-use of the workflow jobs instead of duplicating them