Automating Google App Engine

Automating Google App Engine

Google App Engine is a pretty amazing service. You write code, and Google will make sure it runs, and scales well. This service was available way back in 2008, well before everyone was getting excited over lambdas and serverless.

In my opinion, AppEngine is one of the most underrated services I’ve seen. It’s beautifully simple, and it has planet-level scaling (Google words). You don’t have to configure load balancers, tweak an OS or install/configure a Runtime. The focus is on optimizing for the developer experience, and having your spend more time writing code.

Even though Google makes it easy to get started with App Engine I wanted to reduce the steps even further. I’ve created a GAE demo that offers a local development and deployment environment via docker containers and simple to use commands.

Google App Engine Demo

Local Development

Creating a local development environment can be done with one command:

1~/code/gae-demo $ docker-compose up local

This is what the console output should look like:

This is what the app looks running on your machine:

The demo app comes with instructions and sample code that adds entries to a local datastore.

One of the amazing features of Google App Engine is the local admin environment that offers similar functionality to the online admin console from Google. The demo comes with everything pre-configured and ready to use.

Local Datastore Viewer:

Interactive Console:

Not bad for one line of code!

Deploying

Google has a wonderful feature called “ Projects” that allow you to group related resources to make them easier to manage. When you run the `new-deploy` command the demo will create a new project and related application, then deploy it for you.

1~/code/gae-demo $ docker-compose up new-deploy

Deploying updates to your application is quick and easy too. First specify your project id from the previous step, then run re-deploy.

1~/code/gae-demo $ export CLOUDSDK\_CORE\_PROJECT=devops-demo-xxx ~/code/gae-demo $ docker-compose up re-deploy

That’s it, why are you still here? You could be spending this time deploying your new application.

You can find the full demo and instructions here: https://github.com/drewkhoury/gae-demo

Info

Also posted on medium as Automating Google App Engine.