Skip to content
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

Improve deployment related code and scripts #896

Merged
merged 21 commits into from
Jan 10, 2022

Conversation

platfowner
Copy link
Member

@platfowner platfowner commented Jan 9, 2022

Change summary:

  • Finalize state version and write snapshot whenever a block is finalized
  • Do not write to file for loaded blocks
  • Extract deleteSnapshot() from writeSnapshot()
  • In deploy_blockchain_genesis_gcp.sh, kill jobs after file copy and ubuntu package install
  • In start_node_incremental_gcp.sh, remove old data after killing jobs ([BUG] Failed to load block 0 with --no-keep-data #894)
  • Replace --canary with BEGIN_PARENT_NODE_INDEX and END_PARENT_NODE_INDEX in incremental deploy
  • Use ~/ain-blockchain instead of home directory itself for deploy
  • Add --no-keep-code and --no-keep-data options and set default values of deploy options
  • Require stronger confirmation for mainnet deploy

Related issues:

@platfowner platfowner added bug Something isn't working enhancement New feature or request labels Jan 9, 2022
@platfowner platfowner force-pushed the feature/platfowner/feature branch 2 times, most recently from becedca to c833f94 Compare January 9, 2022 10:14
printf "Do you want to proceed for $SEASON? Enter [mainnet]: "
read CONFIRM
printf "\n\n"
if [[ ! $CONFIRM = "mainnet" ]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice~ 👍

else
deploy_tracker "$NUM_PARENT_NODES"
for j in `seq 0 $(( ${NUM_PARENT_NODES} - 1 ))`
# Tracker server is deployed with BEGIN_PARENT_NODE_INDEX = -1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

KEEP_DATA_OPTION=""
FULL_SYNC_OPTION=""
ACCOUNT_INJECTION_OPTION=""
ACCOUNT_INJECTION_OPTION="--private-key"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change this to just 'private-key'? It doensn't have the '--' prefix since the blockchain node param doesn't have it. I should've added some notes on the conversion..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. Just tried to export values properly keeping its values in the script like other variables. PTAL

printf "JSON_RPC_OPTION=$JSON_RPC_OPTION\n"
printf "REST_FUNC_OPTION=$REST_FUNC_OPTION\n"

# NOTE(liayoo): Currently this script supports [--keystore|--mnemonic] option only for the parent chain.
if [[ $ACCOUNT_INJECTION_OPTION != "private_key" ]] && [[ "$SHARD_INDEX" -gt 0 ]]; then
if [[ $ACCOUNT_INJECTION_OPTION != "--private_key" ]] && [[ "$SHARD_INDEX" -gt 0 ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

KEEP_DATA_OPTION=""
FULL_SYNC_OPTION=""
ACCOUNT_INJECTION_OPTION=""
ACCOUNT_INJECTION_OPTION="--private-key"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

# for performance test pipeline
export ENABLE_EXPRESS_RATE_LIMIT=false
# NOTE(liayoo): Currently this script supports [--keystore|--mnemonic] option only for the parent chain.
if [[ $ACCOUNT_INJECTION_OPTION != "--private_key" ]] && [[ "$SHARD_INDEX" -gt 0 ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@platfowner
Copy link
Member Author

Addressed the comments so far, PTAL~ @liayoo

@@ -100,18 +95,24 @@ if [[ "$ACCOUNT_INJECTION_OPTION" = "" ]]; then
return 1
fi

if [[ $ACCOUNT_INJECTION_OPTION = "--keystore" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked! 👍

@liayoo
Copy link
Contributor

liayoo commented Jan 9, 2022

Should we test these scripts with different combinations of options? :)

@platfowner platfowner force-pushed the feature/platfowner/feature branch from 3686889 to 56d60d9 Compare January 9, 2022 16:31
@platfowner
Copy link
Member Author

Should we test these scripts with different combinations of options? :)

Thanks for asking. I tried to test it for as many combinations as I can. Basically,
(setup or not) and
(private-key or keystore) * (keep-code or not) * (keep-data or not) * (fast sync or not)
for genesis and incremental.

I think the most important combinations are
(setup or not) * (keystore) * (keep-code or not) * (keep-data) * (fast sync)

@platfowner platfowner force-pushed the feature/platfowner/feature branch from e6e3963 to f374ecc Compare January 9, 2022 17:35
Copy link
Contributor

@liayoo liayoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the nice refactoring!!

@liayoo
Copy link
Contributor

liayoo commented Jan 10, 2022

Should we test these scripts with different combinations of options? :)

Thanks for asking. I tried to test it for as many combinations as I can. Basically, (setup or not) and (private-key or keystore) * (keep-code or not) * (keep-data or not) * (fast sync or not) for genesis and incremental.

I think the most important combinations are (setup or not) * (keystore) * (keep-code or not) * (keep-data) * (fast sync)

Wow, is that like 64 combinations?! That's really impressive.. Thanks for testing so extensively!

Ah, not actually all of them :) individually and most correlated cases (~ 10 cases).

@platfowner
Copy link
Member Author

Thanks for the review! Now merging..

@platfowner platfowner merged commit 9c208a4 into develop Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants