You are on page 1of 11

ASSIGNMENT

Developing and Deploying app on Google App Engine

Submitted to:
Prof. SUBHRAKANTA PANDA
Submitted by:

Govindan Narayanan
Roll No: 2017HT66550
MTech in Computing Systems & Infrastructure – Second Semester 2018 - 2019

Work-Integrated Learning Programs Division

Date: 30th April 2019

Birla Institute of Technology & Science, Pilani


Table of Contents
1. General Information ............................................................................................................................................ 3
2. Registration.......................................................................................................................................................... 3
Creating a Google Cloud Platform Project............................................................................................................... 3
Download and Install Google Cloud SDK ................................................................................................................. 4
3. First Steps Creating an application ...................................................................................................................... 4
Creating a website to host on Google App Engine .................................................................................................. 4
Creating the app.yaml file ................................................................................................................................... 4
Creating the index.html file ................................................................................................................................. 5
Creating the Java Script file ................................................................................................................................. 6
Creating the Style.CSS file .................................................................................................................................... 6
4. Deploying CloudCalc application in Google app engine ...................................................................................... 7
Publishing Application ............................................................................................................................................. 7
5. Result viewing our application ............................................................................................................................ 9
6. App Usage report................................................................................................................................................. 9
7. Troubleshooting................................................................................................................................................. 10
Unable to install Google cloud SDK ................................................................................................................... 10
Unable to publish/deploy my App ..................................................................................................................... 11
Google Cloud Help Commands .......................................................................................................................... 11
8. Support .............................................................................................................................................................. 11
1. General Information
This document describes the installation of the Google App Engine Software Development Kit (SDK) on a
Microsoft Windows 7 pc and deploying a simple “CloudCalc” application. The App Engine SDK allows you to run
and deploy the application and hosting a static website on Google App Engine through your local computer.

2. Registration

Creating a Google Cloud Platform Project


To use Google's tools to create static website and CloudCalc app, we need to create a new project on Google
Cloud Platform. This requires having a Google account (example: goviemail@gmail.com or
2018ht66550@wilp.bits-pilani.ac.in)

Go to the Google Cloud Platform Console: https://console.cloud.google.com/projectselector2/ and login with


your Google account.

We will need to agree to the Terms of Service, and then you should be able to continue.

Press the Create button.

Enter a name for the project, edit your project ID and note it down. For this assignment, the following values are
used:

Project Name: cloudcalc

Project ID: cloudcalc

Click the Create button to create your project.


Download and Install Google Cloud SDK
Google Cloud SDK is a set of tools that you can use to manage resources and applications hosted on
Google Cloud Platform. These include the gcloud command line tools. The gcloud command-line tool we
will use to deploy app in this project.

Continue install till….

3. First Steps Creating an application

Creating a website to host on Google App Engine


Creating the app.yaml file
The app.yaml file is a configuration file that tells App Engine how to map URLs to your static files.

1. Created a directory in my PC that has the same name as our project ID: cloudcalc. In general, we can find
your project ID in the Google Cloud Console.

2. In cloudcalc directory that we just created, create a file named app.yaml.


3. Edit the app.yaml file and add the following code to the file:
runtime: python27

api_version: 1

threadsafe: true

handlers:

- url: /

static_files: www/index.html

upload: www/index.html

- url: /(.*)

static_files: www/\1

upload: www/(.*)

Creating the index.html file


Created and developed the HTML file that will be served, when navigates to the root page of our website. Store
this file in your www directory.
Creating the Java Script file
Created and developed the Java Script file that will be called and execute for the Calc function, when we call the
Index.html file. Store this file in your www directory.

Creating the Style.CSS file


Created and developed the CSS file that will used for formatting content on our cloudcalc web site. Store this file
in your www directory.
4. Deploying CloudCalc application in Google app engine

Publishing Application
Now that we have developed our project and CloudCalc App files collected together, let us publish our app.

Step1. On computer go to Windows Start -> All Programs -> Google Cloud SDK -> Google Cloud SDK Shell

Step2. Ensure basic connectivity to internet is established and shown as passed in Google Cloud SDK Shell
window

Step3. When prompted for login, selected yes and validated my Gmail account: 2018ht66550@wilp.bits-
pilani.ac.in

Step4. Select our project ID – cloudcalc, which we created in the gcloud tool

Step 5. Now deploy our application files to App Engine.


run the following command from within the root directory of your application where the app.yaml file is located:
Step 6. Selected “Asia – south1” as hosting location for CloudCalc App engine

Step 7. Final steps of deployment of service


5. Result viewing our application
By launching an Internet browser and view the app at https://cloudcalc.appspot.com

6. App Usage report

Summary of App usage report of per day


Streaming Logs of App Usage

7. Troubleshooting
Unable to install Google cloud SDK
Check whether your PC connected to the Company network through VPN. For example, VPN Apps like Pulse
Secure app /Junos pulse may restrict you to download /install the Application
Unable to publish/deploy my App
Ensure your laptop/desktop should have the working internet connection for successful sync with Google Cloud
console

Google Cloud Help Commands


Try “gcloud –help” in Gcloud SDK Shell
C:\Users\gonaray\AppData\Local\Google\Cloud SDK>gcloud -h
Usage: gcloud [optional flags] <group | command>
group may be access-context-manager | app | asset | auth |
bigtable | builds | components | composer | compute |
config | container | dataflow | dataproc | datastore |
debug | deployment-manager | dns | domains |
endpoints | filestore | firebase | functions | iam |
iot | kms | logging | ml | ml-engine | organizations |
projects | pubsub | redis | resource-manager |
services | source | spanner | sql | topic
command may be docker | feedback | help | info | init | version

8. Support
For details information please refer https://cloud.google.com/appengine/docs/standard/python/getting-
started/hosting-a-static-website

You might also like