Add testnet-tds support to testnet manager (#4762)

* Add testnet-tds support to testnet scripts
This commit is contained in:
Dan Albert 2019-07-09 14:39:55 -06:00 committed by GitHub
parent bc8f435d45
commit 1ca7e9f67b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 105 additions and 24 deletions

View File

@ -24,6 +24,9 @@ blockstreamer=false
deployUpdateManifest=true deployUpdateManifest=true
fetchLogs=true fetchLogs=true
maybeHashesPerTick= maybeHashesPerTick=
maybeStakeNodesInGenesisBlock=
maybeExternalPrimordialAccountsFile=
maybeLamports=
usage() { usage() {
exitcode=0 exitcode=0
@ -62,12 +65,18 @@ Deploys a CD testnet
-s - Skip start. Nodes will still be created or configured, but network software will not be started. -s - Skip start. Nodes will still be created or configured, but network software will not be started.
-S - Stop network software without tearing down nodes. -S - Stop network software without tearing down nodes.
-f - Discard validator nodes that didn't bootup successfully -f - Discard validator nodes that didn't bootup successfully
-w - Skip time-consuming "bells and whistles" that are --stake-internal-nodes NUM_LAMPORTS
unnecessary for a high-node count demo testnet - Amount to stake internal nodes. If set, airdrops are disabled.
--external-accounts-file FILE_PATH
- Path to external Primordial Accounts file, if it exists.
--hashes-per-tick NUM_HASHES|sleep|auto --hashes-per-tick NUM_HASHES|sleep|auto
- Override the default --hashes-per-tick for the cluster - Override the default --hashes-per-tick for the cluster
--lamports NUM_LAMPORTS
- Specify the number of lamports to mint (default 100000000000000)
--skip-deploy-update
- If set, will skip software update deployment
--skip-remote-log-retrieval
- If set, will not fetch logs from remote nodes
Note: the SOLANA_METRICS_CONFIG environment variable is used to configure Note: the SOLANA_METRICS_CONFIG environment variable is used to configure
metrics metrics
EOF EOF
@ -82,6 +91,21 @@ while [[ -n $1 ]]; do
if [[ $1 = --hashes-per-tick ]]; then if [[ $1 = --hashes-per-tick ]]; then
maybeHashesPerTick="$1 $2" maybeHashesPerTick="$1 $2"
shift 2 shift 2
elif [[ $1 = --lamports ]]; then
maybeLamports="$1 $2"
shift 2
elif [[ $1 = --stake-internal-nodes ]]; then
maybeStakeNodesInGenesisBlock="$1 $2"
shift 2
elif [[ $1 = --external-accounts-file ]]; then
maybeExternalPrimordialAccountsFile="$1 $2"
shift 2
elif [[ $1 = --skip-deploy-update ]]; then
deployUpdateManifest=false
shift 1
elif [[ $1 = --skip-remote-log-retrieval ]]; then
fetchLogs=false
shift 1
else else
usage "Unknown long option: $1" usage "Unknown long option: $1"
fi fi
@ -334,6 +358,19 @@ if ! $skipStart; then
args+=(--deploy-update windows) args+=(--deploy-update windows)
fi fi
if [[ -n $maybeStakeNodesInGenesisBlock ]]; then
# shellcheck disable=SC2206 # Do not want to quote $maybeStakeNodesInGenesisBlock
args+=($maybeStakeNodesInGenesisBlock)
fi
if [[ -n $maybeExternalPrimordialAccountsFile ]]; then
# shellcheck disable=SC2206 # Do not want to quote $maybeExternalPrimordialAccountsFile
args+=($maybeExternalPrimordialAccountsFile)
fi
if [[ -n $maybeLamports ]]; then
# shellcheck disable=SC2206 # Do not want to quote $maybeLamports
args+=($maybeLamports)
fi
# shellcheck disable=SC2086 # Don't want to double quote the $maybeXYZ variables # shellcheck disable=SC2086 # Don't want to double quote the $maybeXYZ variables
time net/net.sh "${args[@]}" time net/net.sh "${args[@]}"
) || ok=false ) || ok=false

View File

@ -44,6 +44,8 @@ steps:
value: "testnet-beta-perf" value: "testnet-beta-perf"
- label: "testnet-demo" - label: "testnet-demo"
value: "testnet-demo" value: "testnet-demo"
- label: "testnet-tds"
value: "testnet-tds"
- select: "Operation" - select: "Operation"
key: "testnet-operation" key: "testnet-operation"
default: "sanity-or-restart" default: "sanity-or-restart"
@ -153,6 +155,11 @@ testnet-demo)
: "${GCE_NODE_COUNT:=150}" : "${GCE_NODE_COUNT:=150}"
: "${GCE_LOW_QUOTA_NODE_COUNT:=70}" : "${GCE_LOW_QUOTA_NODE_COUNT:=70}"
;; ;;
testnet-tds)
CHANNEL_OR_TAG=beta
CHANNEL_BRANCH=$BETA_CHANNEL
: "${GCE_NODE_COUNT:=3}"
;;
*) *)
echo "Error: Invalid TESTNET=$TESTNET" echo "Error: Invalid TESTNET=$TESTNET"
exit 1 exit 1
@ -287,6 +294,14 @@ sanity() {
$ok $ok
) )
;; ;;
testnet-tds)
(
set -x
NO_LEDGER_VERIFY=1 \
NO_VALIDATOR_SANITY=1 \
ci/testnet-sanity.sh tds-solana-com gce "${GCE_ZONES[0]}" -f
)
;;
*) *)
echo "Error: Invalid TESTNET=$TESTNET" echo "Error: Invalid TESTNET=$TESTNET"
exit 1 exit 1
@ -424,7 +439,9 @@ deploy() {
NO_LEDGER_VERIFY=1 \ NO_LEDGER_VERIFY=1 \
NO_VALIDATOR_SANITY=1 \ NO_VALIDATOR_SANITY=1 \
ci/testnet-deploy.sh -p demo-testnet-solana-com -C gce ${GCE_ZONE_ARGS[@]} \ ci/testnet-deploy.sh -p demo-testnet-solana-com -C gce ${GCE_ZONE_ARGS[@]} \
-t "$CHANNEL_OR_TAG" -n "$GCE_NODE_COUNT" -c 0 -P -u -f -w \ -t "$CHANNEL_OR_TAG" -n "$GCE_NODE_COUNT" -c 0 -P -u -f \
--skip-deploy-update \
--skip-remote-log-retrieval \
-a demo-testnet-solana-com \ -a demo-testnet-solana-com \
${skipCreate:+-e} \ ${skipCreate:+-e} \
${maybeSkipStart:+-s} \ ${maybeSkipStart:+-s} \
@ -436,7 +453,9 @@ deploy() {
NO_LEDGER_VERIFY=1 \ NO_LEDGER_VERIFY=1 \
NO_VALIDATOR_SANITY=1 \ NO_VALIDATOR_SANITY=1 \
ci/testnet-deploy.sh -p demo-testnet-solana-com2 -C gce ${GCE_LOW_QUOTA_ZONE_ARGS[@]} \ ci/testnet-deploy.sh -p demo-testnet-solana-com2 -C gce ${GCE_LOW_QUOTA_ZONE_ARGS[@]} \
-t "$CHANNEL_OR_TAG" -n "$GCE_LOW_QUOTA_NODE_COUNT" -c 0 -P -f -x -w \ -t "$CHANNEL_OR_TAG" -n "$GCE_LOW_QUOTA_NODE_COUNT" -c 0 -P -f -x \
--skip-deploy-update \
--skip-remote-log-retrieval \
${skipCreate:+-e} \ ${skipCreate:+-e} \
${skipStart:+-s} \ ${skipStart:+-s} \
${maybeStop:+-S} \ ${maybeStop:+-S} \
@ -444,6 +463,28 @@ deploy() {
fi fi
) )
;; ;;
testnet-tds)
(
set -x
# TODO: Should we spread the few nodes around multiple zones?
# shellcheck disable=SC2068
# shellcheck disable=SC2086
NO_LEDGER_VERIFY=1 \
NO_VALIDATOR_SANITY=1 \
ci/testnet-deploy.sh -p tds-solana-com -C gce ${GCE_ZONE_ARGS[0]} \
-t "$CHANNEL_OR_TAG" -n "$GCE_NODE_COUNT" -c 1 -P -u \
-a tds-solana-com --hashes-per-tick auto \
${skipCreate:+-e} \
${skipStart:+-s} \
${maybeStop:+-S} \
${maybeDelete:+-D} \
--stake-internal-nodes 1000000000000 \
--external-accounts-file /tmp/stakes.yml \
--lamports 8589934592000000000 \
--skip-deploy-update
)
;;
*) *)
echo "Error: Invalid TESTNET=$TESTNET" echo "Error: Invalid TESTNET=$TESTNET"
exit 1 exit 1

