AWS AMIs are region specific
This commit is contained in:
parent
038a46b5ef
commit
2ef8ebe111
50
net/gce.sh
50
net/gce.sh
|
@ -11,13 +11,6 @@ gce)
|
||||||
# shellcheck source=net/scripts/gce-provider.sh
|
# shellcheck source=net/scripts/gce-provider.sh
|
||||||
source "$here"/scripts/gce-provider.sh
|
source "$here"/scripts/gce-provider.sh
|
||||||
|
|
||||||
cpuImageName="ubuntu-1804-bionic-v20181029 --image-project ubuntu-os-cloud"
|
|
||||||
|
|
||||||
# TODO: GPU image is still 16.04-based pending resolution of
|
|
||||||
# https://github.com/solana-labs/solana/issues/1702
|
|
||||||
gpuImageName="ubuntu-16-04-cuda-9-2-new"
|
|
||||||
imageName=$cpuImageName
|
|
||||||
|
|
||||||
cpuLeaderMachineType=n1-standard-16
|
cpuLeaderMachineType=n1-standard-16
|
||||||
gpuLeaderMachineType="$cpuLeaderMachineType --accelerator count=4,type=nvidia-tesla-k80"
|
gpuLeaderMachineType="$cpuLeaderMachineType --accelerator count=4,type=nvidia-tesla-k80"
|
||||||
leaderMachineType=$cpuLeaderMachineType
|
leaderMachineType=$cpuLeaderMachineType
|
||||||
|
@ -28,11 +21,6 @@ ec2)
|
||||||
# shellcheck source=net/scripts/ec2-provider.sh
|
# shellcheck source=net/scripts/ec2-provider.sh
|
||||||
source "$here"/scripts/ec2-provider.sh
|
source "$here"/scripts/ec2-provider.sh
|
||||||
|
|
||||||
# Deep Learning AMI (Ubuntu 16.04-based)
|
|
||||||
cpuImageName="ami-0466e26ccc0e752c1"
|
|
||||||
gpuImageName="$cpuImageName"
|
|
||||||
imageName=$cpuImageName
|
|
||||||
|
|
||||||
cpuLeaderMachineType=m4.4xlarge
|
cpuLeaderMachineType=m4.4xlarge
|
||||||
gpuLeaderMachineType=p2.xlarge
|
gpuLeaderMachineType=p2.xlarge
|
||||||
leaderMachineType=$cpuLeaderMachineType
|
leaderMachineType=$cpuLeaderMachineType
|
||||||
|
@ -129,12 +117,10 @@ while getopts "h?p:Pn:c:z:gG:a:d:" opt; do
|
||||||
g)
|
g)
|
||||||
enableGpu=true
|
enableGpu=true
|
||||||
leaderMachineType=$gpuLeaderMachineType
|
leaderMachineType=$gpuLeaderMachineType
|
||||||
imageName=$gpuImageName
|
|
||||||
;;
|
;;
|
||||||
G)
|
G)
|
||||||
enableGpu=true
|
enableGpu=true
|
||||||
leaderMachineType="$OPTARG"
|
leaderMachineType="$OPTARG"
|
||||||
imageName=$gpuImageName
|
|
||||||
;;
|
;;
|
||||||
a)
|
a)
|
||||||
leaderAddress=$OPTARG
|
leaderAddress=$OPTARG
|
||||||
|
@ -143,7 +129,7 @@ while getopts "h?p:Pn:c:z:gG:a:d:" opt; do
|
||||||
bootDiskType=$OPTARG
|
bootDiskType=$OPTARG
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
usage "Error: unhandled option: $opt"
|
usage "unhandled option: $opt"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
@ -152,6 +138,38 @@ shift $((OPTIND - 1))
|
||||||
[[ -z $1 ]] || usage "Unexpected argument: $1"
|
[[ -z $1 ]] || usage "Unexpected argument: $1"
|
||||||
sshPrivateKey="$netConfigDir/id_$prefix"
|
sshPrivateKey="$netConfigDir/id_$prefix"
|
||||||
|
|
||||||
|
case $cloudProvider in
|
||||||
|
gce)
|
||||||
|
if $enableGpu; then
|
||||||
|
imageName="ubuntu-1804-bionic-v20181029 --image-project ubuntu-os-cloud"
|
||||||
|
else
|
||||||
|
# TODO: GPU image is still 16.04-based pending resolution of
|
||||||
|
# https://github.com/solana-labs/solana/issues/1702
|
||||||
|
imageName="ubuntu-16-04-cuda-9-2-new"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
ec2)
|
||||||
|
# Deep Learning AMI (Ubuntu 16.04-based)
|
||||||
|
case $region in # (region global variable is set by cloud_SetZone)
|
||||||
|
us-east-1)
|
||||||
|
imageName="ami-047daf3f2b162fc35"
|
||||||
|
;;
|
||||||
|
us-west-1)
|
||||||
|
imageName="ami-08c8c7c4a57a6106d"
|
||||||
|
;;
|
||||||
|
us-west-2)
|
||||||
|
imageName="ami-0b63040ee445728bf"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage "Unsupported region: $region"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Error: Unknown cloud provider: $cloudProvider"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
# cloud_ForEachInstance [cmd] [extra args to cmd]
|
# cloud_ForEachInstance [cmd] [extra args to cmd]
|
||||||
#
|
#
|
||||||
|
@ -245,7 +263,7 @@ EOF
|
||||||
IFS=: read -r leaderName leaderIp _ < <(echo "${instances[0]}")
|
IFS=: read -r leaderName leaderIp _ < <(echo "${instances[0]}")
|
||||||
|
|
||||||
# Try to ping the machine first.
|
# Try to ping the machine first.
|
||||||
timeout 60s bash -c "set -o pipefail; until ping -c 3 $leaderIp | tr - _; do echo .; done"
|
timeout 90s bash -c "set -o pipefail; until ping -c 3 $leaderIp | tr - _; do echo .; done"
|
||||||
|
|
||||||
if [[ ! -r $sshPrivateKey ]]; then
|
if [[ ! -r $sshPrivateKey ]]; then
|
||||||
echo "Fetching $sshPrivateKey from $leaderName"
|
echo "Fetching $sshPrivateKey from $leaderName"
|
||||||
|
|
Loading…
Reference in New Issue