-
Notifications
You must be signed in to change notification settings - Fork 334
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 protonet reset workflow for new infra #2033
Merged
Merged
Changes from 1 commit
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 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
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 |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# for use with ephemeral testnets like internal testnet | ||
|
||
name: Reset Ephemeral Network | ||
on: | ||
workflow_call: | ||
inputs: | ||
chain-id: | ||
required: true | ||
type: string | ||
aws-region: | ||
required: true | ||
type: string | ||
ssm-document-name: | ||
required: true | ||
type: string | ||
playbook-infrastructure-branch: | ||
required: true | ||
type: string | ||
secrets: | ||
CI_AWS_KEY_ID: | ||
required: true | ||
CI_AWS_KEY_SECRET: | ||
required: true | ||
KAVA_PRIVATE_GITHUB_ACCESS_TOKEN: | ||
required: true | ||
jobs: | ||
reset-ephemeral-network: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout infrastructure repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: Kava-Labs/infrastructure | ||
token: ${{ secrets.KAVA_PRIVATE_GITHUB_ACCESS_TOKEN }} | ||
path: infrastructure | ||
ref: master | ||
|
||
- name: Set up Go with kava-node-updater cache | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: infrastructure/cli/kava-node-updater/go.mod | ||
cache-dependency-path: infrastructure/cli/kava-node-updater/go.mod | ||
|
||
- name: build kava node updater | ||
run: cd infrastructure/cli/kava-node-updater && make install && cd ../../../ | ||
|
||
- name: stop chain services & reset data on all chain nodes | ||
run: | | ||
echo $AWS_REGION $CHAIN_ID $SSM_DOCUMENT_NAME $AWS_SDK_LOAD_CONFIG $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY | ||
env: | ||
SSM_DOCUMENT_NAME: ${{ inputs.ssm-document-name }} | ||
CHAIN_ID: ${{ inputs.chain-id }} | ||
AWS_SDK_LOAD_CONFIG: 1 | ||
AWS_REGION: ${{ inputs.aws-region }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_KEY_SECRET }} | ||
PLAYBOOK_INFRASTRUCTURE_BRANCH: ${{ inputs.playbook-infrastructure-branch }} | ||
|
||
- name: stop chain services & reset data 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 \ | ||
--chain-id=$CHAIN_ID \ | ||
--max-upgrade-batch-size=0 \ | ||
--wait-for-node-sync-after-upgrade=false \ | ||
--update-playbook-filename=reset-chain-data.yml | ||
env: | ||
SSM_DOCUMENT_NAME: ${{ inputs.ssm-document-name }} | ||
CHAIN_ID: ${{ inputs.chain-id }} | ||
AWS_SDK_LOAD_CONFIG: 1 | ||
AWS_REGION: ${{ inputs.aws-region }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_KEY_SECRET }} | ||
PLAYBOOK_INFRASTRUCTURE_BRANCH: ${{ inputs.playbook-infrastructure-branch }} | ||
|
||
# NOTE: we wait for the reset to finish before restarting the nodes to prevent nodes from | ||
# re-syncing the previous chain state. | ||
- name: reconfigure & restart chain services 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 \ | ||
--chain-id=$CHAIN_ID \ | ||
--max-upgrade-batch-size=0 \ | ||
--wait-for-node-sync-after-upgrade=false \ | ||
--update-playbook-filename=playbook.yml | ||
env: | ||
SSM_DOCUMENT_NAME: ${{ inputs.ssm-document-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 }} |
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.
this workflow supports being triggered by either:
configuring it this way allows us to have a single file instead of two copies with different
on
conditions