-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add deployment scripts for sandbox #739
Conversation
@@ -0,0 +1,397 @@ | |||
#!/bin/bash | |||
|
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.
could you add a note that this script only deploys nodes 7-99?
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.
or we could get the start & end node indices as input? for example, bash deploy_blockchain_sandbox_gcp.sh lia 7 99
(deploys nodes 7 ... 99) or bash deploy_blockchain_sandbox_gcp 10
(deploys only node 10)
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.
I added <# start node> and <# end node>
@@ -4,7 +4,7 @@ if [[ $# -lt 3 ]] || [[ $# -gt 7 ]]; then | |||
printf "Usage: bash start_node_genesis_gcp.sh [dev|staging|sandbox|spring|summer] <Shard Index> <Node Index> [--keep-code] [--full-sync] [--keystore|--mnemonic] [--json-rpc] [--rest-func]\n" | |||
printf "Example: bash start_node_genesis_gcp.sh spring 0 0 --keep-code --full-sync --keystore\n" | |||
printf "\n" | |||
exit | |||
return 1 |
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.
question) why do we need to change from exit to return?
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.
do we have any use case of this return value now? If so, what about updating other scripts as well for consistency? or just putting it as a future work now for consistency?
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.
@liayoo exit
really exits the terminal especially for gcp console that is automatically terminated.
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.
@platfowner I left NOTE for this!
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.
which note??
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.
Thanks for the explanation & the note!
FILES_FOR_NODE="blockchain/ blockchain-configs/ block-pool/ client/ common/ consensus/ db/ event-handler/ json_rpc/ logger/ node/ p2p/ tools/ traffic/ tx-pool/ package.json setup_blockchain_ubuntu.sh start_node_genesis_gcp.sh start_node_incremental_gcp.sh wait_until_node_sync_gcp.sh" | ||
|
||
# Loding spinner | ||
spin="-\|/" |
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.
🙌
deploy_blockchain_sandbox_gcp.sh
Outdated
# deploy files | ||
FILES_FOR_NODE="blockchain/ blockchain-configs/ block-pool/ client/ common/ consensus/ db/ event-handler/ json_rpc/ logger/ node/ p2p/ tools/ traffic/ tx-pool/ package.json setup_blockchain_ubuntu.sh start_node_genesis_gcp.sh start_node_incremental_gcp.sh wait_until_node_sync_gcp.sh" | ||
|
||
# Loding spinner |
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.
Loading?
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.
Updated to Work in progress
fi | ||
|
||
# GCP node address | ||
# NODE_0_TARGET_ADDR="${GCP_USER}@${SEASON}-node-0-taiwan" |
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.
thanks for including these nodes in this script.
this would be helpful to expand start_blockchain_node_gcp.sh easily in the future.
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.
Yay!
setup_monitoring_gcp.sh
Outdated
@@ -1,14 +1,14 @@ | |||
#!/bin/bash | |||
|
|||
if [[ "$#" -lt 1 ]]; then | |||
printf "Usage: bash setup_monitoring_gcp.sh [dev|staging|spring|summer]\n" | |||
printf "Usage: bash setup_monitoring_gcp.sh [dev|sandbox|staging|spring|summer]\n" |
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.
minor: could you add 'sandbox' next to 'staging' as it was so in other scripts (e.g. deploy_blockchain_genesis_gcp.sh)?
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.
Done!
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.
no updates visible??
PTAL! |
deploy_blockchain_sandbox_gcp.sh
Outdated
if [[ $RESET_RESTART_OPTION = "" ]]; then | ||
printf "\nDeploying parent blockchain...\n" | ||
NUM_NODES=100 | ||
index=7 |
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.
should these be START_NODE_IDX & END_NODE_IDX?
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.
Oh right! done!
deploy_blockchain_sandbox_gcp.sh
Outdated
# ssh into each instance, set up the ubuntu VM instance (ONLY NEEDED FOR THE FIRST TIME) | ||
if [[ $SETUP_OPTION = "--setup" ]]; then | ||
printf "\n\n##########################\n# Setting up blockchain nodes #\n##########################\n" | ||
NUM_NODES=100 |
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.
ditto
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.
Fixed!
deploy_blockchain_sandbox_gcp.sh
Outdated
|
||
NUM_NODES=$END_NODE_IDX | ||
node_index=$START_NODE_IDX | ||
while [ $node_index -lt $NUM_NODES ] |
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.
what do you think about making END_NODE_IDX inclusive?
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.
Updated!
PTAL! |
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.
LGTM, thanks!
@@ -4,7 +4,7 @@ if [[ $# -lt 3 ]] || [[ $# -gt 7 ]]; then | |||
printf "Usage: bash start_node_genesis_gcp.sh [dev|staging|sandbox|spring|summer] <Shard Index> <Node Index> [--keep-code] [--full-sync] [--keystore|--mnemonic] [--json-rpc] [--rest-func]\n" | |||
printf "Example: bash start_node_genesis_gcp.sh spring 0 0 --keep-code --full-sync --keystore\n" | |||
printf "\n" | |||
exit | |||
return 1 |
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.
Thanks for the explanation & the note!
Thanks for the review! Merging now! |
Updates: