App Engine Flexible Environment Deployed Version Management

87 views
Skip to first unread message

Maha Farhat

unread,
Jan 20, 2022, 7:58:21 AM1/20/22
to Google App Engine
Hi,
We use App engine Flexible environment for executing long running asynchronous tasks.
When we make changes to the app and deploy a new version using the command: "gcloud app deploy app.yaml", it deploys the new version routes 100% traffic to the newly deployed version, and stops the old version. This results in the failure of any request that was in process on the old version.

We have tried keeping the old version alive by using the flag --no-stop-previous-version but in this case, even after the new version is deployed and the latest version is serving 100% requests the new request keeps getting served by the older version. 1. Is there a way to keep the old version running until the requests it is processing are completed? 2. How to make sure in the 2nd scenario that all the new requests after new deployment are served by the latest version instead of the old one?

Thanks,

David (Cloud Platform Support)

unread,
Jan 20, 2022, 2:32:46 PM1/20/22
to Google App Engine

You can deploy it this way:

1-gcloud app deploy --no-promote -v

2-gcloud app services set-traffic <yourservice> --splits <yourversion>=1

By using the no promote flag, when you perform a deployment, the new version won’t directly serve traffic. Then, you could choose how much of the traffic you want to be sent by using set traffic.

If let’s say you want to send 50% of your traffic, you could do this:

gcloud app services set-traffic <yourservice> --splits <v1>=.5,<v2>=.5

You could gradually send all traffic to the new version if that works better for your use case.

You could also do this within the UI.

Maha Farhat

unread,
Jan 21, 2022, 8:23:50 AM1/21/22
to Google App Engine
Hi David, 

Thanks for this suggestion, 
As I mentioned we are using App Engine Flex Environment, 
even using the command: "gcloud app services set-traffic <yourservice> --splits <yourversion>=1" does not send traffic to the newer version which after running this command is supposed to be serving 100 % traffic. All the requests are still getting served by the previously deployed version of the app engine.

What could be the possible issue in this case?

sivara...@google.com

unread,
Jan 21, 2022, 10:47:40 AM1/21/22
to Google App Engine

I have found some documents with respect to Migrating traffic and Splitting traffic for App Engine Flex:


Hope this helps rectify the situation.
Reply all
Reply to author
Forward
0 new messages