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

Add deployment scripts for sandbox #739

Merged
merged 11 commits into from
Nov 30, 2021
Merged

Conversation

minsulee2
Copy link
Member

Updates:

  • Add deploy_blockchain_sandbox_gcp.sh
  • Add sandbox option for setup monitoring
  • No exit but return for start_node_genesis_gcp.sh

@@ -0,0 +1,397 @@
#!/bin/bash

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 add a note that this script only deploys nodes 7-99?

Copy link
Contributor

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)

Copy link
Member Author

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
Copy link
Contributor

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?

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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!

Copy link
Member

Choose a reason for hiding this comment

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

which note??

Copy link
Contributor

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="-\|/"
Copy link
Contributor

Choose a reason for hiding this comment

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

🙌

# 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
Copy link
Member

Choose a reason for hiding this comment

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

Loading?

Copy link
Member Author

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"
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yay!

@@ -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"
Copy link
Member

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)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

Copy link
Member

Choose a reason for hiding this comment

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

no updates visible??

@minsulee2
Copy link
Member Author

PTAL!

if [[ $RESET_RESTART_OPTION = "" ]]; then
printf "\nDeploying parent blockchain...\n"
NUM_NODES=100
index=7
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh right! done!

# 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
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.

Fixed!


NUM_NODES=$END_NODE_IDX
node_index=$START_NODE_IDX
while [ $node_index -lt $NUM_NODES ]
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated!

@minsulee2
Copy link
Member Author

PTAL!

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!

@@ -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
Copy link
Contributor

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!

@minsulee2
Copy link
Member Author

Thanks for the review! Merging now!

@minsulee2 minsulee2 merged commit 2a11c69 into develop Nov 30, 2021
@platfowner platfowner changed the title Add extension expr. script Add deployment scripts for sandbox Dec 3, 2021
@minsulee2 minsulee2 deleted the feature/minsulee2/sandbox-script branch January 2, 2022 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need to make the network extensible (testing for 100 or more nodes)
3 participants