From 440d006ec1d5a93ab6c5f0c7cf0dcf277be66df7 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Sun, 14 Jul 2019 13:17:30 -0600 Subject: [PATCH] Plumb --no-snapshot in from CI (#5077) * Plumb --no-snapshot in from CI --- ci/testnet-deploy.sh | 13 ++++++++++++- ci/testnet-manager.sh | 3 ++- net/net.sh | 8 ++++++++ net/remote/remote-node.sh | 4 ++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ci/testnet-deploy.sh b/ci/testnet-deploy.sh index 39bf33284..355af6acd 100755 --- a/ci/testnet-deploy.sh +++ b/ci/testnet-deploy.sh @@ -29,6 +29,7 @@ maybeExternalPrimordialAccountsFile= maybeLamports= maybeLetsEncrypt= maybeFullnodeAdditionalDiskSize= +maybeNoSnapshot= usage() { exitcode=0 @@ -82,7 +83,9 @@ Deploys a CD testnet --letsencrypt [dns name] - Attempt to generate a TLS certificate using this DNS name --fullnode-additional-disk-size-gb [number] - - Size of additional disk in GB for all fullnodes + - Size of additional disk in GB for all fullnodes + --no-snapshot + - If set, disables booting validators from a snapshot Note: the SOLANA_METRICS_CONFIG environment variable is used to configure metrics @@ -122,6 +125,9 @@ while [[ -n $1 ]]; do elif [[ $1 == --machine-type* ]]; then # Bypass quoted long args for GPUs shortArgs+=("$1") shift + elif [[ $1 = --no-snapshot ]]; then + maybeNoSnapshot="$1" + shift 1 else usage "Unknown long option: $1" fi @@ -396,6 +402,11 @@ if ! $skipStart; then args+=($maybeLamports) fi + if [[ -n $maybeNoSnapshot ]]; then + # shellcheck disable=SC2206 + args+=($maybeNoSnapshot) + fi + time net/net.sh "${args[@]}" ) || ok=false diff --git a/ci/testnet-manager.sh b/ci/testnet-manager.sh index ca06fa558..3c4d8be8e 100755 --- a/ci/testnet-manager.sh +++ b/ci/testnet-manager.sh @@ -497,7 +497,8 @@ deploy() { --external-accounts-file "$EXTERNAL_ACCOUNTS_FILE" \ --lamports 8589934592000000000 \ --skip-deploy-update \ - --fullnode-additional-disk-size-gb 32000 + --fullnode-additional-disk-size-gb 32000 \ + --no-snapshot ) ;; diff --git a/net/net.sh b/net/net.sh index 29950fa0e..619197cf2 100755 --- a/net/net.sh +++ b/net/net.sh @@ -60,6 +60,8 @@ Operate a configured testnet - Amount to stake internal nodes in genesis block. If set, airdrops are disabled. --external-accounts-file FILE_PATH - A YML file with a list of account pubkeys and corresponding stakes for external nodes + --no-snapshot + - If set, disables booting validators from a snapshot sanity/start/update-specific options: -F - Discard validator nodes that didn't bootup successfully -o noLedgerVerify - Skip ledger verification @@ -97,6 +99,7 @@ numFullnodesRequested= externalPrimordialAccountsFile= remoteExternalPrimordialAccountsFile= stakeNodesInGenesisBlock= +maybeNoSnapshot="" command=$1 [[ -n $command ]] || usage @@ -114,6 +117,9 @@ while [[ -n $1 ]]; do elif [[ $1 = --lamports ]]; then genesisOptions="$genesisOptions $1 $2" shift 2 + elif [[ $1 = --no-snapshot ]]; then + maybeNoSnapshot="$1" + shift 1 elif [[ $1 = --deploy-update ]]; then updatePlatforms="$updatePlatforms $2" shift 2 @@ -353,6 +359,7 @@ startBootstrapLeader() { $numBenchTpsClients \"$benchTpsExtraArgs\" \ $numBenchExchangeClients \"$benchExchangeExtraArgs\" \ \"$genesisOptions\" \ + $maybeNoSnapshot \ " ) >> "$logFile" 2>&1 || { cat "$logFile" @@ -402,6 +409,7 @@ startNode() { \"$stakeNodesInGenesisBlock\" \ $nodeIndex \ \"$genesisOptions\" \ + $maybeNoSnapshot \ " ) >> "$logFile" 2>&1 & declare pid=$! diff --git a/net/remote/remote-node.sh b/net/remote/remote-node.sh index 0d1b53449..d75d88965 100755 --- a/net/remote/remote-node.sh +++ b/net/remote/remote-node.sh @@ -19,6 +19,7 @@ benchTpsExtraArgs="${12}" numBenchExchangeClients="${13}" benchExchangeExtraArgs="${14}" genesisOptions="${15}" +noSnapshot="${16}" set +x export RUST_LOG @@ -170,6 +171,7 @@ local|tar) args+=(--no-airdrop) fi args+=(--init-complete-file "$initCompleteFile") + args+=("$noSnapshot") nohup ./multinode-demo/validator.sh --bootstrap-leader "${args[@]}" > fullnode.log 2>&1 & waitForNodeToInit ;; @@ -247,6 +249,7 @@ local|tar) fi args+=(--init-complete-file "$initCompleteFile") + args+=("$noSnapshot") nohup ./multinode-demo/validator.sh "${args[@]}" > fullnode.log 2>&1 & waitForNodeToInit ;; @@ -264,6 +267,7 @@ local|tar) if [[ $skipSetup != true ]]; then ./multinode-demo/clear-config.sh fi + args+=("$noSnapshot") nohup ./multinode-demo/replicator.sh "${args[@]}" > fullnode.log 2>&1 & sleep 1 ;;