1

For my google cloud project I want to update ONLY my app.yaml file, I do not want to deploy all of the files in my project. Can I just run gcloud app deploy app.yaml? I'm worried it will deploy all of my files and I'm not in a good position to do that at the moment. I can't find documentation that assures me this is what I want.

UPDATE: What I actually want is to be able to update my instance_class & automatic_scaling params without deploying my project.

ctown4life
  • 835
  • 1
  • 11
  • 24
  • Found a related question that doesn't look encouraging since I am in the standard environment. https://stackoverflow.com/questions/40552820/can-i-update-only-app-yaml-file-without-uploading-all-project – ctown4life Oct 06 '20 at 18:40
  • Why do you want to do this. What have changed in your app.yaml to redeploy only it? – guillaume blaquiere Oct 07 '20 at 07:40
  • I want to change the instance class and automatic scaling params. The only way I know to do that is with app.yaml. Is there another way? – ctown4life Oct 08 '20 at 00:43

4 Answers4

2

Donnald C pointed me in the right direction and I found documentation with an online API Explorer that helps you setup and execute a patch to your config.

https://cloud.google.com/appengine/docs/standard/php/config/setting-autoscaling-params-in-explorer

ctown4life
  • 835
  • 1
  • 11
  • 24
1

To change only few parameters, the scaling parameters or the instance class for example, you can use the path REST api.

You can't use the regular gcloud CLI for this, you need to build your own REST request, with the correct body and then patch it. It's a lot of effort instead of a simple gcloud app deploy, but it works!

guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76
1

On your case, here's an example and run this command via Cloud SDK or Cloud Shell:

This command is applicable to a GAE app with automatic scaling and it will update your minimum instances to 3 and instance class to F4. Just be sure to update PROJECT-ID, SERVICE, and VERSION with your app information.

 curl -X PATCH -H "Content-Type: application/json" \
 -d "{ 'automaticScaling': { 'standardSchedulerSettings': { 'minInstances': 3 } }, 'instanceClass': 'F4' }" \
 -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
 https://appengine.googleapis.com/v1/apps/PROJECT-ID/services/SERVICE/versions/VERSION?updateMask=automaticScaling.standard_scheduler_settings.min_instances,instanceClass

Here's a reference to patch.

Donnald Cucharo
  • 3,866
  • 1
  • 10
  • 17
  • This is great. Your reference to patch took me to an API Explorer that was really helpful in stepping me through all of the params I wanted to update. Thanks! – ctown4life Oct 11 '20 at 00:21
0

It's not possible change deployed versions. If you modify something in your app.yaml no matter how minimal is the change, it's necessary deploy again since the yaml file acts as a deployment descriptor of a specific service version and all the app will be uploaded again with the command gcloud app deploy.

If you don't want to deploy again because of the downtime that the service will have, I recommend you use traffic splitting to specify a percentage distribution of traffic across two or more of the versions within a service. For example, in this case, you can deploy your new app version (NV) while the last version(LV) deployed is receiving all the traffic. Once that the NV is deployed, you can migrate all the tragic to this one. To prevent traffic from being automatically routed to the new version, use the --no-promote flag.

Andie Vanille
  • 820
  • 5
  • 14
  • You don't even need traffic splitting. Just deploy to a new version, and then migrate all traffic to the new version. – new name Oct 06 '20 at 23:01