Lab 1: Environment Setup

caution

You are viewing this lab from the handbook. This lab is meant to be loaded as Cloud Shell tutorial. Please see the labs section on how to do so.

In this lab we will set up your environment, download the data set for this Bootkon, put it to Cloud Storage, and do a few other things.

Enable services

First, we need to enable some Google Cloud Platform (GCP) services. Enabling GCP services is necessary to access and use the resources and capabilities associated with those services. Each GCP service provides a specific set of features for managing cloud infrastructure, data, AI models, and more. Enabling them takes a few minutes.

Assign permissions

Execute the following script:

bk-bootstrap

But what did it do? Let’s ask Gemini while it is running.

  1. Open bk-bootstrap.

  2. Open Gemini Code Assist

  3. Insert What does bk-bootstrap do? into the Gemini prompt.

Cloud Shell may ask you to select your project and enable the API. Do not worry about missing licenses.

Download data

Next, we download the data set for Bootkon and put it into Cloud Storage. Before we do that, we create a bucket where we place the data into. Let’s name it <PROJECT_ID>-bucket:

gsutil mb -l $REGION gs://<PROJECT_ID>-bucket

The next command will download the dataset from GitHub and extract it to Cloud Shell:

wget -qO - https://github.com/fhirschmann/bootkon-data/releases/download/v1.7.1/data.tar.gz | tar xvzf -

Let’s upload the data to the bucket we just created:

gsutil -m cp -R data gs://<PROJECT_ID>-bucket/

Is the data there? Let’s check and open Cloud Storage. Once you have checked, you may need to resize the window that just opened to make it smaller in case you run out of screen real estate.

Create default VPC

The Google Cloud environment we created for you does not come with a Virtual Private Cloud (VPC) network created by default. Let’s create one. If it already exists – that’s ok.

gcloud compute networks create default --project=$PROJECT_ID --subnet-mode=auto --bgp-routing-mode="regional"

Let’s also create/update the subnet to allow internal traffic:

gcloud compute networks subnets update default --region=$REGION --enable-private-ip-google-access

If the command above returned an error about a visibility check, please wait two minutes for the permissions to propagate and try again.

Next, create a firewall rule:

gcloud compute firewall-rules create "default-allow-all-internal" \
    --network="default" \
    --project=$PROJECT_ID \
    --direction=INGRESS \
    --priority=65534 \
    --source-ranges="10.128.0.0/9" \
    --allow=tcp:0-65535,udp:0-65535,icmp

Success

🎉 Congratulations! You’ve officially leveled up from “cloud-curious” to “GCP aware”! 🌩️🚀

aaa