In my last blog about Serverless Applications with AWS Fargate
we looked at how to create a simple Flask/Python based application in AWS. The application is a Serverless Continuous Running
Application or ‘SCRA’. A SCRA application runs continuously, has virtually no limit on the code size and programming languages
that can be used and you pay only for what you use. Above all, with SCRA applications, you don’t manage servers.
This time we will deploy the application to Google App Engine (GAE). Lets take a look!
Google App Engine
GAE is a platform for serverless applications that provides development and hosting capabilities to
developers. Programs can be developed in most popular programming languages like Python, Go and Java.
GAE provides the infrastructure for running web applications at cloud scale. The architecture of GAE is fixed which
means that GAE is fit for purpose for certain applications like stateful web applications.
Example
The example project consists of the following files,
from which only app.yaml
, main.py
and requirements.txt
are the most important files.
The file app.yaml
is the deployment descriptor and contains a single line, the runtime:
The requirements.txt
file contains the dependencies for the application. GAE will automatically download and install
the dependencies for use:
The main application is defined in main.py
which will be examined by GAE in order to deploy the web application:
To deploy the example type make deploy
and to invoke the application type make browse
. To remove the application,
it must be disabled. A GAE can only be disabled by means of the web console. You have to login to console.cloud.google.com,
choose your project, navigate to GAE, go to settings and disable the application.
Conclusion
Because of the predefined architecture, managed infrastructure and developer focused workflow, serverless applications
are very easy to create in GAE. With a minimum of code you can create highly scalable web applications and web services.
The platform manages the life cycle of the applications, and upgrades. Logging and monitoring are provided by Google Stackdriver.
When compared to deploying the same solution in AWS Fargate,
a GAE application has a lot less configuration. Next time we’ll look at deploying a docker container on Google App Engine!