Allow testnet creation with no validator nodes (#3846)
This commit is contained in:
parent
a2c8e3952f
commit
d0fb55d9b1
50
net/gce.sh
50
net/gce.sh
|
@ -322,16 +322,18 @@ EOF
|
||||||
cloud_ForEachInstance waitForStartupComplete
|
cloud_ForEachInstance waitForStartupComplete
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Looking for additional fullnode instances..."
|
if [[ $additionalFullNodeCount -gt 0 ]]; then
|
||||||
for zone in "${zones[@]}"; do
|
echo "Looking for additional fullnode instances..."
|
||||||
cloud_FindInstances "$prefix-$zone-fullnode"
|
for zone in "${zones[@]}"; do
|
||||||
[[ ${#instances[@]} -gt 0 ]] || {
|
cloud_FindInstances "$prefix-$zone-fullnode"
|
||||||
echo "Unable to find additional fullnodes"
|
[[ ${#instances[@]} -gt 0 ]] || {
|
||||||
exit 1
|
echo "Unable to find additional fullnodes"
|
||||||
}
|
exit 1
|
||||||
cloud_ForEachInstance recordInstanceIp fullnodeIpList
|
}
|
||||||
cloud_ForEachInstance waitForStartupComplete
|
cloud_ForEachInstance recordInstanceIp fullnodeIpList
|
||||||
done
|
cloud_ForEachInstance waitForStartupComplete
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
if $externalNodes; then
|
if $externalNodes; then
|
||||||
echo "Let's not reset the current client configuration"
|
echo "Let's not reset the current client configuration"
|
||||||
|
@ -510,20 +512,22 @@ EOF
|
||||||
"$startupScript" "$bootstrapLeaderAddress" "$bootDiskType"
|
"$startupScript" "$bootstrapLeaderAddress" "$bootDiskType"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
num_zones=${#zones[@]}
|
if [[ $additionalFullNodeCount -gt 0 ]]; then
|
||||||
numNodesPerZone=$((additionalFullNodeCount / num_zones))
|
num_zones=${#zones[@]}
|
||||||
numLeftOverNodes=$((additionalFullNodeCount % num_zones))
|
numNodesPerZone=$((additionalFullNodeCount / num_zones))
|
||||||
for ((i=0; i < "$num_zones"; i++)); do
|
numLeftOverNodes=$((additionalFullNodeCount % num_zones))
|
||||||
zone=${zones[i]}
|
for ((i=0; i < "$num_zones"; i++)); do
|
||||||
if [[ $i -eq $((num_zones - 1)) ]]; then
|
zone=${zones[i]}
|
||||||
numNodesPerZone=$((numNodesPerZone + numLeftOverNodes))
|
if [[ $i -eq $((num_zones - 1)) ]]; then
|
||||||
fi
|
numNodesPerZone=$((numNodesPerZone + numLeftOverNodes))
|
||||||
cloud_CreateInstances "$prefix" "$prefix-$zone-fullnode" "$numNodesPerZone" \
|
fi
|
||||||
"$enableGpu" "$fullNodeMachineType" "$zone" "$fullNodeBootDiskSizeInGb" \
|
cloud_CreateInstances "$prefix" "$prefix-$zone-fullnode" "$numNodesPerZone" \
|
||||||
"$startupScript" "" "$bootDiskType" &
|
"$enableGpu" "$fullNodeMachineType" "$zone" "$fullNodeBootDiskSizeInGb" \
|
||||||
done
|
"$startupScript" "" "$bootDiskType" &
|
||||||
|
done
|
||||||
|
|
||||||
wait
|
wait
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $clientNodeCount -gt 0 ]]; then
|
if [[ $clientNodeCount -gt 0 ]]; then
|
||||||
cloud_CreateInstances "$prefix" "$prefix-client" "$clientNodeCount" \
|
cloud_CreateInstances "$prefix" "$prefix-client" "$clientNodeCount" \
|
||||||
|
|
Loading…
Reference in New Issue