Throughout this game, you will be using a number of different tools and products within Google Cloud. Our focus in this first challenge will be installing the necessary technologies in your Google Cloud environment to ensure your success throughout the hack.
export PROJECT_NAME="YOUR_PROJECT_NAME"
export PROJECT_ID="YOUR_PROJECT_ID"
export PROJECT_NUMBER="YOUR_PROJECT_NUMBER"
export BUCKET_NAME="${PROJECT_ID}-oracle_retail"
YOUR_PROJECT_NAME: the name of your projectYOUR_PROJECT_ID: the ID of your projectYOUR_PROJECT_NUMBER: the number of your project gcloud config set project ${PROJECT_ID}
git clone \
https://github.com/caugusto/datastream-bqml-looker-tutorial.git
bunzip2 \
datastream-bqml-looker-tutorial/sample_data/oracle_data.csv.bz2
cd datastream-bqml-looker-tutorial/build_docker
./build_orcl.sh \
-p <YOUR_PROJECT_ID> \
-z <GCP_ZONE> \
-n <GCP_NETWORK_NAME> \
-s <GCP_SUBNET_NAME> \
-f Y \
-d Y
YOUR_PROJECT_ID: Your Cloud project IDGCP_ZONE: The zone where the compute instance will be createdGCP_NETWORK_NAME: The network name where VM and firewall entries will be createdGCP_SUBNET_NAME: The network subnet where VM and firewall entries will be createdY or N: A choice to create the FastFresh schema and ORDERS table (Y or N). Use Y for this tutorial.Y or N: A choice to configure the Oracle Database for Datastream usage (Y or N). Use Y for this tutorial.build_orcl.sh script gives you a summary of the connection details and credentials (DB Host, DB Port, and SID). Make a copy of these details because you use them later in this tutorial. gsutil mb gs://${BUCKET_NAME}
Make a copy of the bucket name because you use it in a later step.
gsutil notification create -t projects/${PROJECT_ID}/topics/oracle_retail -f \
json gs://${BUCKET_NAME}
This command creates a new topic called oracle_retail which sends notifications about object changes to the Pub/Sub topic.
gcloud pubsub subscriptions create oracle_retail_sub \
--topic=projects/${PROJECT_ID}/topics/oracle_retail
This command creates a Pub/Sub subscription to receive messages which are sent to the oracle_retail topic.
retail:
bq mk --dataset ${PROJECT_ID}:retail
gcloud projects add-iam-policy-binding ${PROJECT_ID} \
--member=serviceAccount:${PROJECT_NUMBER}-compute@developer.gserviceaccount.com \
--role='roles/bigquery.admin'
NOTE: When you finish this tutorial, you can avoid continued billing by deleting the resources you created. See cleaning up for more detail.