We suggest that you try out one of the sample apps that we've reconfigured for Managed VMs. Download the sample source code from github, check out what's changed in the configuration file, and deploy the app to a VM.
Download the sample code and the App Engine SDK
The quickstart samples are available in Python, Go, and Java. Follow the link to download the code from GitHub. Click the App Engine SDK link and follow the instructions to download and install the SDK for your particular local development machine.
Python
Download the Python Hello World QuickstartDownload the App Engine Python SDK
Go
Download the Go Hello World QuickstartDownload the App Engine Go SDK
Complete the installation of the Go SDK by running the commands:
import GOPATH=$HOME/go <sdk_path>/goapp get google.golang.org/appengine
Java
Download the Java Hello World QuickstartDownload the App Engine Java SDK
View the config file
The sample config file will start one instance of an n1-standard machine type. The lines that have been added/edited for managed VMs are in boldface.
Python
File: app.yamlapplication: your-application-id runtime: python27 vm: true ... manual_scaling: instances: 1 vm_settings: machine_type: n1-standard-1 ...
Go
File: app.yamlapplication: your-application-id runtime: go vm: true ... manual_scaling: instances: 1 vm_settings: machine_type: n1-standard-1 ...
Java
File: appengine-web.xml<appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>your-application-id</application> ... <vm>true</vm> <vm-settings> <setting name="machine_type" value="n1-standard-1"/> </vm-settings> <manual-scaling> <instances>1</instances> </manual-scaling> ... </appengine-web-app>
Deploy your app
Use the
update
command.
Python
If you have two-step verification enabled on your Google account, add the
--oauth2
flag, otherwise, you will need to provide an application password.
<python_sdk_path>/appcfg.py -s preview.appengine.google.com update <app-directory>Point your browser to
http://<your-app-id>.appspot.com
and test the app.
Go
If you have two-step verification enabled on your Google account, add the
--oauth2
flag, otherwise, you will need to provide an application password.
<go_sdk_path>/appcfg.py -s preview.appengine.google.com update <app-directory>Point your browser to
http://<your-app-id>.appspot.com
and test the app.
Java
You have to compile the source code first. Follow the directions in the README file, or use your preferred Java tooling to generate a WAR file to deploy. Then run the
update
command.
If you have
two-step verification
enabled on your Google account,
add the
--oauth2
flag, otherwise, you will need to provide an application password.
<java_sdk_path>/appcfg.sh -s preview.appengine.google.com update <EAR-or-WAR-directory>Point your browser to
http://<your-app-id>.appspot.com
and test the app.