Deploy node application to Google App Engine standard environment - node.js

Until december 2016, I was able to deploy node applications to Google App Engine standard environment with an app.yaml looking like this:
runtime: nodejs
vm: true
api_version: 1
manual_scaling:
instances: 1
Now, when I do this to deploy to a new project, I get this error message:
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: Deployments to App Engine
Flexible require 'env: flex' in app.yaml. The 'vm:true' setting has
been deprecated.
But I'm still able to deploy with this configuration for existing projects.
Has something changed recently in Google App Engine for Node.js ? (I don't know when reading the error message if standard environment is deprecated, or if for some reason it considers I chose to deploy to a flexible environment, and so I can't use vm:true because this option is deprecated for flexible environments).

The vm: true indicates you were actually deploying to the flexible environment (an earlier version). The standard environment never supported node.js apps, see https://cloud.google.com/appengine/docs.
Yes, there was a change in the flexible environment (all languages, not only node.js). See Upgrading to the Latest App Engine Flexible Environment Beta Release. From there, explaining why your existing apps still work:
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.
UPDATE:
Node.JS is currently available in the standard environment as well, see:
Now, you can deploy your Node.js app to App Engine standard environment
Google App Engine Node.js Standard Environment Documentation

Related

Puppeteer not working in Google App Engine?

error while loading shared libraries: libnss3.so cannot open shared object file
I want to deploy my puppeteer app on google app engine since it says their node.js environment supports the puppeteer however
I get still get this error.
What do I need to do?
Puppeteer requires custom libraries, so you need to make sure you are using the custom environment in your app.yaml:
runtime: custom env: flex
You can find a similar issue in this Github thread.
You also need to check the App Engine documentation for your language that describes dependencies specification to make sure your steps are aligned with the guidelines.
If you are using the App Engine Standard environment, the Node.js runtime of the App Engine standard environment comes with all system packages needed to run Headless Chrome.
To use puppeteer, simply list the module as a dependency in your package.json and deploy to Google App Engine. Read more about using puppeteer on App Engine by following the official tutorial.

Why are Cloud Function Runtime Environment Variables being deleted on deploy?

I recently (2 days ago) upgraded the node runtime engine on our Cloud Functions instance from Node 10 to 12. (Not sure that is a factor, but it is a recent change.)
Since the upgrade I have been using the Cloud Functions project without trouble. Today is the first time I have done a deploy SINCE the deployment to change the node engine. After I did the deploy, ALL of the Runtime Environment Variables were deleted except one labeled FIREBASE_CONFIG.
As a test, I added another test environment variable via the Cloud Functions console UI. I refreshed the page to ensure the variable was there. Then, I ran another deploy, using this command:
firebase use {project_name} && firebase deploy --only functions:{function_name}
After the deploy completed, I refreshed the environment variables page and found that the test variable I had created was now missing.
I'm quite stumped. Any ideas? Thank you!
It is true that the Firebase CLI manages enviroment configuration and does not allow us to set the ENV variables of the runtime during deployment. This has been explained on other post as well, like this one.
I guess you are aware of the difference between the Cloud Functions Runtime Variables and the Firebase Environment configuration, so I will just leave it here as a friendly reminder.
Regarding the actual issue (New deployments erasing previously set "Cloud Functions Runtime Variables"), I believe this must have been something they fixed already, because I have tested with version 9.10.2 of the firebase CLI, and I could not replicate the issue on my end.
I recommend checking the CLI version that you have (firebase --version) and, if you still experience the same issue, provide us with the steps you took.

Memcache in Google App Engine Standard environment for NodeJS [duplicate]

How does one access memcache from the nodejs standard environment?
The documentation apparently makes no reference to the App Engine memcache being available to the Node.JS standard environment, at least not at this time:
there is no Node.JS language tab in the Memcache Overview page(s)
there is no Caching Application Data section (under which the memcache-related docs exist for the other languages) under How-to Guides in the left-side navigation bar for Google App Engine Node.js Standard Environment Documentation
But there may be an alternative. From APIs & Reference:
Which leads to Node.js Packages, where I can see:
Which leads to Cloud Redis: Node.js Client.
This is inline with the suggestions from the Memcache section of the Migrating Services from the Standard Environment to the Flexible Environment guides, the flexible environment having the same problem (except clearly documented):
The Memcache service is currently not available for the App Engine
flexible environment

Is it possible to use Node.js v8 on Google Kubernetes Engine after October 1, 2019?

A month ago, I recieved a message from GPC support. It said that App Engine would stop Node.js v8 deploy support on October 1, 2019. Is it possible to continue using Node.js v8 on Google Kubernetes Engine after October 1, 2019?
I don't see any problems if you're creating your own docker image for K8s, I guess you can run any version of node.js
The answers of Luca & Thrahir are correct, I will still try to expand some more.
The Node.js foundation will stop maintaining “Node 8.x” on January 2020 [1], and Google Cloud Platform’s “AppEngine” stopped deploying these apps on October 1 [2].
So if your app is deployed to AppEngine, it won’t be able to deploy if not upgraded to Node 10.
But if your app is running in an environment that you set up inside a GKE cluster, it will continue to work.
And alternatively you could also look into AppEngine’s Flexible environment for Node.JS [3].
I hope you find this information useful, and best of luck!
[1] https://github.com/nodejs/Release
[2] https://cloud.google.com/appengine/docs/standard/nodejs/release-notes#june_27_2019_2
[3] https://cloud.google.com/appengine/docs/flexible/nodejs/
Google Cloud Kubernetes Engine is based in Google Cloud Compute engine [1], therefore I believe it has a different implementation than App Engine [2]. In my opinion there will be no problems if you decide to move your workloads to GKE.
[1] https://cloud.google.com/kubernetes-engine/docs/concepts/kubernetes-engine-overview
[2] https://cloud.google.com/appengine/docs/standard/

How to access memcache on App Engine Nodejs Standard

How does one access memcache from the nodejs standard environment?
The documentation apparently makes no reference to the App Engine memcache being available to the Node.JS standard environment, at least not at this time:
there is no Node.JS language tab in the Memcache Overview page(s)
there is no Caching Application Data section (under which the memcache-related docs exist for the other languages) under How-to Guides in the left-side navigation bar for Google App Engine Node.js Standard Environment Documentation
But there may be an alternative. From APIs & Reference:
Which leads to Node.js Packages, where I can see:
Which leads to Cloud Redis: Node.js Client.
This is inline with the suggestions from the Memcache section of the Migrating Services from the Standard Environment to the Flexible Environment guides, the flexible environment having the same problem (except clearly documented):
The Memcache service is currently not available for the App Engine
flexible environment

Resources