Upgrading to the Latest App Engine Flexible Environment Beta 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.

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. 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. If you need to continue running your application on this runtime until the decommission date, please fill out this form and we’ll get in touch.

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. If you need to continue running your application on this runtime until the decommission date, please fill out this form and we’ll get in touch.

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 Redislabs. To access this service, see Caching Application Data Using Redislabs Memcache.

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

Instance routing

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

Domain update

Traffic is now served from the appspot-preview.com domain instead of the appspot.com domain. All traffic from the App Engine flexible environment will be automatically redirected to the new domain. All App Engine Standard traffic will continue to be through appspot.com. When the App Engine flexible environment is generally available (GA), users will be able to use the appspot.com or appspot-preview.com domains for routing traffic.

For users who want to use the latest App Engine Flexible release with a custom domain, please fill out this form to contact us.

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.

Applications created with vm:true

All applications created in the vm:true environment will continue to work for at least 6 months after the App Engine flexible environment becomes generally available. At that point, all customers need to switch to the env:flex environment.

Send feedback about...

App Engine flexible environment for Ruby docs