menu
arrow_back

Build a Serverless App with Cloud Run that Creates PDF Files

Build a Serverless App with Cloud Run that Creates PDF Files

1 个小时 3 个积分

GSP644

Google Cloud Self-Paced Labs

image

Overview

For the labs in the GCP Serverless Workshop: Pet Theory Quest, you will read through a fictitious business scenario and assist the characters with their serverless migration plan.

Twelve years ago, Lily started the Pet Theory chain of veterinary clinics. Pet Theory currently sends invoices in DOCX format to clients, but many clients have complained that they are unable to open them. To improve customer satisfaction, Lily has asked Patrick in IT to investigate an alternative to improve the current situation.

Pet Theory's Ops team is a single person, so they are keen to invest in a cost efficient solution that doesn't require a lot of ongoing maintenance. After analyzing the various processing options, Patrick decides to use Cloud Run.

Cloud Run is serverless, so it abstracts away all infrastructure management and lets you focus on building your application instead of worrying about overhead. As a Google serverless product, it is able to scale to zero, meaning it won't incur cost when not used. It also lets you use custom binary packages based on containers, which means building consistent isolated artifacts is now feasible.

In this lab you will build a PDF converter web app on Cloud Run that automatically converts files stored in Cloud Storage into PDFs stored in seperated folders.

Architecture

This diagram gives you an overview of the services you will be using and how they connect to one another:

arch.png

What you will learn

In this lab, you will learn how to:

  • Convert a Node JS application to a container.
  • Build containers with Google Cloud Build.
  • Create a Cloud Run service that converts files to PDF files in the cloud.
  • Use event processing with Google Cloud Storage

Prerequisites

This is a fundamental level lab. This assumes familiarity with the GCP Console and shell environments. Experience with Firebase will be helpful, but it is not required. Before taking this lab it is recommended that you have completed the following Qwiklabs before taking this one:

You should also be comfortable editing files. You can use your favorite text editor (like nano, vi, etc.) or you can launch the code editor from Cloud Shell, which can be found in the top ribbon:

ba731110a97f468f.png

Once you're ready, scroll down and follow the steps below to setup your lab environment.

加入 Qwiklabs 即可阅读本实验的剩余内容…以及更多精彩内容!

  • 获取对“Google Cloud Console”的临时访问权限。
  • 200 多项实验,从入门级实验到高级实验,应有尽有。
  • 内容短小精悍,便于您按照自己的节奏进行学习。
加入以开始此实验
分数

—/100

Build simple a REST API

运行步骤

/ 20

Create a Revision for Cloud Run

运行步骤

/ 20

Create two cloud storage buckets

运行步骤

/ 10

Create a Pub/Sub topic for receiving notification from storage bucket

运行步骤

/ 10

Create a Pub/Sub subscription

运行步骤

/ 10

Create another build for REST API

运行步骤

/ 15

Create a new Revision

运行步骤

/ 15