Add update support
This commit is contained in:
@ -10,6 +10,7 @@ bootstrapFullNodeMachineType=
|
|||||||
clientNodeCount=0
|
clientNodeCount=0
|
||||||
additionalFullNodeCount=10
|
additionalFullNodeCount=10
|
||||||
publicNetwork=false
|
publicNetwork=false
|
||||||
|
skipSetup=false
|
||||||
snapChannel=edge
|
snapChannel=edge
|
||||||
tarChannelOrTag=edge
|
tarChannelOrTag=edge
|
||||||
delete=false
|
delete=false
|
||||||
@ -47,6 +48,9 @@ Deploys a CD testnet
|
|||||||
-b - Disable leader rotation
|
-b - Disable leader rotation
|
||||||
-a [address] - Set the bootstrap fullnode's external IP address to this GCE address
|
-a [address] - Set the bootstrap fullnode's external IP address to this GCE address
|
||||||
-d - Delete the network
|
-d - Delete the network
|
||||||
|
-r - Reuse existing node/ledger configuration from a
|
||||||
|
previous |start| (ie, don't run ./mulitnode-demo/setup.sh).
|
||||||
|
|
||||||
|
|
||||||
Note: the SOLANA_METRICS_CONFIG environment variable is used to configure
|
Note: the SOLANA_METRICS_CONFIG environment variable is used to configure
|
||||||
metrics
|
metrics
|
||||||
@ -62,7 +66,7 @@ zone=$3
|
|||||||
[[ -n $zone ]] || usage "Zone not specified"
|
[[ -n $zone ]] || usage "Zone not specified"
|
||||||
shift 3
|
shift 3
|
||||||
|
|
||||||
while getopts "h?p:Pn:c:s:t:gG:a:db" opt; do
|
while getopts "h?p:Pn:c:s:t:gG:a:dbr" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
h | \?)
|
h | \?)
|
||||||
usage
|
usage
|
||||||
@ -113,37 +117,15 @@ while getopts "h?p:Pn:c:s:t:gG:a:db" opt; do
|
|||||||
d)
|
d)
|
||||||
delete=true
|
delete=true
|
||||||
;;
|
;;
|
||||||
|
r)
|
||||||
|
skipSetup=true
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
usage "Error: unhandled option: $opt"
|
usage "Error: unhandled option: $opt"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
create_args=(
|
|
||||||
-a "$bootstrapFullNodeAddress"
|
|
||||||
-c "$clientNodeCount"
|
|
||||||
-n "$additionalFullNodeCount"
|
|
||||||
-p "$netName"
|
|
||||||
-z "$zone"
|
|
||||||
)
|
|
||||||
|
|
||||||
if $enableGpu; then
|
|
||||||
if [[ -z $bootstrapFullNodeMachineType ]]; then
|
|
||||||
create_args+=(-g)
|
|
||||||
else
|
|
||||||
create_args+=(-G "$bootstrapFullNodeMachineType")
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! $leaderRotation; then
|
|
||||||
create_args+=(-b)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if $publicNetwork; then
|
|
||||||
create_args+=(-P)
|
|
||||||
fi
|
|
||||||
|
|
||||||
shutdown() {
|
shutdown() {
|
||||||
exitcode=$?
|
exitcode=$?
|
||||||
|
|
||||||
@ -164,6 +146,7 @@ trap shutdown EXIT INT
|
|||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
if ! $skipSetup; then
|
||||||
echo "--- $cloudProvider.sh delete"
|
echo "--- $cloudProvider.sh delete"
|
||||||
time net/"$cloudProvider".sh delete -z "$zone" -p "$netName"
|
time net/"$cloudProvider".sh delete -z "$zone" -p "$netName"
|
||||||
if $delete; then
|
if $delete; then
|
||||||
@ -171,7 +154,42 @@ if $delete; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "--- $cloudProvider.sh create"
|
echo "--- $cloudProvider.sh create"
|
||||||
|
create_args=(
|
||||||
|
-p "$netName"
|
||||||
|
-z "$zone"
|
||||||
|
-a "$bootstrapFullNodeAddress"
|
||||||
|
-c "$clientNodeCount"
|
||||||
|
-n "$additionalFullNodeCount"
|
||||||
|
)
|
||||||
|
if $enableGpu; then
|
||||||
|
if [[ -z $bootstrapFullNodeMachineType ]]; then
|
||||||
|
create_args+=(-g)
|
||||||
|
else
|
||||||
|
create_args+=(-G "$bootstrapFullNodeMachineType")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! $leaderRotation; then
|
||||||
|
create_args+=(-b)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $publicNetwork; then
|
||||||
|
create_args+=(-P)
|
||||||
|
fi
|
||||||
|
|
||||||
time net/"$cloudProvider".sh create "${create_args[@]}"
|
time net/"$cloudProvider".sh create "${create_args[@]}"
|
||||||
|
else
|
||||||
|
echo "--- $cloudProvider.sh config"
|
||||||
|
config_args=(
|
||||||
|
-p "$netName"
|
||||||
|
-z "$zone"
|
||||||
|
)
|
||||||
|
if $publicNetwork; then
|
||||||
|
config_args+=(-P)
|
||||||
|
fi
|
||||||
|
|
||||||
|
time net/"$cloudProvider".sh config "${config_args[@]}"
|
||||||
|
fi
|
||||||
net/init-metrics.sh -e
|
net/init-metrics.sh -e
|
||||||
|
|
||||||
echo --- net.sh start
|
echo --- net.sh start
|
||||||
@ -188,14 +206,28 @@ if [[ -n $NO_LEDGER_VERIFY ]]; then
|
|||||||
maybeNoLedgerVerify="-o noLedgerVerify"
|
maybeNoLedgerVerify="-o noLedgerVerify"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
maybeSkipSetup=
|
||||||
|
if $skipSetup; then
|
||||||
|
maybeSkipSetup="-r"
|
||||||
|
fi
|
||||||
|
|
||||||
ok=true
|
ok=true
|
||||||
(
|
(
|
||||||
# shellcheck disable=SC2086 # Don't want to double quote maybeRejectExtraNodes
|
op=start
|
||||||
|
# TODO: Enable rolling updates
|
||||||
|
#if $skipSetup; then
|
||||||
|
# op=update
|
||||||
|
#fi
|
||||||
|
|
||||||
if $useTarReleaseChannel; then
|
if $useTarReleaseChannel; then
|
||||||
time net/net.sh start -t "$tarChannelOrTag" $maybeRejectExtraNodes $maybeNoValidatorSanity $maybeNoLedgerVerify
|
deploySource="-t $tarChannelOrTag"
|
||||||
else
|
else
|
||||||
time net/net.sh start -s "$snapChannel" $maybeRejectExtraNodes $maybeNoValidatorSanity $maybeNoLedgerVerify
|
deploySource="-s $snapChannel"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# shellcheck disable=SC2086 # Don't want to double quote maybeRejectExtraNodes
|
||||||
|
time net/net.sh $op $deploySource \
|
||||||
|
$maybeSkipSetup $maybeRejectExtraNodes $maybeNoValidatorSanity $maybeNoLedgerVerify
|
||||||
) || ok=false
|
) || ok=false
|
||||||
|
|
||||||
net/net.sh logs
|
net/net.sh logs
|
||||||
|
Reference in New Issue
Block a user