View File

@ -50,17 +50,16 @@ Operate a configured testnet
-c bench-tps=2="--tx_count 25000" -c bench-tps=2="--tx_count 25000"
This will start 2 bench-tps clients, and supply "--tx_count 25000" This will start 2 bench-tps clients, and supply "--tx_count 25000"
to the bench-tps client. to the bench-tps client.
-n NUM_FULL_NODES - Number of fullnodes to apply command to.
--hashes-per-tick NUM_HASHES|sleep|auto --hashes-per-tick NUM_HASHES|sleep|auto
- Override the default --hashes-per-tick for the cluster - Override the default --hashes-per-tick for the cluster
-n NUM_FULL_NODES - Number of fullnodes to apply command to. --lamports NUM_LAMPORTS_TO_MINT
- Override the default 100000000000000 lamports minted in genesis
-x Accounts and Stakes for external nodes --stake-internal-nodes NUM_LAMPORTS_PER_NODE
- A YML file with a list of account pubkeys and corresponding stakes - Amount to stake internal nodes in genesis block. If set, airdrops are disabled.
for external nodes --external-accounts-file FILE_PATH
-s Num lamports per node in genesis block - A YML file with a list of account pubkeys and corresponding stakes for external nodes
- Create account keypairs for internal nodes and assign these many lamports
sanity/start/update-specific options: sanity/start/update-specific options:
-F - Discard validator nodes that didn't bootup successfully -F - Discard validator nodes that didn't bootup successfully
-o noLedgerVerify - Skip ledger verification -o noLedgerVerify - Skip ledger verification
@ -96,6 +95,7 @@ failOnValidatorBootupFailure=true
genesisOptions= genesisOptions=
numFullnodesRequested= numFullnodesRequested=
externalPrimordialAccountsFile= externalPrimordialAccountsFile=
remoteExternalPrimordialAccountsFile=/tmp/external-primodial-accounts.yml
stakeNodesInGenesisBlock= stakeNodesInGenesisBlock=
command=$1 command=$1
@ -111,9 +111,18 @@ while [[ -n $1 ]]; do
elif [[ $1 = --target-lamports-per-signature ]]; then elif [[ $1 = --target-lamports-per-signature ]]; then
genesisOptions="$genesisOptions $1 $2" genesisOptions="$genesisOptions $1 $2"
shift 2 shift 2
elif [[ $1 = --lamports ]]; then
genesisOptions="$genesisOptions $1 $2"
shift 2
elif [[ $1 = --deploy-update ]]; then elif [[ $1 = --deploy-update ]]; then
updatePlatforms="$updatePlatforms $2" updatePlatforms="$updatePlatforms $2"
shift 2 shift 2
elif [[ $1 = --stake-internal-nodes ]]; then
stakeNodesInGenesisBlock="$2"
shift 2
elif [[ $1 = --external-accounts-file ]]; then
externalPrimordialAccountsFile="$2"
shift 2
else else
usage "Unknown long option: $1" usage "Unknown long option: $1"
fi fi
@ -123,7 +132,7 @@ while [[ -n $1 ]]; do
fi fi
done done
while getopts "h?T:t:o:f:rD:c:Fn:i:x:s:" opt "${shortArgs[@]}"; do while getopts "h?T:t:o:f:rD:c:Fn:i:" opt "${shortArgs[@]}"; do
case $opt in case $opt in
h | \?) h | \?)
usage usage
@ -202,12 +211,6 @@ while getopts "h?T:t:o:f:rD:c:Fn:i:x:s:" opt "${shortArgs[@]}"; do
F) F)
failOnValidatorBootupFailure=false failOnValidatorBootupFailure=false
;; ;;
x)
externalPrimordialAccountsFile=$OPTARG
;;
s)
stakeNodesInGenesisBlock=$OPTARG
;;
i) i)
nodeAddress=$OPTARG nodeAddress=$OPTARG
;; ;;
@ -321,7 +324,7 @@ startBootstrapLeader() {
set -x set -x
startCommon "$ipAddress" || exit 1 startCommon "$ipAddress" || exit 1
[[ -z "$externalPrimordialAccountsFile" ]] || rsync -vPrc -e "ssh ${sshOptions[*]}" "$externalPrimordialAccountsFile" \ [[ -z "$externalPrimordialAccountsFile" ]] || rsync -vPrc -e "ssh ${sshOptions[*]}" "$externalPrimordialAccountsFile" \
"$ipAddress:~/solana/config/external-primodial-accounts.yml" "$ipAddress:$remoteExternalPrimordialAccountsFile"
case $deployMethod in case $deployMethod in
tar) tar)
rsync -vPrc -e "ssh ${sshOptions[*]}" "$SOLANA_ROOT"/solana-release/bin/* "$ipAddress:~/.cargo/bin/" rsync -vPrc -e "ssh ${sshOptions[*]}" "$SOLANA_ROOT"/solana-release/bin/* "$ipAddress:~/.cargo/bin/"
@ -343,7 +346,7 @@ startBootstrapLeader() {
\"$RUST_LOG\" \ \"$RUST_LOG\" \
$skipSetup \ $skipSetup \
$failOnValidatorBootupFailure \ $failOnValidatorBootupFailure \
\"$externalPrimordialAccountsFile\" \ \"$remoteExternalPrimordialAccountsFile\" \
\"$stakeNodesInGenesisBlock\" \ \"$stakeNodesInGenesisBlock\" \
$nodeIndex \ $nodeIndex \
$numBenchTpsClients \"$benchTpsExtraArgs\" \ $numBenchTpsClients \"$benchTpsExtraArgs\" \
@ -377,7 +380,7 @@ startNode() {
\"$RUST_LOG\" \ \"$RUST_LOG\" \
$skipSetup \ $skipSetup \
$failOnValidatorBootupFailure \ $failOnValidatorBootupFailure \
\"$externalPrimordialAccountsFile\" \ \"$remoteExternalPrimordialAccountsFile\" \
\"$stakeNodesInGenesisBlock\" \ \"$stakeNodesInGenesisBlock\" \
$nodeIndex \ $nodeIndex \
\"$genesisOptions\" \ \"$genesisOptions\" \