This file contains 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
#!/usr/bin/env bash | |
# https://cloud.google.com/anthos/gke/docs/aws/how-to/connecting-to-a-cluster | |
# from setup-02-mgmt.sh | |
unset HTTP_PROXY # reset | |
export NODE_KEY_PATH=$(PWD)/node-key.json | |
export GOOGLE_APPLICATION_CREDENTIALS=$NODE_KEY_PATH | |
# make sure bastion_tunnel.sh is running |
This file contains 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
#!/usr/bin/env bash | |
# https://cloud.google.com/anthos/gke/docs/aws/how-to/creating-user-cluster | |
# from setup-02-mgmt.sh | |
unset HTTP_PROXY # reset | |
export NODE_KEY_PATH=$(PWD)/node-key.json | |
export GOOGLE_APPLICATION_CREDENTIALS=$NODE_KEY_PATH | |
# create example user cluster config |
This file contains 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
#!/usr/bin/env bash | |
# Docs: https://cloud.google.com/anthos/gke/docs/aws/how-to/prerequisites | |
# NOTE: MUST have `jq` installed for JSON parsing to set ENV vars | |
export PROJECT_ID=$(gcloud config get-value project) | |
export PROJECT_OWNER=$(gcloud config get-value core/account) # set orig val | |
# confirm aws CLI working | |
aws --version |
This file contains 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
#!/usr/bin/env bash | |
# https://cloud.google.com/appengine/docs/standard/python3/quickstart | |
export PROJECT_ID="mike-gae-custom-tls" | |
export PROJECT_USER=$(gcloud config get-value core/account) # set current user | |
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)") | |
export GAE_SA="${PROJECT_NUMBER}@cloudbuild.gserviceaccount.com" | |
export POLICY_NAME="pci-policy" |
This file contains 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
terraform { | |
required_providers { | |
google = { | |
source = "hashicorp/google" | |
version = ">= 3.37" | |
} | |
google-beta = { | |
source = "hashicorp/google-beta" | |
version = ">= 3.37" | |
} |
This file contains 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
#!/usr/bin/env bash | |
# set vars | |
export PROJECT_ID=$(gcloud config get-value project) | |
export PROJECT_USER=$(gcloud config get-value core/account) # set current user | |
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)") | |
export IDNS=${PROJECT_ID}.svc.id.goog # workflow identity domain | |
export REGION="us-central1" | |
export ZONE="us-central1-a" |
This file contains 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
#!/usr/bin/env bash | |
##################################################### | |
# SETUP (OPTIONAL) | |
# | |
# Note: this code is not meant to just run; | |
# copy and paste snippets as you go. | |
##################################################### | |
export PROJECT_ID=$(gcloud config get-value project) |
This file contains 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
#!/usr/bin/env bash | |
export ORG_ID="CHANGEME" | |
export PROJECT_ID=$(gcloud config get-value project) | |
export PROJECT_USER=$(gcloud config get-value core/account) # set current user | |
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)") | |
export IDNS=${PROJECT_ID}.svc.id.goog # workflow identity domain | |
export DATA_SA_NAME="data-viewer" | |
export DATA_SA_ID="${DATA_SA_NAME}@${PROJECT_ID}.iam.gserviceaccount.com" |
This file contains 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
#!/usr/bin/env bash | |
export ORG_ID="CHANGEME" | |
export PROJECT_ID=$(gcloud config get-value project) | |
export PROJECT_USER=$(gcloud config get-value core/account) # set current user | |
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)") | |
export IDNS=${PROJECT_ID}.svc.id.goog # workflow identity domain | |
export DATA_SA_NAME="data-viewer" | |
export DATA_SA_ID="${DATA_SA_NAME}@${PROJECT_ID}.iam.gserviceaccount.com" |
This file contains 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
from joblib import dump, load | |
# save your model (assume you created the function) | |
dump(my_model, 'model.joblib') # saves local file model.joblib | |
# load model file later to use for prediction | |
classifier = load('model.joblib') | |
# model.predict is a function and features are parameters | |
prediction = classifier.predict(features) # returns prediction |