Maximize learning and build a reusable code repository with Google Cloud Skills Boost Quests and Challenge Labs
One of the best things about Google Cloud is the pace of innovation and growth — with new features and solutions made available seemingly on a daily basis. As a technology professional, it can be difficult keeping up — which is why it’s important to have a growth mindset and be continually learning by participating in workshops, trainings, and hands-on labs through Qwiklabs and Google Cloud Skills Boost.
Since 2020, I’ve committed to learning a new skill or solution each month — setting aside a few hours a week to participate in online training through Coursera, Qwiklabs, and Google Cloud Skills Boost. Each platform gives you the opportunity to earn micro-credentials in the form of completion certificates, skills badges, and ultimately prepares you to obtain professional level certification such as the Google Certified Professional Cloud Architect or Amazon Certified Digital Leader. The credentials with the most rigorous knowledge-test or exam are often the most valued.
While working through various solution-specific Quests on Skills Boost, I found myself struggling with the final Challenge Lab — which requires the learner to come up with the steps required to solve a real-world problem using Google Cloud — with only the bare-minimum information provided. Unlike most online courses or exams — which are often multiple choice — Challenge Labs are hands-on and require the learner to identify the solution and configuration to solve the challenge.
Preparing for Challenge Labs
The best way to prepare for a Challenge Lab is by completing the prerequisite course work and guided labs. Mosts Skills Boost Quests contain 2–4 guided labs where your are walked through the hands-on steps required to complete certain tasks. In most cases, you’ll be guided through completing the same steps using the GCP console as well as through the Cloud Shell using the gcloud command found in the Cloud SDK.
Take Note! Cloud SDK code samples will help you solve future tasks!
When completing guided labs, keep a copy of the Cloud SDK commands used to solve the various tasks that you’ve been presented. I’ve found that creating a Github repo for the labs that I have completed is a great way to store these code samples for easy access — more on that later!
Before you attempt the Challenge Lab — Do this first!
Read through the entire lab
Challenge labs are timed, which could result in you speeding through the lab without taking the time to research and understand the solution to each section. Instead of clicking the Start Lab button and jumping right in, take time to read through the lab first. All Qwiklabs and Skills Boost labs give you the option of reading the entire lab before attempting it. While some challenge labs may obfuscate and randomize certain variables- making them available only when you start the lab — there are ways to prepare for the lab in advance.
Create a folder for the lab
Whether or not you decide to use Github or a code repo, you can start by creating a folder on your local machine for each lab where you can store the code that we’ll create to solve each lab. I like to name the folder something unambiguous — such as the lab ID.
Create a variables file
In the folder that you just created for the lab, create a file called variables.inc. We’ll use this file to capture any variables that will be necessary to automate some of the lab tasks — such as the PROJECT_ID, REGION, names for database, machine, GCS buckets, or other GCP resources, as well as other variables that we may need to construct such as PROJECT_NUM, ServiceAccount names, or certain paths. Some commands that I have found helpful to construct variables are listed below:
PROJECT_ID=`gcloud config get-value project`
PROJ_NUM=$( gcloud projects describe $PROJECT_ID --format 'value(projectNumber)' )
Create a bash script for each section
Challenge Labs are broken into sections. At the end of each section, there will be a Check my progress button to validate that you have completed the previous section according to the requirements. Now is your chance to scroll through the section and create the Cloud SDK commands to satisfy each requirement or task. This is also your opportunity to refer back to the Guided Labs that you’ve already completed and the code samples that you have recorded. Can you reuse this code or do you need to dig deeper in the documentation to complete the requirement?
For example, I recently completed a lab where I needed to create 3 GCS storage buckets in section 1 of the lab. I created a file called 01.sh that looked something like this:
#!/bin/bash
source variables.inc
# Task 1 - Create Cloud Storage Buckets
#GCS_DATA=
#REGION_DATA=$LAB_REGION
#GCS_CONFIG=
#REGION_CONFIG=$LAB_REGION
#GCS_TEMP=
#REGION_TEMP=$LAB_REGION
gsutil mb -l $REGION_DATA gs://${GCS_DATA}
gsutil mb -l $REGION_CONFIG gs://${GCS_CONFIG}
gsutil mb -l $REGION_TEMP gs://${GCS_TEMP}
I like to paste the names of the variables that I defined in variables.inc — which I quickly comment out with a #. When this script runs, it starts by gathering all of the variables that I’ve defined in variables.inc and then runs 3 Cloud SDK commands to create 3 GCS buckets in the appropriate REGION using the gsutil command.
Repeat the process for the remaining sections of the lab. Be sure to include comments and links to any reference material that you used to create the commands in each section. Not only will that make it easier for you to find the code samples that you’ve created in the future, but will serve as a way for you to quickly find the related documentation if you need to adjust the command.
Store your code in a Repo
Not only is storing your code in a repo a good idea to protect it from accidentally getting deleted from your laptop or local machine, but it also serves as a way to quickly access your code from the Cloud Shell using a simple git command when completing labs. I’ve adopted the practice of creating a new Github repo for each Challenge or Learning Path that I attempt. For example, during Google NEXT, I participated in the NEXT Clout Challenge. My repo of solutions is available here: https://github.com/cloud-jake/google-clout-next22-edition
TL;DR — Save solutions to Skills Boost Labs for Future Reference
Since I’ve started saving these solutions, I’ve referred back to them countless times. Not only has it made my job easier, but I’ve also learned a number of quick-tricks for solving common challenges.
Bonus Content
Want to sharpen your Google Cloud skills? Check out the Google Cloud Arcade: https://go.qwiklabs.com/arcade
The Google Cloud Arcade provides challenges several times per year that will not only help sharpen your GCP skills, but will introduce you to new products and features that you may not ordinarily come across on a daily basis. Check it out!!