0
votes

When trying to deploy my app engine using flexible environment then i am getting error.

ERROR: (gcloud.preview.app.deploy) INVALID_ARGUMENT: 
The beta setting machine_type cannot be set in an App Engine Flexible Environment deployment.

My app.yaml is given below

runtime: nodejs
#vm: true
env: flex

# [END runtime]

network:
  instance_tag: app-tag
  name: network-tag

instance_class: F1
automatic_scaling:
  min_num_instances: 1
  max_num_instances: 2
  cool_down_period_sec: 60

beta_settings:
  machine_type: f1-micro

handlers:
- url: /.*
  script: IGNORED
  secure: always

# Temporary setting to keep gcloud from uploading node_modules
skip_files:
- ^node_modules$

Also can anyone please tell me what is the difference between vm: true and env: flex because both set app engine environment to flexible ??

1

1 Answers

1
votes

When changing from vm: true to env: flex you're actually switching to the latest infra version, see Upgrading to the Latest App Engine Flexible Environment Beta Release.

The machine type is no longer configured that way. Instead you'd configure a custom instance shape via its resources:

Resource settings

These settings control the computing resources. App Engine assigns a machine type based on the amount of CPU and memory you've specified. The machine is guaranteed to have at least the level of resources you've specified, it might have more.

You can specify up to eight volumes of tmpfs in the resource settings. You can then enable workloads that require shared memory via tmpfs and can improve file system I/O.

For example:

resources:
  cpu: 2
  memory_gb: 1.3
  disk_size_gb: 10
  volumes:
  - name: ramdisk1
    volume_type: tmpfs
    size_gb: 0.5