From 35e6343d61bb653cd6053a6a48acbc127bbad3d7 Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Thu, 27 Sep 2018 13:42:24 -0700 Subject: [PATCH] Update testnet-deploy script to configure GPUs for leader node (#1379) --- ci/testnet-deploy.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ci/testnet-deploy.sh b/ci/testnet-deploy.sh index 36cdaf9099..fff16ea3fd 100755 --- a/ci/testnet-deploy.sh +++ b/ci/testnet-deploy.sh @@ -4,6 +4,7 @@ cd "$(dirname "$0")"/.. zone= leaderAddress= +leaderMachineType= clientNodeCount=0 validatorNodeCount=10 publicNetwork=false @@ -31,6 +32,7 @@ Deploys a CD testnet -n [number] - Number of validator nodes (default: $validatorNodeCount) -c [number] - Number of client nodes (default: $clientNodeCount) -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 (default: $enableGpu) -a [address] - Set the leader node's external IP address to this GCE address -d - Delete the network @@ -47,7 +49,7 @@ zone=$2 [[ -n $zone ]] || usage "Zone not specified" shift 2 -while getopts "h?p:Pn:c:s:ga:d" opt; do +while getopts "h?p:Pn:c:s:gG:a:d" opt; do case $opt in h | \?) usage @@ -74,6 +76,10 @@ while getopts "h?p:Pn:c:s:ga:d" opt; do g) enableGpu=true ;; + G) + enableGpu=true + leaderMachineType=$OPTARG + ;; a) leaderAddress=$OPTARG ;; @@ -96,7 +102,11 @@ gce_create_args=( ) if $enableGpu; then - gce_create_args+=(-g) + if [[ -z $leaderMachineType ]]; then + gce_create_args+=(-g) + else + gce_create_args+=(-G "$leaderMachineType") + fi fi if $publicNetwork; then