Sei sulla pagina 1di 11

CLOUD COMPUTING

LAB ASSIGNMENT ON APP DEPLOYMENT ON GAE

SUBMITTED BY
AJAY ANEJA
2018ht12620
Introduction
Develop any cloud application using available software services such as Gmail, Docs, or
CRM on GAE Platform. Test your application on GAE platform. Any application supported
by GAE.
Here the Objective behind the assignment is to provide the hand-ons on the Google App
Engine environment.
Google App Engine is a Platform as a Service and Cloud computing platform for developing
and hosting web applications in Google-managed data centers. App Engine is a fully
managed, serverless platform for developing and hosting web applications at scale. It
provides support for various languages and libraries and framework to develop the apps.
Application Overview:
Application Details Name: Simple Calculator

URL: https://assignment-259518.appspot.com/

Type: Web-app (Compatible with mobile)

Application Description:
Simple Calculator is a app used to perform used to perform basic calculations function like addition,
subtraction, multiplication and division.
LANGUAGE: Python 3
Python HTTP SERVER: gunicorn 19.5.0
APPLICATION FRAMEWORK: FLASK

GUNICORN:

Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork worker model.
The Gunicorn server is broadly compatible with various web frameworks, simply implemented, light
on server resources, and fairly speedy.

FLASK:

Flask is a lightweight WSGI web application framework. It is designed to make


getting started quick and easy, with the ability to scale up to complex applications. It
began as a simple wrapper around Werkzeug and Jinga and has become one of the
most popular Python web application frameworks.
Developing and Deploying of the APP
1. Login to the below url using cloud account.
https://console.cloud.google.com/
2. Create a new GCP Console project by clicking on NEW PROJECT or retrieve the
project ID of an existing project from the Google Cloud Platform Console:

Interface to fetch the project name

Creating the new project by providing the Project name and then
clicking on create. It will create the new project.
3. Click on the Activate Cloud Shell available at the rightmost corner of the home page
highlighted below.

Home Page

CLOUD SHELL
4. Now click on the launch editor Highlight on the below image.

Cloud SHELL

It will open the launch editor in the new t

Editor
5. Click On the file -> new folder button to create new folder on the Editor.

Provide the folder name and click OK button. It will create new folder for the project.
6. After Select/Creating the folder, we can either upload the files already created or the
upload the already created files using upload file.

Upload already created files:


7. Two Mandatory files for the application to run.
a. app.yaml
It defines the configuration settings for our runtime environment as well as general
app, network, and other resources settings.
Sample APP.YAML FILE CONFIGURATION

runtime: ruby
env: flex
entrypoint: bundle exec ruby app.rb

# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
# https://cloud.google.com/appengine/docs/flexible/ruby/configuring-your-app-with-app-yaml
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
It defines runtime environment , entrypoint and scaling and resources config of the application.
Entrypoint: The command to start application. The entrypoint starts a process that responds to HTTP
requests on the port defined by the environment variable PORT.
RUNTIME: This setting is required. It is the name of the App Engine language runtime used by this
application.
Env: Select the flexible environment.

Note: Please go through the below link for more information:

https://cloud.google.com/appengine/docs/flexible/ruby/reference/app-yaml

APP.YAML file for the calculator project

runtime: python
env: flex
entrypoint: gunicorn&nbspapp:app

runtime_config:
python_version: 3
b) Requirements.txt
Dependencies for Python applications are declared in a standard requirements.txt file. For
example
Flask==0.12.2
Jinja2==2.8
Werkzeug==0.13
# deploy
gunicorn==19.5.0
gevent

8. Steps to deploy the application on google app engine


From the root directory of the application where the configuration files are located, you
run the deployment command.

 gcloud app deploy


It will ask for the region to use for the first time to deploy and it will ask for continue
once compiling the file.

9. To describe the application configuration i.e. To show all the data about the current
application, command

 gcloud app describe

10. gcloud app browse - open the current app in a web browser
Application Snapdhot:

ApplicationURL: https://assignment-259518.appspot.com/

This application is used to calculate to perform basic arithmetic calculation online. One can use to
calculate/ perform basic math functions like addition, subtraction, multiplication and division.

Calculator image
Performing basic arithmetic calculation

Potrebbero piacerti anche