Plumb blockstreamer name through testnet scripts

This commit is contained in:
Tyera Eulberg 2019-02-21 16:35:26 -07:00 committed by Tyera Eulberg
parent deeabb862d
commit 18d48f09f8
6 changed files with 39 additions and 39 deletions

View File

@ -18,7 +18,7 @@ enableGpu=false
bootDiskType="" bootDiskType=""
leaderRotation=true leaderRotation=true
useTarReleaseChannel=false useTarReleaseChannel=false
apiNode=false blockstreamer=false
usage() { usage() {
exitcode=0 exitcode=0
@ -44,7 +44,7 @@ Deploys a CD testnet
(default: $tarChannelOrTag) (default: $tarChannelOrTag)
-n [number] - Number of additional full nodes (default: $additionalFullNodeCount) -n [number] - Number of additional full nodes (default: $additionalFullNodeCount)
-c [number] - Number of client bencher nodes (default: $clientNodeCount) -c [number] - Number of client bencher nodes (default: $clientNodeCount)
-u - Include an API node (default: $apiNode) -u - Include a Blockstreamer (default: $blockstreamer)
-P - Use public network IP addresses (default: $publicNetwork) -P - Use public network IP addresses (default: $publicNetwork)
-G - Enable GPU, and set count/type of GPUs to use (e.g n1-standard-16 --accelerator count=4,type=nvidia-tesla-k80) -G - Enable GPU, and set count/type of GPUs to use (e.g n1-standard-16 --accelerator count=4,type=nvidia-tesla-k80)
-g - Enable GPU (default: $enableGpu) -g - Enable GPU (default: $enableGpu)
@ -127,7 +127,7 @@ while getopts "h?p:Pn:c:s:t:gG:a:Dbd:ru" opt; do
skipSetup=true skipSetup=true
;; ;;
u) u)
apiNode=true blockstreamer=true
;; ;;
*) *)
usage "Error: unhandled option: $opt" usage "Error: unhandled option: $opt"
@ -171,7 +171,7 @@ if ! $skipSetup; then
-n "$additionalFullNodeCount" -n "$additionalFullNodeCount"
) )
if $apiNode; then if $blockstreamer; then
create_args+=(-u) create_args+=(-u)
fi fi

View File

