Checkpoints
Deploy a Public Billing Service
/ 5
Deploy the Frontend Service
/ 5
Deploy a Private Billing Service
/ 10
Create a Billing Service Account
/ 20
Deploy a Billing Service in Production
/ 20
Create a Frontend Service Account
/ 20
Deploy the Frontend Service in Production
/ 20
Serverless Cloud Run Development: Challenge Lab
GSP328
Introduction
In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the quest to figure out how to complete the tasks on your own! An automated scoring system (shown on this page) will provide feedback on whether you have completed your tasks correctly.
When you take a challenge lab, you will not be taught new Google Cloud concepts. You are expected to extend your learned skills, like changing default values and reading and researching error messages to fix your own mistakes.
To score 100% you must successfully complete all tasks within the time period!
This lab is recommended for students who have enrolled in the Serverless Cloud Run Development quest. Are you ready for the challenge?
Setup
Before you click the Start Lab button
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you.
This hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
- Access to a standard internet browser (Chrome browser recommended).
- Time to complete the lab---remember, once you start, you cannot pause a lab.
Situational overview
Pet Theory is a veterinary practice who are keen to utilize serverless architecture to update their existing systems.
In this challenge lab, you are part of the development team and have been assigned the task of migrating a service to serverless. Pay close attention to the provided instructions to successfully complete the exercise.
Architecture
Pet Theory has nominated the existing monolithic Billing application to be reimagined using serverless.
Over the course of this lab, you will be expected to implement this design update.
The development team will provide either the code or an image to be deployed as part of the solution.
Developing a minimal viable product (MVP)
You will build a prototype solution for Pet Theory that meets the following high level requirement specification:
Ref |
Definition of Done |
1 |
Deploy Staging Architecture |
2 |
Deploy Prod Architecture |
3 |
Secure Access between components in the Prod Architecture |
Provision the lab environment
During the lab, ensure the environment is provisioned to support the deployment of the resources.
- Open a Cloud Shell in an Incognito Browser Window.
- Set the default project for the environment:
- Set the region for the run deployments:
- Set the Cloud Run platform type:
- Clone the repo with the Pet Theory code:
Task 1. Enable a Public Service
Overview
- Set up a Rest API for the billing service. Use the information in the table below:
FIELD |
VALUE |
Billing Image |
billing-staging-api:0.1 |
Billing Service |
|
Authentication |
unauthenticated |
Code |
pet-theory/lab07/unit-api-billing |
Architecture
-
Using the available code, deploy the Billing Service.
Assessment
To complete this task successfully, you are required to implement the following:
- Build an image using Cloud Build.
- Deploy a Cloud Run service as an unauthenticated service.
- Test service responds when the endpoint is accessed.
Click Check my progress to verify that you've performed the above task.
Task 2. Deploy a Frontend Service
Overview
- Set up a Frontend Service. Use the information in the table below:
FIELD |
VALUE |
Image Name |
frontend-staging:0.1 |
Service Name |
|
Authentication |
unauthenticated |
Code |
pet-theory/lab07/staging-frontend-billing |
Architecture
Assessment
To complete this section successfully, you are required to implement the following tasks:
- Build an image using Cloud Build.
- Deploy the image to Cloud Run as an unauthenticated service.
- Service should respond when the endpoint is accessed.
Click Check my progress to verify that you've performed the above task.
Task 3. Deploy a Private Service
Overview
- The development team updated their application and would like this deployed to the staging environment:
FIELD |
VALUE |
Image Name |
billing-staging-api:0.2 |
Service Name |
|
Repository |
gcr.io |
Authentication |
authenticated |
Code |
pet-theory/lab07/staging-api-billing |
Architecture
Assessment: Cloud Run Development
To complete this section successfully, you are required to implement the following tasks:
- Delete the existing Billing Service.
- Build an image using Cloud Build.
- Deploy the image to Cloud Run requiring authentication.
- Assign the SERVICE_URL to an environment variable.
Note: Replace PRIVATE_BILLING_SERVICE
inside the code-block with
- Service should respond when the endpoint is accessed
Click Check my progress to verify that you've performed the above task.
Task 4. Create a Billing Service Account
Overview
- In preparation for the deployment to production, you will need to create a Service Account for the Billing Service:
FIELD |
VALUE |
Service Account |
|
Display Name |
Billing Service Cloud Run |
Service Name |
billing-service |
Role |
N/A |
Architecture
Assessment: Service Account
To complete this section successfully, you are required to create a Service Account.
Click Check my progress to verify that you've performed the above task.
Task 5. Deploy the Billing Service
Overview
- Associate the new Billing Service Account with Billing Service:
FIELD |
VALUE |
Image Name |
billing-prod-api:0.1 |
Service Name |
|
Repository |
gcr.io |
Authentication |
authenticated |
Code |
pet-theory/lab07/prod-api-billing |
Service Account |
|
Architecture
Assessment: Cloud Run Development
To complete this section successfully, you are required to implement the following tasks:
- Deploy the image to Cloud Run.
- Enable Authentication.
- Enable the Service Account.
- Service should respond when the endpoint is accessed.
Get the URL of the Billing Service:
PRIVATE_BILLING_SERVICE
inside the code-block with Access the deployed endpoint:
Click Check my progress to verify that you've performed the above task.
Task 6. Frontend Service Account
Overview
- Create a new Service Account for the Frontend capable of invoking the Billing Service:
FIELD |
VALUE |
Service Account |
|
Display Name |
Billing Service Cloud Run Invoker |
Service Name |
frontend-prod-service |
Role |
run.invoker |
Architecture
Assessment
To complete this section successfully, you are required to implement the following tasks:
- Create a Service Account.
- Apply Service Account for Frontend Service.
- Give Service Account run.invoker permission.
- Bind Account to Service.
Click Check my progress to verify that you've performed the above task.
Task 7. Redeploy the Frontend Service
Overview
- Use the new Service Account and redeploy the Frontend Service:
FIELD |
VALUE |
Image Name |
frontend-prod:0.1 |
Service Name |
|
Repository |
gcr.io |
Authentication |
unauthenticated |
Code |
pet-theory/lab07/prod-frontend-billing |
Service Account |
|
Architecture
Assessment: Cloud Run Development
To complete this section successfully, you are required to implement the following tasks:
- Deploy the image to Cloud Run.
- Enable Authentication.
- Enable Service Account.
- Service should respond when the endpoint is accessed.
Click Check my progress to verify that you've performed the above task.
- Now access the production frontend service to display the user interface.
Information on screen is consumed from the private billing service using the service account.
Congratulations!
Over this course of this challenge lab you have demonstrated your knowledge of Cloud Run and Google Cloud infrastructure.
Earn Your Next Skill Badge
This self-paced lab is part of the Serverless Cloud Run Development quest. Completing this skill badge quest earns you the badge above, to recognize your achievement. Share your badge on your resume and social platforms, and announce your accomplishment using #GoogleCloudBadge.
This skill badge is part of Google Cloud’s Cloud Developer learning path. Continue your learning journey by enrolling in the Serverless Firebase Development quest.
Google Cloud training and certification
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated July 12, 2022
Lab Last Tested January 12, 2022
Copyright 2023 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.