1

When I run

gcloud preview app deploy /yamls/app.yaml

it executes with no error messages or warnings, and I see a new managed VM instance in a developer console. The problem is that this instance has a size of 0 bytes, and, obviously, does not work.

It looks like I am not the first one to run into this issue, but there was no response to that question. Hopefully, this time someone knows how to answer it.

Here is the contents of app.yam, if it matters:

runtime: java7
vm: True
module: 'backend'
automatic_scaling:
  min_num_instances: 1
  max_num_instances: 20
  cool_down_period_sec: 60
  cpu_utilization:
    target_utilization: 0.75
inbound_services:
- warmup
threadsafe: True
auto_id_policy: default
health_check:
  enable_health_check: True
resources:
  cpu: 0.5
  memory_gb: 1.3
  disk_size_gb: 10.0
api_version: '1.0'
handlers:
- url: /
  script: unused
  login: optional
  secure: optional
- url: /_ah/.*
  script: unused
  login: optional
  secure: optional
- url: /z
  script: unused
  login: optional
  secure: optional
- url: .*\.jsp
  script: unused
  login: optional
  secure: optional
- url: /.*/
  script: unused
  login: optional
  secure: optional
- url: /z/.*
  script: unused
  login: optional
  secure: optional
Community
  • 1
  • 1
Andrei Volgin
  • 40,755
  • 6
  • 49
  • 58

2 Answers2

0

From Configuring the VM Environment:

There are two kinds of configuration files. Which one you use depends on the language you are using and whether you are using standard or custom runtimes:

Use appengine-web.xml for:

  • Modules running the Java standard runtime
  • Modules using a custom runtime based on the Java standard runtime (gcr.io/google_appengine/java-compat base)

Use app.yaml for:

  • Modules running the Python and Go standard runtimes
  • Any module running in a custom runtime that is not based on the Java standard runtime

Since you're Java runtime, you need to be using appengine-web.xml, not app.yaml.

From Testing and deploying managed VMs:

These sample Java projects are available:

Java Hello World Quickstart

The instructions on the Hello World Quickstart github project use maven to deploy. From the README:

mvn gcloud:deploy
Doug Richardson
  • 10,483
  • 6
  • 51
  • 77
  • From the documentation: If you use the gcloud app deploy command, remember that before you can run or deploy a Java app, you must compile the source code, and use your preferred Java tooling to generate a WAR directory. You must also migrate the contents of your WAR directory to `a set of yaml files` using the stage action of the appcfg command. – Andrei Volgin Dec 29 '15 at 04:12
  • The documentation here looks out of date; please try using the Maven gcloud plugin or a similar supported solution. – Zachary Newman Jan 11 '16 at 16:41
  • Documentation page says that it was updated December 22, 2015 - only a few days before my question. – Andrei Volgin Jan 13 '16 at 17:45
0

I opened a support ticket with Google, and the issue has been resolved in the new version of gcloud.

Andrei Volgin
  • 40,755
  • 6
  • 49
  • 58