Upgrading to the App Engine Flexible Environment Latest Release

The latest release of the App Engine flexible environment includes new features and improvements, but you must account for several changes in your application code to upgrade.

To get started with the latest release, edit your app.yaml and change vm: true to env: flex, for example:

runtime: ruby
env: flex

You might need to update your app.yaml to account for environment variable changes and other breaking changes. See below for more details.

After you have made the necessary changes, re-deploy your application to finish upgrading.

Applications created with vm:true

The beta environment identified by vm:true is deprecated. Applications that have already been deployed with vm:true will continue to work until the decomission date, June 30, 2017. At that point, applications using vm:true will stop serving traffic and all customers must switch to the env:flex environment.

Important dates

  • Deprecation date: November 15th, 2016

    On November 15th 2016, deployments to App Engine using vm:true were officially deprecated.

  • Decommission date: June 30th, 2017

    On June 30th, 2017, the Managed VMs environment (vm:true) will be shut down.

New features

This beta release has several new features, including multi-zone deployments, custom instance shapes, and networking upgrades.

Multi-zone deployments

Deployments using env: flex ensure that Compute Engine virtual machine instances are autoscaled across multiple availability zones. By creating instances across multiple zones in a region, your application is protected in the event of zone incidents.

Custom instance shapes

App Engine flexible environment customers can choose a custom machine type when configuring machine resources. Custom Machine Types allow you to select customized CPU, memory, and disk settings to match the needs of your application. To learn more, see Configuring your app with app.yaml.

Networking upgrades

App Engine flexible environment includes a new networking stack based on Google Cloud Load Balancing, which has resulted in the following:

Breaking changes

Upgrading to the latest App Engine flexible environment beta requires a few changes to your code. This section includes deprecations and breaking changes that you need to be address before moving to env: flex.

Runtime deprecations

This release comes with the deprecation of a few runtimes and features. Some runtimes or libraries in the App Engine flexible environment relied on the standard environment emulation and used services such as the NDB Client Library, Objectify, the App Engine Mail API, and the Task Queues API. These runtimes and packages were deprecated on November 15th, 2016.

If you need to continue running your application on the python-compat, python27, java-compat, or jetty9-compat runtimes or on the google.golang.org/appengine package until the decommission date on June 30, 2017, please fill out this form and we’ll get in touch.

If you need to migrate from a runtime that was compatible with the App Engine standard environment (a "compat" runtime) to a supported runtime, see Migrating Services from the Standard Environment to the Flexible Environment.

Python Compat runtimes

The python-compat and python27 runtimes have been deprecated. Upgrade to the latest Python runtime.

You might also be able to run your Python application in the App Engine standard environment. For help migrating your existing python-compat or python27 application, see the App Engine Standard to Flexible migration guide.

Java Compat runtimes

The Java 7 / Jetty 9 Compat runtime (java-compat) and the Java 8 / Jetty 9 Compat runtime (jetty9-compat) have been deprecated. Upgrade to the latest Java 8 / Jetty 9 runtime or Java 8 runtime.

You might also be able to run your Java application in the App Engine standard environment. For help migrating your existing java-compat or jetty9-compat application, see the App Engine Standard to Flexible migration guide.

Go runtime changes

The google.golang.org/appengine package no longer works on the App Engine flexible environment. We recommend migrating to the cloud.google.com/go/... package.

app.yaml changes

To switch to the new beta release, modify your app.yaml and switch vm:true to env:flex.

You must also update the app.yaml to address several deprecated settings.

Forwarded ports

The forwarded ports setting under network settings is now deprecated. This setting encouraged directly connecting to Google Compute Engine instances, which caused significant issues with downtime.

Secure handlers

The secure setting under handlers is now deprecated for the App Engine flexible environment. Developers should instead use the HTTP Strict Transport Security response header.

Login handlers

The login setting under handlers is now deprecated for the App Engine flexible environment. Developers should follow the guidance for User service migration.

Environment variable changes

The following environment variables have been removed or renamed. When available, the replacement environment variable has been listed:

Environment variable New environment variable (where applicable)
APPENGINE_LOADBALANCER
APPENGINE_LOADBALANCER_IP
GAE_AFFINITY
GAE_APPENGINE_HOSTNAME
GAE_MINOR_VERSION
GAE_LONG_APP_ID GCLOUD_PROJECT
GAE_MODULE_INSTANCE GAE_INSTANCE
GAE_MODULE_NAME GAE_SERVICE
GAE_MODULE_VERSION GAE_VERSION
GAE_PARTITION
GAE_VM
HOSTNAME
MEMCACHE_ENV_DEBIAN_FRONTEND
MEMCACHE_ENV_PORT
MEMCACHE_NAME
MEMCACHE_PORT
MEMCACHE_PORT_11211_TCP
MEMCACHE_PORT_11211_TCP_ADDR
MEMCACHE_PORT_11211_TCP_PORT
MEMCACHE_PORT_11211_TCP_PROTO
MODULE_YAML_PATH
SERVER_SOFTWARE
USE_MVM_AGENT

Request header changes

The following HTTP headers have been removed from all requests:

  • X-GOOGLE-REAL-IP
  • X-APPENGINE-API-TICKET
  • X-APPENGINE-AUTH-DOMAIN
  • X-APPENGINE-COUNTRY
  • X-APPENGINE-DATACENTER
  • X-APPENGINE-DEFAULT-VERSION-HOSTNAME
  • X-APPENGINE-HTTPS
  • X-APPENGINE-REQUEST-ID-HASH
  • X-APPENGINE-REQUEST-LOG-ID
  • X-APPENGINE-USER-IS-ADMIN
  • X-APPENGINE-USER-IP
  • X-APPENGINE-REGION
  • X-APPENGINE-CITY
  • X-APPENGINE-CITYLATLONG

The following HTTP headers are now included with all requests:

  • X-FORWARDED-FOR
  • X-CLOUD-TRACE-CONTEXT
  • X-FORWARDED-PROTO

Memcache service

The Memcache service is currently not available for the App Engine flexible environment. An alpha version of the memcache service will be available shortly. If you would like to be notified when the service is available, fill out this early access form.

If you need access to a memcache service immediately, you can use the third party memcache service from Redis Labs. To access this service, see Caching Application Data Using Redis Labs Memcache.

You can also use Redis Labs Redis Cloud, a third party fully-managed service. To access this service, see Caching Application Data Using Redis Labs Redis.

Task queues

The Task Queue service has limited availability outside of the standard environment. If you want to use the service outside of the standard environment, you can sign up for the Cloud Tasks alpha.

In many cases where you might use pull queues, such as queuing tasks or messages that will be pulled and processed by separate works, Cloud Pub/Sub is a good alternative that offers similar functionality and delivery guarantees.

For users of the "compat" runtimes, the App Engine Task Queue API is still available, but unsupported. The list of available headers has changed. To verify that a request originated from the task queue service, you can safely check for the presence of these headers:

  • X-AppEngine-QueueName
  • X-AppEngine-TaskName
  • X-AppEngine-TaskRetryCount
  • X-AppEngine-TaskRetryReason
  • X-AppEngine-TaskExecutionCount
  • X-AppEngine-TaskETA

Instance routing

You can no longer route traffic to specific instances, such as https://instance-dot-version-dot-service-dot-app-id.appspot.com.

Pricing changes

The latest App Engine flexible environment release introduces a new pricing model. Customers who are currently using vm:true will receive one year of raw Compute Engine pricing. To view the new prices for the flexible environment, see Costs for flexible environment instances.

Send feedback about...

App Engine flexible environment for Ruby docs