Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Bash snippet I use to create a temporary GCP project for doing datalab stuff
set -e
PROJECT_SUFFIX=$(cat /dev/random | LC_CTYPE=C tr -dc "a-z0-9" | head -c 5)
# Update gcloud
gcloud components update
gcloud components install beta gsutil bq datalab
# $MY_BILLING_ACCOUNT should be set outside this file. You can find yours with:
# gcloud beta billing accounts list
# Create a new project
gcloud projects create $PROJECT_NAME
# Enable Billing
gcloud beta billing projects link $PROJECT_NAME --billing-account $MY_BILLING_ACCOUNT
sleep 60
# Create the storage bucket
# Set the project
gcloud config set project $PROJECT_NAME
# Create the datalab instance
gcloud services enable
datalab create --zone us-west2-a temp-datalab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.