Google App Engine Java Backend app version - google-app-engine

I'm new to GAE Java backends and I'm unsure how backends relate to the application versions. I have read the GAE documentation and searched a lot and found nothing that would help.
My questions are:
How is the application version running in the backend selected from the deployed versions? Is it selected exactly like in the frontend, i.e. new backend instances use the default version by default?
If it is so, then what does command appcfg backends update [backend] update exactly? Just the configuration files?
I really think this should be made more clear in the GAE docs.
Thanks.

Backends do not have versions:
You can select default version for frontend instances in Admin console, but you can not do this for backends.
Changing default version of frontend instances does nothing for backend instances.
Backends only have one version - the latest updated via appcfg.
So when you change code that affects both frontend and backend instances, you need to upload it twice.

Related

How to deploy React webapp deployed on Docker and GCP only for a set of users

I want to achieve something that Google Play store offers i.e. releasing app to a set of users and the rest of users will keep seeing the existing app.
Is there a way to achieve this with a web app deployed using Docker and GCP?
Someone shared an interesting article about Canary build.
Canary Deployments are where you roll out the new version of your service while keeping the older one alive. Some customers will be routed to the new version while others will be routed to your existing version.
https://stackify.com/canary-deployments/

Local or development Google Cloud Firestore database with App Engine

In my previous App Engine projects I used the Cloud Datastore, and during development I could debug my app on the local server and it would use a local database, stored in a file I could wipe out if I wanted to start from scratch.
With Cloud Firestore, even when I'm running locally it's talking to my real cloud database. Is there still a local option? Note that I'm not talking about client-side persistence, I'm talking about a mock development DB.
Google recommends setting up multiple projects if you want dev/staging/production, and I'm guessing that's the answer, but I'd like to know before adjusting my workflow.
I think (now only a few months later) that this is supported. When I run my app, using dev_appserver.py, I see a message
INFO 2019-02-14 00:08:56,030 admin_server.py:150] Starting admin server at: http://localhost:8000
Going to that URL shows me all the instances I have been seeing. These seem to persist even when the dev_appserver is restarted. Reading this and other posts I was convinced that my development was using my actual cloud database, but going to https://console.firebase.google.com/project/myproject was showing completely different content.
Just to be sure (because google is google and everything is named the same) I'm using an appengine app and a gcloud project, storing things to Firestore using ndb.Models...
Oh, but careful. My app I was also using the cloudstorage (blobstore?) and even though the localhost:8000 showed these, THESE WERE THE REMOTE INSTANCES.
There is a local emulator for Firestore when using the Firebase CLI:
https://firebase.google.com/docs/rules/emulator-setup

Is it possible to get a list of App Engine instances via gcloud?

The title says it all. Just to irritate DRY purists, I'll say it again.
Is it possible to get a list of instances my application is running on via gcloud?
In 2019, You can check the newest document : gcloud app services list - list your existing services
The newest command is:
gcloud app services list
The result will be something like this.
SERVICE NUM_VERSIONS
default 7
App Engine can mean traditional App Engine or Managed VMs, depending on the context. There is only one App Engine app per project, but you can have multiple modules (although only one of those module will serve web traffic, the rest are backend only) and multiple versions of each module.
As pgiecek mention,
gcloud preview app modules list
will show all the modules.
What you might be looking for is all your App Engine versions, for which you will still have to use appcfg
appcfg.py -A <your-project-id> [-M <module>] list_versions
If you are using Managed VMs, it will spin up your app on GCE instances, in which case
gcloud compute instances list
does in fact show your App Engine (MVM) instances.
It seems that currently it is not possible. At the moment gcloud tool supports App Engine (via Preview CLI command groups) but provides only limited number of operations and furthermore they are in BETA. You can check documentation here.
You can only list your existing deployed modules and versions as follows.
gcloud preview app modules list
As of Sep 2019 (Google Cloud SDK 237.0.0):
gcloud app instances list

Google Cloud Storage Client not working on dev appserver

I 'm building an AppEngine application that stores data in Google Cloud Storage. I use the Google Cloud Storage Client (GCS) library as suggested.
My app is working when deployed on AppEngine (reading/writing/listing objects) but I cannot make it work on the development server. The development server keeps returning error 404 and GCS raises NotFoundError. The dev-appserver is supposed to emulate the cloud storage functionality without any specific configurations etc. I see in the log files that the dev server is accepting requests at "/_ah/gcs" yet it seems that there is no handler for that url. I 've tried with version 1.8.5 and 1.8.6. Apart from my app, not even the demo app provided by Google works.
Is there something that I 'm missing here, e.g. a special configuration for the dev-appserver?
Sorry the following change was pushed out too early by mistake. It only works with 1.8.8 SDK. We are streamlining the release process of gcs client to align with SDK. Sorry
https://code.google.com/p/appengine-gcs-client/source/detail?r=125
Without this change, it works on 1.8.7 SDK.

Port a live system from App Engine Helper to App Engine Patch

I am running a live system that is currently serving about 20K pages a day which is based on App Engine Helper (Python) with session support provided by AppEngine utilities.
One problem that I have been having is that sessions are occasionally randomly logging out. I would like to try using the App Engine Patch, since it has "native" django session support, but I am worried that this is possibly going to be like doing a brain transplant. Specifically, current database models are all inhereted from BaseModel provided by the App Engine Helper. While, App Engine Patch does not have this inheritance.
Does anyone know if it is possible to migrate a live system from App Engine Helper to App Engine Patch? If so, do you have any advice or warnings that I should heed, before attempting this transition?
Thank you and kind regards
Alex
After further investigations, I discovered that newer versions of Django and App Engine Helper have built in support for sessions. After migrating to this system, my problems of randomly losing sessions have been resolved.
Alex
You should think about porting your system not to App Engine Patch but to Django-nonrel (by app-engine-patch authors).
I moved from google-app-engine-django and app-engine-patch to Django-nonrel is because first two are not maintained any more.

Resources