diff --git a/net/gce.sh b/net/gce.sh index 5114641921..2a860d3e9f 100755 --- a/net/gce.sh +++ b/net/gce.sh @@ -12,7 +12,7 @@ gce) # shellcheck source=net/scripts/gce-provider.sh source "$here"/scripts/gce-provider.sh - cpuBootstrapLeaderMachineType="--custom-cpu 24 --custom-memory 64GB --min-cpu-platform Intel%20Skylake" + cpuBootstrapLeaderMachineType="--custom-cpu 24 --min-cpu-platform Intel%20Skylake" gpuBootstrapLeaderMachineType="$cpuBootstrapLeaderMachineType --accelerator count=1,type=nvidia-tesla-p100" clientMachineType="--custom-cpu 16 --custom-memory 20GB" blockstreamerMachineType="--machine-type n1-standard-8" @@ -283,16 +283,6 @@ while getopts "h?p:Pn:c:r:z:gG:a:d:uxf" opt "${shortArgs[@]}"; do esac done -if [[ -n "$customMachineType" ]] ; then - bootstrapLeaderMachineType="$customMachineType" -elif [[ "$enableGpu" = "true" ]] ; then - bootstrapLeaderMachineType="$gpuBootstrapLeaderMachineType" -else - bootstrapLeaderMachineType="$cpuBootstrapLeaderMachineType" -fi -validatorMachineType=$bootstrapLeaderMachineType -blockstreamerMachineType=$bootstrapLeaderMachineType - [[ ${#zones[@]} -gt 0 ]] || zones+=("$(cloud_DefaultZone)") [[ -z $1 ]] || usage "Unexpected argument: $1" @@ -307,6 +297,9 @@ fi case $cloudProvider in gce) + customMemoryGB="$(cloud_DefaultCustomMemoryGB)" + cpuBootstrapLeaderMachineType+=" --custom-memory ${customMemoryGB}GB" + gpuBootstrapLeaderMachineType+=" --custom-memory ${customMemoryGB}GB" ;; ec2|azure|colo) if [[ -n $validatorAdditionalDiskSizeInGb ]] ; then @@ -338,6 +331,16 @@ if [[ -n $reclaimAllReservations || -n $reclaimOnlyPreemptibleReservations ]]; t forceDelete="true" fi +if [[ -n "$customMachineType" ]] ; then + bootstrapLeaderMachineType="$customMachineType" +elif [[ "$enableGpu" = "true" ]] ; then + bootstrapLeaderMachineType="$gpuBootstrapLeaderMachineType" +else + bootstrapLeaderMachineType="$cpuBootstrapLeaderMachineType" +fi +validatorMachineType=$bootstrapLeaderMachineType +blockstreamerMachineType=$bootstrapLeaderMachineType + # cloud_ForEachInstance [cmd] [extra args to cmd] # # Execute a command for each element in the `instances` array diff --git a/net/scripts/azure-provider.sh b/net/scripts/azure-provider.sh index b6597c120e..e4d2c2bad2 100755 --- a/net/scripts/azure-provider.sh +++ b/net/scripts/azure-provider.sh @@ -8,6 +8,10 @@ cloud_DefaultZone() { echo "westus" } +cloud_DefaultCustomMemoryGB() { + : # Not implemented +} + cloud_RestartPreemptedInstances() { : # Not implemented } diff --git a/net/scripts/colo-provider.sh b/net/scripts/colo-provider.sh index b16a6754fd..c0a58821c8 100755 --- a/net/scripts/colo-provider.sh +++ b/net/scripts/colo-provider.sh @@ -17,6 +17,10 @@ cloud_DefaultZone() { echo "Denver" } +cloud_DefaultCustomMemoryGB() { + : # Not implemented +} + cloud_RestartPreemptedInstances() { : # Not implemented } diff --git a/net/scripts/ec2-provider.sh b/net/scripts/ec2-provider.sh index f7acf33499..365b8119b9 100755 --- a/net/scripts/ec2-provider.sh +++ b/net/scripts/ec2-provider.sh @@ -7,6 +7,10 @@ cloud_DefaultZone() { echo "us-east-1b" } +cloud_DefaultCustomMemoryGB() { + : # Not implemented +} + cloud_RestartPreemptedInstances() { : # Not implemented } diff --git a/net/scripts/gce-provider.sh b/net/scripts/gce-provider.sh index 9f76cf020b..dbedcea864 100755 --- a/net/scripts/gce-provider.sh +++ b/net/scripts/gce-provider.sh @@ -8,6 +8,10 @@ cloud_DefaultZone() { echo "us-west1-b" } +cloud_DefaultCustomMemoryGB() { + echo 64 +} + # # cloud_RestartPreemptedInstances [namePrefix] #