0

Configuring different versions of the same service differently in GAE Standard

I deploy multiple versions of the same service and want them to be configured differently. For example, the test version of a service should run on lower-spec instances (& no idle instances) than the prod version of the same service.

Since both deployments share the same appengine-web.xml, how do I maintain & use different versions of this configuration file?

On an earlier project I had resorted to having separate appengine-web.xml.test and appengine-web.xml.prod versions in Git (appengine-web.xml itself was .gitignore-d). Then I wrote a simple build program which would overwrite appengine-web.xml with the appropriate version, then run the build and deployment commands. This was using the AppEngine SDK.

On my current project I am using the GCloud SDK. Is a better/simpler solution possible?

markvgti
  • 4,321
  • 7
  • 40
  • 62

1 Answers1

2

From the deployment perspective different versions of the same service do not technically share the appengine-web.xml file, they each have their own copy of the file reflecting the content of the local file version at the time the respective version was deployed. The very version of the service itself can actually be configured in the file, in case you have doubts.

So it's really up to you how you manage the file versioning in the workspace/repository from where you're deploying the service.

You earlier script is one way of doing it.

Another possibility would be to have different versions of the file in different, per-environment branches. A more detailed description can be found in this post (it's about app.yaml, it's true, but it's the same general idea): Google Cloud App Engine app.yaml for multiple environments

Side note: personally I'd suggest using different applications to implement different environments, not just different versions and/or services, see:

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
  • I had tried the one-branch-per-version method, but the issue was that with every merge I had to deal with the conflicting versions of the (for example) `appengine-web.xml` file. How do you reduce friction from this issue? – markvgti Oct 30 '18 at 04:35
  • The conflicts only show when there are actual changes in the lines that are different in the 2 branches. In my experience the file and particularly those lines don't change that often. Also, in most cases, fixing the conflicts is rather mechanical - I never picked the ones from upstream unless I start using a new GAE feature which I need to configure differently, which again, is rather rare. Personally I prefer this to the risk of the files diverging in the areas that I do want kept in sync, which you'd have to handle manually with 2 different files. – Dan Cornilescu Oct 30 '18 at 09:31