From c81733b41a17dfe89caae48342c2e9ae2aa014c7 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 26 Apr 2019 22:08:58 -0700 Subject: [PATCH] Add testnet-demo configuration --- ci/testnet-manager.sh | 66 ++++++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/ci/testnet-manager.sh b/ci/testnet-manager.sh index dbaf372d75..9044d5af66 100755 --- a/ci/testnet-manager.sh +++ b/ci/testnet-manager.sh @@ -48,11 +48,11 @@ steps: key: "testnet-operation" default: "sanity-or-restart" options: - - label: "Create new testnet nodes and then start network software. If nodes are already created, they will be deleted and then re-created." + - label: "Create testnet and then start software. If the testnet already exists it will be deleted and re-created" value: "create-and-start" - - label: "Create new testnet nodes, but do not start network software. If nodes are already created, they will be deleted and then re-created." + - label: "Create testnet, but do not start software. If the testnet already exists it will be deleted and re-created" value: "create" - - label: "Start network software on already-created testnet nodes. If software is already running, it will be restarted." + - label: "Start network software on an existing testnet. If software is already running it will be restarted." value: "start" - label: "Stop network software without deleting testnet nodes" value: "stop" @@ -62,7 +62,7 @@ steps: value: "sanity-or-restart" - label: "Sanity check only" value: "sanity" - - label: "Delete all nodes on a testnet. Network software will be stopped first if it is running" + - label: "Delete the testnet. value: "delete" - label: "Enable/unlock the testnet." value: "enable" @@ -105,8 +105,15 @@ testnet-perf) CHANNEL_BRANCH=$STABLE_CHANNEL ;; testnet-demo) - CHANNEL_OR_TAG=beta - CHANNEL_BRANCH=$BETA_CHANNEL + CHANNEL_OR_TAG=edge + CHANNEL_BRANCH=$EDGE_CHANNEL + #CHANNEL_OR_TAG=beta + #CHANNEL_BRANCH=$BETA_CHANNEL + + : "${GCE_NODE_COUNT:=10}" + + # TODO: Increase zone list to maximum + GCE_ZONES=(us-west1-b us-east4-c) ;; *) echo "Error: Invalid TESTNET=$TESTNET" @@ -114,6 +121,15 @@ testnet-demo) ;; esac +EC2_ZONE_ARGS=() +for val in "${EC2_ZONES[@]}"; do + EC2_ZONE_ARGS+=("-z $val") +done +GCE_ZONE_ARGS=() +for val in "${GCE_ZONES[@]}"; do + GCE_ZONE_ARGS+=("-z $val") +done + if [[ -n $TESTNET_DB_HOST ]]; then SOLANA_METRICS_PARTIAL_CONFIG="host=$TESTNET_DB_HOST,$SOLANA_METRICS_PARTIAL_CONFIG" fi @@ -211,6 +227,21 @@ sanity() { #ci/testnet-sanity.sh perf-testnet-solana-com ec2 us-east-1a ) ;; + testnet-demo) + ( + set -x + + ok=true + if [[ -n $GCE_NODE_COUNT ]]; then + NO_LEDGER_VERIFY=1 \ + ci/testnet-sanity.sh demo-testnet-solana-com gce "${GCE_ZONES[0]}" || ok=false + else + echo "Error: no GCE nodes" + ok=false + fi + $ok + ) + ;; *) echo "Error: Invalid TESTNET=$TESTNET" exit 1 @@ -271,17 +302,6 @@ deploy() { ( set -x - # Build an array to pass as opts to testnet-deploy.sh: "-z zone1 -z zone2 ..." - GCE_ZONE_ARGS=() - for val in "${GCE_ZONES[@]}"; do - GCE_ZONE_ARGS+=("-z $val") - done - - EC2_ZONE_ARGS=() - for val in "${EC2_ZONES[@]}"; do - EC2_ZONE_ARGS+=("-z $val") - done - if [[ -n $EC2_NODE_COUNT ]]; then if [[ -n $GCE_NODE_COUNT ]] || [[ -n $skipStart ]]; then maybeSkipStart="skip" @@ -356,8 +376,16 @@ deploy() { testnet-demo) ( set -x - echo "Demo net not yet implemented!" - exit 1 + if [[ -n $GCE_NODE_COUNT ]]; then + # shellcheck disable=SC2068 + ci/testnet-deploy.sh -p testnet-demo -C gce ${GCE_ZONE_ARGS[@]} \ + -t "$CHANNEL_OR_TAG" -n "$GCE_NODE_COUNT" -c 1 -P -u \ + -a demo-testnet-solana-com \ + ${skipCreate:+-r} \ + ${skipStart:+-s} \ + ${maybeStop:+-S} \ + ${maybeDelete:+-D} + fi ) ;; *)