准备工作
- 实验会创建一个 Google Cloud 项目和一些资源,供您使用限定的一段时间
- 实验有时间限制,并且没有暂停功能。如果您中途结束实验,则必须重新开始。
- 在屏幕左上角,点击开始实验即可开始
Preparing the Case Study Application
/ 5
Deploy the frontend to App Engine Flex
/ 5
Updating the App Engine Flex Application
/ 5
In this lab, you deploy the Quiz application into App Engine Flex, leveraging App Engine features, including versions and traffic splitting.
In this lab, you learn how to perform the following tasks:
Create an app.yaml file to describe the App Engine Flex requirements for an application.
Deploy the quiz application into App Engine Flex.
Employ versions and traffic splitting to perform A/B testing of an application feature.
For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.
Sign in to Qwiklabs using an incognito window.
Note the lab's access time (for example, 1:15:00), and make sure you can finish within that time.
There is no pause feature. You can restart if needed, but you have to start at the beginning.
When ready, click Start lab.
Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.
Click Open Google Console.
Click Use another account and copy/paste credentials for this lab into the prompts.
If you use other credentials, you'll receive errors or incur charges.
Accept the terms and skip the recovery resource page.
Google Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud.
Google Cloud Shell provides command-line access to your Google Cloud resources.
In Cloud console, on the top right toolbar, click the Open Cloud Shell button.
Click Continue.
It takes a few moments to provision and connect to the environment. When you are connected, you are already authenticated, and the project is set to your PROJECT_ID. For example:
gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
Output:
Example output:
Output:
Example output:
In this section, you access Cloud Shell, clone the git repository containing the Quiz application, configure environment variables, and run the application.
Clone the repository for the class:
Create a soft link as a shortcut to the working directory:
Change the directory that contains the sample files for this lab:
Configure the Quiz application:
GCLOUD_PROJECT and GCLOUD_BUCKET.
npm install.
In Cloud Shell, click Open Editor. If prompted, click Open in a new window.
Navigate to appengine/start.
frontend.
There are configuration files for App Engine; app.yaml and config.json in the frontend folder.
Click Check my progress to verify the objective.
In this section, you modify the configuration files for deployment of the quiz application frontend into App Engine Flex.
appengine/start/frontend/app.yaml.key: value pairs, and set scaling to manual:The first setting, runtime, indicates that you want to use the nodejs runtime.
The second setting, env, indicates that you want to use the flexible environment.
The number of instances is set to 1. A production service should typically be allowed to scale to more instances.
Modify the appengine/start/frontend/config.json file to include a key GCLOUD_BUCKET, the value is the name of the -media bucket in your project, which is <GCP-Project-ID>-media.
Save the files.
In Cloud Shell, deploy the quiz application to App Engine Flex:
If asked "Do you want to continue (Y/n)?" press Y.
https://<PROJECT_ID>.appspot.com.
You should see your application.
In this section, you modify the application code and then redeploy the application.
In the Cloud Shell code editor, open the appengine/start/frontend/web-app/views/home.pug file.
Add several exclamation points to the top-level heading.
Save the file.
In Cloud Shell, redeploy the App Engine application:
If asked "Do you want to continue (Y/n)?" press Y.
yyyymmddthhmmss, so it's easy to see which is the new and which is the old version.
In the bonus, you can explore activating the Cloud Debugger and Cloud Error Reporting features in your application. Use the steps from the Debugging Application Errors lab guide to:
Which mechanisms can you use to direct traffic splits with App Engine?
When you have completed your lab, click End Lab. Google Cloud Skills Boost removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Copyright 2022 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.
此内容目前不可用
一旦可用,我们会通过电子邮件告知您
太好了!
一旦可用,我们会通过电子邮件告知您
一次一个实验
确认结束所有现有实验并开始此实验