When deploying my app in flexible environment getting error beta setting machine_type cannot be set in an App Engine Flexible Environment - google-app-engine

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 ??

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

Related

Google app engine working but i cannot see how many instances are UP

I have created an Node application running on Google App engine. It is successfully working but I cannot see how many instances are running it is showing 0 instances are up but the webpage is served successfully. I tried to increase the load so that via apache2 benchmark but still it is showing '0 instances are up'. I am using this via my GCP trial account
here is my yaml file contents.
runtime: nodejs14
instance_class: F2
env_variables:
BUCKET_NAME: "your-ng-app-bucket"
handlers:
- url: /
static_files: dist/sample/index.html
upload: dist/sample/index.html
- url: /
static_dir: dist/sample
automatic_scaling:
min_instances: 0
max_instances: 3
target_cpu_utilization: 0.6
screenshot of autoscaling in appengine
I wanted to know why i am unable to view the instances i just wanted to know how many instances are running during normal usage. It is always 0

Google App Engine error when use opencensus ext

WARNING: [pool app] child 29 said into stderr: "php-fpm: pool app: symbol lookup error: /opt/php73/lib/x86_64-linux-gnu/extensions/no-debug-non-zts-20180731/opencensus.so: undefined symbol: ZVAL_DESTRUCTOR"
I using GAE env flex. today GAE use php7.3-fpm and i got that error. I check other website in GAE using php7.2-fpm working normally.
How can i fix problem.
Inside your app.yaml you should set the runtime:
env: flex
runtime: php
On your composer.json file you should specify the version that you want to use, for example if you want to use php 7.2 instead of 7.3:
{
"require": {
"php": "7.2.*"
}
}
It's important to specify said version otherwise the runtime might upgrade inadvertently into a new version as mentioned in the official documentation
By default, the PHP runtime uses PHP 7.2, but you should explicitly
declare your PHP version in the composer.json file to prevent your
application from being automatically upgraded when a new version of
PHP becomes available.
env: flex
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 1
disk_size_gb: 10
runtime_config:
document_root: public
# Ensure we skip ".env", which is only for local development
skip_files:
- .env
- .git
- /vendor/
- /node_modules/
env_variables:
# Put production environment variables here.
APP_LOG: errorlog
APP_KEY: **App_Key**
APP_NAME: Application
APP_ENV: production
APP_DEBUG: true ```

Google cloud platform not recognizing instance in app.yaml

I'm trying to create a new environment on google cloud platform. It's not recognizing my instance class... and giving the error Instance class (n1-standard-1) is not recognized
entrypoint: gunicorn -b :$PORT presto.wsgi
env: flex
runtime: python
instance_class: n1-standard-1
runtime_config:
python_version: 3
n1-standard-1 is given from google's documentation so I'm not sure what's wrong here. Does it go by a different name? Thanks!
For the python flex environment, the resource config is defined in a different way.
To get the same machine as a n1-standard-1, you must add the following resource definition in your app.yaml:
resources:
cpu: 1
memory_gb: 3.75

Google cloud appengine 1.9.54 Release

We are deploying ASP.NET Core application on Appengine Flex and in Instances Summary on Dashboard page appears strange 1.9.54 appengine release as well as Flex release. What that might be?
Our app.yaml:
env: flex
runtime: aspnetcore
resources:
cpu: 8
memory_gb: 14.4
automatic_scaling:
min_num_instances: 8
max_num_instances: 20
cool_down_period_sec: 180
cpu_utilization:
target_utilization: 0.5
Your app's dashboard summary indicates your app has both:
standard env GAE instances (1.9.54 being the version of the GAE sandbox/infra running those instances), possibly from older service version(s) not yet deleted
flexible env GAE instances
You can play with the Service and/or Version selection boxes above the summary to identify which service/version those instances correspond to.

Protecting cron scheduling endpoint on AppEngine (Flexible Environment)

I am trying to get my dataflow job scheduled via cron.yaml in an AppEngine flexible environment. This works flawlessly when I leave my endpoint unprotected. However, when trying to secure the endpoint, I see 403 status responses, even when triggering it from within the TaskQueues interface.
My app.yaml looks like this:
runtime: java
env: flex
handlers:
- url: /.*
script: this field is required, but ignored
- url: /dataflow/schedule
script: this field is required, but ignored
login: admin
runtime_config:
jdk: openjdk8
resources:
cpu: .5
memory_gb: 1.3
disk_size_gb: 10
manual_scaling:
instances: 1
Secure handlers (like login: admin) do not work on App Engine Flexible, that is why the 403.
For securing that handler, you can check the request header "X-AppEngine-Cron" in your app, which is a trusted header only set by traffic coming from App Engine.

Resources