@ -29,8 +29,8 @@ fullnodeIpList=()
fullnodeIpListPrivate=() fullnodeIpListPrivate=()
clientIpList=() clientIpList=()
clientIpListPrivate=() clientIpListPrivate=()
apiIpList=() blockstreamerIpList=()
apiIpListPrivate=() blockstreamerIpListPrivate=()
leaderRotation= leaderRotation=
buildSshOptions() { buildSshOptions() {

View File

@ -17,7 +17,7 @@ gce)
bootstrapLeaderMachineType=$cpuBootstrapLeaderMachineType bootstrapLeaderMachineType=$cpuBootstrapLeaderMachineType
fullNodeMachineType=n1-standard-16 fullNodeMachineType=n1-standard-16
clientMachineType=n1-standard-16 clientMachineType=n1-standard-16
apiNodeMachineType=n1-standard-8 blockstreamerMachineType=n1-standard-8
;; ;;
ec2) ec2)
# shellcheck source=net/scripts/ec2-provider.sh # shellcheck source=net/scripts/ec2-provider.sh
@ -28,7 +28,7 @@ ec2)
bootstrapLeaderMachineType=$cpuBootstrapLeaderMachineType bootstrapLeaderMachineType=$cpuBootstrapLeaderMachineType
fullNodeMachineType=m4.2xlarge fullNodeMachineType=m4.2xlarge
clientMachineType=m4.2xlarge clientMachineType=m4.2xlarge
apiNodeMachineType=m4.2xlarge blockstreamerMachineType=m4.2xlarge
;; ;;
*) *)
echo "Error: Unknown cloud provider: $cloudProvider" echo "Error: Unknown cloud provider: $cloudProvider"
@ -39,7 +39,7 @@ esac
prefix=testnet-dev-${USER//[^A-Za-z0-9]/} prefix=testnet-dev-${USER//[^A-Za-z0-9]/}
additionalFullNodeCount=5 additionalFullNodeCount=5
clientNodeCount=1 clientNodeCount=1
apiNode=false blockstreamer=false
fullNodeBootDiskSizeInGb=1000 fullNodeBootDiskSizeInGb=1000
clientBootDiskSizeInGb=75 clientBootDiskSizeInGb=75
@ -72,12 +72,12 @@ Manage testnet instances
create-specific options: create-specific options:
-n [number] - Number of additional fullnodes (default: $additionalFullNodeCount) -n [number] - Number of additional fullnodes (default: $additionalFullNodeCount)
-c [number] - Number of client nodes (default: $clientNodeCount) -c [number] - Number of client nodes (default: $clientNodeCount)
-u - Include an API node (default: $apiNode) -u - Include a Blockstreamer (default: $blockstreamer)
-P - Use public network IP addresses (default: $publicNetwork) -P - Use public network IP addresses (default: $publicNetwork)
-g - Enable GPU (default: $enableGpu) -g - Enable GPU (default: $enableGpu)
-G - Enable GPU, and set count/type of GPUs to use -G - Enable GPU, and set count/type of GPUs to use
(e.g $cpuBootstrapLeaderMachineType --accelerator count=4,type=nvidia-tesla-k80) (e.g $cpuBootstrapLeaderMachineType --accelerator count=4,type=nvidia-tesla-k80)
-a [address] - Address to be be assigned to the API node if present, -a [address] - Address to be be assigned to the Blockstreamer if present,
otherwise the bootstrap fullnode. otherwise the bootstrap fullnode.
* For GCE, [address] is the "name" of the desired External * For GCE, [address] is the "name" of the desired External
IP Address. IP Address.
@ -145,7 +145,7 @@ while getopts "h?p:Pn:c:z:gG:a:d:bu" opt; do
bootDiskType=$OPTARG bootDiskType=$OPTARG
;; ;;
u) u)
apiNode=true blockstreamer=true
;; ;;
*) *)
usage "unhandled option: $opt" usage "unhandled option: $opt"
@ -363,12 +363,12 @@ EOF
cloud_ForEachInstance waitForStartupComplete cloud_ForEachInstance waitForStartupComplete
} }
echo "apiIpList=()" >> "$configFile" echo "blockstreamerIpList=()" >> "$configFile"
echo "apiIpListPrivate=()" >> "$configFile" echo "blockstreamerIpListPrivate=()" >> "$configFile"
echo "Looking for api instances..." echo "Looking for blockstreamer instances..."
cloud_FindInstances "$prefix-api" cloud_FindInstances "$prefix-blockstreamer"
[[ ${#instances[@]} -eq 0 ]] || { [[ ${#instances[@]} -eq 0 ]] || {
cloud_ForEachInstance recordInstanceIp apiIpList cloud_ForEachInstance recordInstanceIp blockstreamerIpList
cloud_ForEachInstance waitForStartupComplete cloud_ForEachInstance waitForStartupComplete
} }
@ -427,7 +427,7 @@ Network composition:
Bootstrap leader = $bootstrapLeaderMachineType (GPU=$enableGpu) Bootstrap leader = $bootstrapLeaderMachineType (GPU=$enableGpu)
Additional fullnodes = $additionalFullNodeCount x $fullNodeMachineType Additional fullnodes = $additionalFullNodeCount x $fullNodeMachineType
Client(s) = $clientNodeCount x $clientMachineType Client(s) = $clientNodeCount x $clientMachineType
API Node = $apiNode Blockstreamer = $blockstreamer
Leader rotation: $leaderRotation Leader rotation: $leaderRotation
@ -497,8 +497,8 @@ touch /.instance-startup-complete
EOF EOF
if $apiNode; then if $blockstreamer; then
apiNodeAddress=$customAddress blockstreamerAddress=$customAddress
else else
bootstrapLeaderAddress=$customAddress bootstrapLeaderAddress=$customAddress
fi fi
@ -519,10 +519,10 @@ EOF
"$startupScript" "" "$bootDiskType" "$startupScript" "" "$bootDiskType"
fi fi
if $apiNode; then if $blockstreamer; then
cloud_CreateInstances "$prefix" "$prefix-api" "1" \ cloud_CreateInstances "$prefix" "$prefix-blockstreamer" "1" \
"$imageName" "$apiNodeMachineType" "$fullNodeBootDiskSizeInGb" \ "$imageName" "$blockstreamerMachineType" "$fullNodeBootDiskSizeInGb" \
"$startupScript" "$apiNodeAddress" "$bootDiskType" "$startupScript" "$blockstreamerAddress" "$bootDiskType"
fi fi
$metricsWriteDatapoint "testnet-deploy net-create-complete=1" $metricsWriteDatapoint "testnet-deploy net-create-complete=1"
@ -558,10 +558,10 @@ info)
printNode bench-tps "$ipAddress" "$ipAddressPrivate" printNode bench-tps "$ipAddress" "$ipAddressPrivate"
done done
for i in $(seq 0 $(( ${#apiIpList[@]} - 1)) ); do for i in $(seq 0 $(( ${#blockstreamerIpList[@]} - 1)) ); do
ipAddress=${apiIpList[$i]} ipAddress=${blockstreamerIpList[$i]}
ipAddressPrivate=${apiIpListPrivate[$i]} ipAddressPrivate=${blockstreamerIpListPrivate[$i]}
printNode api "$ipAddress" "$ipAddressPrivate" printNode blockstreamer "$ipAddress" "$ipAddressPrivate"
done done
;; ;;
*) *)

View File

@ -358,9 +358,9 @@ start() {
declare bootstrapLeader=true declare bootstrapLeader=true
declare nodeType=fullnode declare nodeType=fullnode
for ipAddress in "${fullnodeIpList[@]}" - "${apiIpList[@]}"; do for ipAddress in "${fullnodeIpList[@]}" - "${blockstreamerIpList[@]}"; do
if [[ $ipAddress = - ]]; then if [[ $ipAddress = - ]]; then
nodeType=apinode nodeType=blockstreamer
continue continue
fi fi
if $updateNodes; then if $updateNodes; then
@ -445,7 +445,7 @@ start() {
echo echo
echo "+++ Deployment Successful" echo "+++ Deployment Successful"
echo "Bootstrap leader deployment took $bootstrapNodeDeployTime seconds" echo "Bootstrap leader deployment took $bootstrapNodeDeployTime seconds"
echo "Additional fullnode deployment (${#fullnodeIpList[@]} full nodes, ${#apiIpList[@]} api nodes) took $additionalNodeDeployTime seconds" echo "Additional fullnode deployment (${#fullnodeIpList[@]} full nodes, ${#blockstreamerIpList[@]} blockstreamer nodes) took $additionalNodeDeployTime seconds"
echo "Client deployment (${#clientIpList[@]} instances) took $clientDeployTime seconds" echo "Client deployment (${#clientIpList[@]} instances) took $clientDeployTime seconds"
echo "Network start logs in $netLogDir:" echo "Network start logs in $netLogDir:"
ls -l "$netLogDir" ls -l "$netLogDir"
@ -480,7 +480,7 @@ stop() {
SECONDS=0 SECONDS=0
$metricsWriteDatapoint "testnet-deploy net-stop-begin=1" $metricsWriteDatapoint "testnet-deploy net-stop-begin=1"
for ipAddress in "${fullnodeIpList[@]}" "${apiIpList[@]}" "${clientIpList[@]}"; do for ipAddress in "${fullnodeIpList[@]}" "${blockstreamerIpList[@]}" "${clientIpList[@]}"; do
stopNode "$ipAddress" stopNode "$ipAddress"
done done
@ -529,7 +529,7 @@ logs)
for ipAddress in "${clientIpList[@]}"; do for ipAddress in "${clientIpList[@]}"; do
fetchRemoteLog "$ipAddress" client fetchRemoteLog "$ipAddress" client
done done
for ipAddress in "${apiIpList[@]}"; do for ipAddress in "${blockstreamerIpList[@]}"; do
fetchRemoteLog "$ipAddress" fullnode fetchRemoteLog "$ipAddress" fullnode
done done
;; ;;

View File

@ -169,7 +169,7 @@ local|tar)
./multinode-demo/bootstrap-leader.sh $maybeNoLeaderRotation > bootstrap-leader.log 2>&1 & ./multinode-demo/bootstrap-leader.sh $maybeNoLeaderRotation > bootstrap-leader.log 2>&1 &
ln -sTf bootstrap-leader.log fullnode.log ln -sTf bootstrap-leader.log fullnode.log
;; ;;
fullnode|apinode) fullnode|blockstreamer)
net/scripts/rsync-retry.sh -vPrc "$entrypointIp":~/.cargo/bin/ ~/.cargo/bin/ net/scripts/rsync-retry.sh -vPrc "$entrypointIp":~/.cargo/bin/ ~/.cargo/bin/
if [[ -e /dev/nvidia0 && -x ~/.cargo/bin/solana-fullnode-cuda ]]; then if [[ -e /dev/nvidia0 && -x ~/.cargo/bin/solana-fullnode-cuda ]]; then
@ -181,7 +181,7 @@ local|tar)
if ! $leaderRotation; then if ! $leaderRotation; then
args+=("--no-leader-rotation") args+=("--no-leader-rotation")
fi fi
if [[ $nodeType = apinode ]]; then if [[ $nodeType = blockstreamer ]]; then
args+=( args+=(
--blockstream /tmp/solana-blockstream.sock --blockstream /tmp/solana-blockstream.sock
--no-signer --no-signer
@ -193,7 +193,7 @@ local|tar)
./multinode-demo/setup.sh -t fullnode $setupArgs ./multinode-demo/setup.sh -t fullnode $setupArgs
fi fi
if [[ $nodeType = apinode ]]; then if [[ $nodeType = blockstreamer ]]; then
npm install @solana/blockexplorer@1 npm install @solana/blockexplorer@1
npx solana-blockexplorer > blockexplorer.log 2>&1 & npx solana-blockexplorer > blockexplorer.log 2>&1 &
fi fi

View File

@ -63,11 +63,11 @@ else
done done
fi fi
echo echo
echo API nodes: echo Blockstreamers:
if [[ ${#apiIpList[@]} -eq 0 ]]; then if [[ ${#blockstreamerIpList[@]} -eq 0 ]]; then
echo " None" echo " None"
else else
for ipAddress in "${apiIpList[@]}"; do for ipAddress in "${blockstreamerIpList[@]}"; do
printNode fullnode "$ipAddress" printNode fullnode "$ipAddress"
done done
fi fi