Compute Engine

IAM role

Monitoring

CPU utilization and Network Bytes

Startup scripts

Used in https://google.qwiklabs.com/focuses/3391 - Machine Learning with Tensorflow

#!/bin/bash
export ZONE=us-central1-a
export PROJECT_ID=$\(gcloud info --format='value(config.project)') 
export BUCKET=$PROJECT_ID  
gsutil mb gs://$BUCKET
bq --location=US mk --project_id $PROJECT_ID flights
gsutil cp gs://sureskills-ql/data-science-on-gcp/flights/tzcorr/tzcorr.json tzcorr.json
gsutil -m cp gs://sureskills-ql/data-science-on-gcp/flights/tzcorr/all_flights-* gs://$BUCKET/flights/tzcorr
bq --location=US load --replace flights.tzcorr gs://sureskills-ql/data-science-on-gcp/flights/tzcorr/all_flights-* tzcorr.json
gsutil cp gs://sureskills-ql/data-science-on-gcp/flights/trainday/trainday_schema.json trainday_schema.json
gsutil -m cp gs://sureskills-ql/data-science-on-gcp/flights/trainday/* gs://$BUCKET/flights/trainday/
bq --location=US load flights.trainday gs://$BUCKET/flights/trainday/trainday.csv trainday_schema.json
gsutil -m cp gs://sureskills-ql/data-science-on-gcp/flights/trainday.csv gs://$BUCKET/flights/trainday.csv
gsutil cp gs://sureskills-ql/data-science-on-gcp/flights/bigquery/flights.simevents.schema flights.simevents.schema
gsutil cp gs://sureskills-ql/data-science-on-gcp/flights/chapter8/pom.xml gs://$BUCKET/flights/chapter8/
gsutil cp gs://sureskills-ql/data-science-on-gcp/flights/chapter8/output/* gs://$BUCKET/flights/chapter8/output/
gsutil cp gs://sureskills-ql/data-science-on-gcp/flights/chapter9/linear-model.tar.gz gs://$BUCKET/flights/chapter9/
bq --location=US load --replace --source_format=NEWLINE_DELIMITED_JSON flights.simevents gs://sureskills-ql/data-science-on-gcp/flights/bigquery/short-simevents-*.json flights.simevents.schema

# DEFAULT ML SA WORKAROUND
if [[ $(gcloud services list | grep 'AI Platform') ]] && [[ $(gcloud projects get-iam-policy qwiklabs-gcp-01-cdd1bc83923f | grep 'cloud-ml') ]]; then
  echo "Service Account already exists!"
else
  gcloud services disable ml.googleapis.com --force
  gcloud services enable ml.googleapis.com
fi

vs App Engine

OS Login

.https://cloud.google.com/compute/docs/oslogin/troubleshoot-os-login

Troubleshooting for compute engine.

Last updated

Was this helpful?