Last active
March 15, 2021 02:09
-
-
Save takada-at/397dc62d9f09eedcd2e8b85355c096d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CMDNAME=`basename $0` | |
if [ $# -ne 1 ]; then | |
echo "Usage: $CMDNAME account" 1>&2 | |
exit 1 | |
fi | |
ACCOUNT=$1 | |
ZONE=us-west1-b | |
cat <<EOF | |
ACCOUNT=${ACCOUNT} | |
ZONE=${ZONE} | |
EOF | |
echo "create service account" | |
# create service account | |
gcloud --project pj-kec4 iam service-accounts create ${ACCOUNT}-service-account | |
SERVICE_ACCOUNT=${ACCOUNT}[email protected] | |
echo "create notebook" | |
# create notebook | |
gcloud --project pj-kec4 beta notebooks instances create ${ACCOUNT}-instance --location ${ZONE} \ | |
--container-repository gcr.io/deeplearning-platform-release/tf-gpu.1-14 \ | |
--container-tag latest \ | |
--service-account ${SERVICE_ACCOUNT} \ | |
--machine-type n1-standard-8 \ | |
--accelerator-core-count 1 --accelerator-type NVIDIA_TESLA_K80 --install-gpu-driver | |
gcloud --project pj-kec4 compute instances stop ${ACCOUNT}-instance --zone ${ZONE} | |
gcloud --project pj-kec4 compute instances update ${ACCOUNT}-instance --zone ${ZONE} --enable-display-device | |
gcloud --project pj-kec4 compute instances start ${ACCOUNT}-instance --zone ${ZONE} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment