Leader rotation flag plumbing
This commit is contained in:
@ -29,6 +29,7 @@ fullnodeIpList=()
|
||||
fullnodeIpListPrivate=()
|
||||
clientIpList=()
|
||||
clientIpListPrivate=()
|
||||
leaderRotation=
|
||||
|
||||
buildSshOptions() {
|
||||
sshOptions=(
|
||||
@ -50,6 +51,7 @@ loadConfigFile() {
|
||||
[[ -n "$publicNetwork" ]] || usage "Config file invalid, publicNetwork unspecified: $configFile"
|
||||
[[ -n "$netBasename" ]] || usage "Config file invalid, netBasename unspecified: $configFile"
|
||||
[[ -n $sshPrivateKey ]] || usage "Config file invalid, sshPrivateKey unspecified: $configFile"
|
||||
[[ -n $leaderRotation ]] || usage "Config file invalid, leaderRotation unspecified: $configFile"
|
||||
[[ ${#fullnodeIpList[@]} -gt 0 ]] || usage "Config file invalid, fullnodeIpList unspecified: $configFile"
|
||||
[[ ${#fullnodeIpListPrivate[@]} -gt 0 ]] || usage "Config file invalid, fullnodeIpListPrivate unspecified: $configFile"
|
||||
|
||||
|
13
net/gce.sh
13
net/gce.sh
@ -43,6 +43,7 @@ clientBootDiskSizeInGb=75
|
||||
publicNetwork=false
|
||||
enableGpu=false
|
||||
bootstrapLeaderAddress=
|
||||
leaderRotation=true
|
||||
|
||||
usage() {
|
||||
exitcode=0
|
||||
@ -76,6 +77,7 @@ Manage testnet instances
|
||||
For EC2, [address] is the "allocation ID" of the desired
|
||||
Elastic IP.
|
||||
-d [disk-type] - Specify a boot disk type (default None) Use pd-ssd to get ssd on GCE.
|
||||
-b - Disable leader rotation
|
||||
|
||||
config-specific options:
|
||||
-P - Use public network IP addresses (default: $publicNetwork)
|
||||
@ -93,7 +95,7 @@ command=$1
|
||||
shift
|
||||
[[ $command = create || $command = config || $command = delete ]] || usage "Invalid command: $command"
|
||||
|
||||
while getopts "h?p:Pn:c:z:gG:a:d:" opt; do
|
||||
while getopts "h?p:Pn:c:z:gG:a:d:b" opt; do
|
||||
case $opt in
|
||||
h | \?)
|
||||
usage
|
||||
@ -114,6 +116,9 @@ while getopts "h?p:Pn:c:z:gG:a:d:" opt; do
|
||||
z)
|
||||
cloud_SetZone "$OPTARG"
|
||||
;;
|
||||
b)
|
||||
leaderRotation=false
|
||||
;;
|
||||
g)
|
||||
enableGpu=true
|
||||
bootstrapLeaderMachineType=$gpuBootstrapLeaderMachineType
|
||||
@ -179,6 +184,9 @@ ec2)
|
||||
;;
|
||||
esac
|
||||
|
||||
if $leaderRotation; then
|
||||
fullNodeMachineType=$bootstrapLeaderMachineType
|
||||
fi
|
||||
|
||||
# cloud_ForEachInstance [cmd] [extra args to cmd]
|
||||
#
|
||||
@ -218,6 +226,7 @@ prepareInstancesAndWriteConfigFile() {
|
||||
netBasename=$prefix
|
||||
publicNetwork=$publicNetwork
|
||||
sshPrivateKey=$sshPrivateKey
|
||||
leaderRotation=$leaderRotation
|
||||
EOF
|
||||
|
||||
buildSshOptions
|
||||
@ -369,6 +378,8 @@ Network composition:
|
||||
Additional fullnodes = $additionalFullNodeCount x $fullNodeMachineType
|
||||
Client(s) = $clientNodeCount x $clientMachineType
|
||||
|
||||
Leader rotation: $leaderRotation
|
||||
|
||||
========================================================================================
|
||||
|
||||
EOF
|
||||
|
@ -197,6 +197,7 @@ startBootstrapLeader() {
|
||||
${#fullnodeIpList[@]} \
|
||||
\"$RUST_LOG\" \
|
||||
$skipSetup \
|
||||
$leaderRotation \
|
||||
"
|
||||
) >> "$logFile" 2>&1 || {
|
||||
cat "$logFile"
|
||||
@ -223,6 +224,7 @@ startNode() {
|
||||
${#fullnodeIpList[@]} \
|
||||
\"$RUST_LOG\" \
|
||||
$skipSetup \
|
||||
$leaderRotation \
|
||||
"
|
||||
) >> "$logFile" 2>&1 &
|
||||
declare pid=$!
|
||||
|
@ -11,6 +11,7 @@ entrypointIp="$4"
|
||||
numNodes="$5"
|
||||
RUST_LOG="$6"
|
||||
skipSetup="$7"
|
||||
leaderRotation="$8"
|
||||
set +x
|
||||
export RUST_LOG=${RUST_LOG:-solana=warn} # if RUST_LOG is unset, default to warn
|
||||
|
||||
@ -25,11 +26,13 @@ missing() {
|
||||
[[ -n $entrypointIp ]] || missing entrypointIp
|
||||
[[ -n $numNodes ]] || missing numNodes
|
||||
[[ -n $skipSetup ]] || missing skipSetup
|
||||
[[ -n $leaderRotation ]] || missing leaderRotation
|
||||
|
||||
cat > deployConfig <<EOF
|
||||
deployMethod="$deployMethod"
|
||||
entrypointIp="$entrypointIp"
|
||||
numNodes="$numNodes"
|
||||
leaderRotation=$leaderRotation
|
||||
EOF
|
||||
|
||||
source net/common.sh
|
||||
@ -83,6 +86,7 @@ snap)
|
||||
rust-log=\"$RUST_LOG\" \
|
||||
setup-args=\"$setupArgs\" \
|
||||
skip-setup=$skipSetup \
|
||||
leader-rotation=\"$leaderRotation\" \
|
||||
"
|
||||
|
||||
if [[ -e /dev/nvidia0 ]]; then
|
||||
@ -134,6 +138,12 @@ local|tar)
|
||||
scripts/oom-monitor.sh > oom-monitor.log 2>&1 &
|
||||
scripts/net-stats.sh > net-stats.log 2>&1 &
|
||||
|
||||
maybeNoLeaderRotation=
|
||||
if ! $leaderRotation; then
|
||||
maybeNoLeaderRotation="--no-leader-rotation"
|
||||
fi
|
||||
|
||||
|
||||
case $nodeType in
|
||||
bootstrap-leader)
|
||||
if [[ -e /dev/nvidia0 && -x ~/.cargo/bin/solana-fullnode-cuda ]]; then
|
||||
@ -144,7 +154,7 @@ local|tar)
|
||||
./multinode-demo/setup.sh -t bootstrap-leader $setupArgs
|
||||
fi
|
||||
./multinode-demo/drone.sh > drone.log 2>&1 &
|
||||
./multinode-demo/bootstrap-leader.sh > bootstrap-leader.log 2>&1 &
|
||||
./multinode-demo/bootstrap-leader.sh $maybeNoLeaderRotation > bootstrap-leader.log 2>&1 &
|
||||
ln -sTf bootstrap-leader.log fullnode.log
|
||||
;;
|
||||
fullnode)
|
||||
@ -158,7 +168,7 @@ local|tar)
|
||||
if [[ $skipSetup != true ]]; then
|
||||
./multinode-demo/setup.sh -t fullnode $setupArgs
|
||||
fi
|
||||
./multinode-demo/fullnode.sh "$entrypointIp":~/solana "$entrypointIp:8001" > fullnode.log 2>&1 &
|
||||
./multinode-demo/fullnode.sh $maybeNoLeaderRotation "$entrypointIp":~/solana "$entrypointIp:8001" > fullnode.log 2>&1 &
|
||||
;;
|
||||
*)
|
||||
echo "Error: unknown node type: $nodeType"
|
||||
|
@ -22,9 +22,10 @@ missing() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
[[ -n $deployMethod ]] || missing deployMethod
|
||||
[[ -n $entrypointIp ]] || missing entrypointIp
|
||||
[[ -n $numNodes ]] || missing numNodes
|
||||
[[ -n $deployMethod ]] || missing deployMethod
|
||||
[[ -n $entrypointIp ]] || missing entrypointIp
|
||||
[[ -n $numNodes ]] || missing numNodes
|
||||
[[ -n $leaderRotation ]] || missing leaderRotation
|
||||
|
||||
ledgerVerify=true
|
||||
validatorSanity=true
|
||||
|
Reference in New Issue
Block a user