35

How do App Engine version numbers work? Are they only integers? Can I use floats? Can I reuse old version numbers?

Moshe
  • 57,511
  • 78
  • 272
  • 425
  • Going by the error message, it has to match expression '^(?:^(?!-)[a-z\d\-]{0,62}[a-z\d]$)$'. If I'm reading the regexp correctly, it means that it can contain lowercase letters, digits, and hyphens, be 1 to 63 characters long, and not start with a hyphen. So you can't use floats like 1.1, but you can use 1a, 1b... or 1-1, 1-2.... And you can reuse old version numbers, it just means that you'll overwrite that old version instead of overwriting the latest version. – ShreevatsaR Nov 06 '13 at 06:14

3 Answers3

48

From the manual:

http://code.google.com/appengine/docs/python/config/appconfig.html#Required_Elements

A version specifier for the application code. App Engine retains a copy of your application for each version used. An administrator can change which major version of the application is default using Administration Console, and can test non-default versions before making them default. The version specifier can contain letters, digits, and hyphens.

Each version of an application retains its own copy of app.yaml. When an application is uploaded, the version mentioned in the app.yaml file being uploaded is the version that gets created or replaced by the upload.

Wolph
  • 78,177
  • 11
  • 137
  • 148
  • @Henrik P. Hessel: your answer still has some merit though. Atleast prefixing with integers makes sorting a lot easier for your own management :) – Wolph Oct 03 '10 at 01:18
  • I never used anything else than Integers on the GAE. Using A, B, C and so on (or even strings) just doesn't feel natural. – Henrik P. Hessel Oct 03 '10 at 01:19
  • 2
    Note that if using letters, they must be lower case. For example, capital 'X' version will fail with this message: `Unable to assign value 'X' to attribute 'version': Value 'X' for version does not match expression '^(?:^(?!-)[a-z\d\-]{0,62}[a-z\d]$)$'` – ocarlsen Apr 16 '13 at 23:38
  • @Wolph when I create a new Version (2) and deploy it i see activity on it. However I still see activity on the previous version Version 1(default) even after I manually shut down all Version 1 instances – MobileMon Feb 05 '15 at 12:53
  • As long as the old version is the default it will automatically respawn. If you make the new version the default it should die out eventually. – Wolph Feb 05 '15 at 12:56
7

In order to access a version of your app other than the default one, add #. before your app url as explained here: https://stackoverflow.com/a/8549546/129202 This is useful for testing new versions before you make them live.

If the version of app is 2 and your app URL is appname.appspot.com then URL 2.appname.appspot.com will give you access to version 2 of your app.

Community
  • 1
  • 1
Jonny
  • 15,955
  • 18
  • 111
  • 232
  • 3
    Please note google has changed the way versioned URLs work. You should instead use `2-dot-appname.appspot.com` , otherwise you'll get a security warning. –  Jan 01 '15 at 16:28
  • It seems even if you delete the version1 of your app it doesn't assign the default url to version 2. – Soundararajan Apr 03 '15 at 07:39
4

You can increment it when you pushing a new release. See below for reference.

When you build a new major release of an application that is already running on App Engine, you can upload the new release as a new version. The old version will continue to serve users until you switch to the new version. You can test the new version on App Engine while the old version is still running.

Edited: Didn't remove my answer because there're some good comments on it.

Henrik P. Hessel
  • 36,243
  • 17
  • 80
  • 100
  • 1
    That's incorrect. You can use letters, digits and hyphens in the version. No need for integers. – Wolph Oct 03 '10 at 01:11
  • 1
    For the GAE app that I have in SVN, I use the repository revision number. If I was using git I suppose I'd use a checksum, in which case I'd prefix it with what you suggest, an integer incremented for each release uploaded. – Steve Jessop Oct 03 '10 at 01:53
  • Even after pushing out a new release with a new version and manually shutting down all old instances, for some reason app engine keeps recreating the old version – MobileMon Feb 05 '15 at 12:54