Deploying to Google Cloud App Engine

30 minutes
  • 6 Learning Objectives

About this Hands-on Lab

Google Cloud App Engine provides a solid, easy-to-access platform for a wide range of web apps. Its interoperability with other Google Cloud services, such as Cloud Storage, enhance its effectiveness. In this hands-on lab, we’ll deploy an app to App Engine that allows users to upload photos and enter details into a NoSQL database, Cloud Datastore. The process requires that we set up a Cloud Storage bucket initially and then customize the `config.py` file before deploying the app.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Enable Cloud Datastore API and create a Cloud Storage bucket.
  1. From the main console navigation, go to APIs and Services > Library.
  2. Search for Datastore.
  3. Select the Cloud Datastore API card.
  4. Click Enable, if displayed.
  5. From the main console navigation, choose Cloud Storage.
  6. Click Create bucket.
  7. Name the bucket uniquely and click Continue.
  8. In the Location Type section, select Region and click Continue.
  9. Click Create.
Make the bucket contents public.
  1. Create a new user called allUsers.
  2. Give the user the role of Storage Object Viewer.
Clone GitHub repository.
  1. From the Cloud Shell, issue the following command to clone the repository for this course:

    git clone https://github.com/linuxacademy/content-gcpro-developer
  2. Change directories to content-gcpro-developer/app-engine-lab/.

Configure `config.py` file.
  1. From the Cloud Shell Editor, open config.py in the app-engine-lab folder.
  2. Change PROJECT_ID to the current project, as shown in the Cloud Shell.
  3. Change CLOUD_STORAGE_BUCKET to name of the bucket previously created.
  4. Save the file.
Deploy the app.
  1. In the Cloud Shell, enter the following code:
    gcloud config set app/cloud_build_timeout 6000
    gcloud app deploy
  2. When prompted, choose the same region as the bucket created for the lab.
Test the app.
  1. In the Cloud Shell, enter the code:
    gcloud app browse
  2. If the browser window does not open, click the generated link.

Additional Resources

You’ve been asked to deploy the latest version of your company’s new app, LA Gift Art, on Google Cloud App Engine. The app allows a user to enter details about a work of art, including the name of both the artist and the work, as well as a photo — all of which will be publicly viewable. To accomplish this, the app stores data in Cloud Datastore and images in Cloud Storage. The app is written in Python 3 and uses App Engine’s flexible environment.

You’ll need to accomplish the following steps to complete your task:

  1. Ensure that required APIs are available.
  2. Create a Cloud Storage bucket with the proper permissions.
  3. Clone a GitHub repo to acquire the files.
  4. Properly configure the application by modifying a YAML file.
  5. Deploy the app to App Engine in the proper region.
  6. Test the app.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?