How to pass service/module version when running services/modules with dev_appserver.py in gcloud environment

129 views
Skip to first unread message

PK

unread,
Jun 25, 2017, 8:44:34 PM6/25/17
to Google App Engine
I am transitioning from the SDK/appcfg.py to gcloud and hit the following issue that seems to need clarification. In the SDK, one specifies the application and the version in the configuration yaml file. Both appcfg and dev_appserver.py pick it from there and everything works as expected.

"gcloud deploy" and friends do not want application: and version: entries in the yaml file. No problem there, I now pass them in the 'gcloud deploy' command line. dev_appserver.py has a -A option and I also pass the application id there. However, there seems to be no way to pass the module/service version number to dev_appserver.py.

Am I missing something or this is still WIP? As a workaround I now generate two sets of yaml files, one with version for dev_appserver.py and one without for 'gcloud deploy' but I would expect to be a better way.

Thanks,
PK

PS My code uses the modules module version information APIs; if I do not pass a version in the development environment it returns 'None' which make things fail.

Yannick (Cloud Platform Support)

unread,
Jun 26, 2017, 12:03:58 PM6/26/17
to Google App Engine
Hello PK,

You are correct, there is an inconsistency in how the local development server and the gcloud command line interface handle versions and services. If you want to you can create a feature request for either component's behavior and functionality to be changed.

As an potential additional workaround, depending on how much of the Modules API you are using, could you use the "--env_var ENV_VARIABLES" command line option for dev_appserver.py and pass the version information you need to your program that way when testing?

PK

unread,
Jun 26, 2017, 7:53:04 PM6/26/17
to google-a...@googlegroups.com
wrt "could you use the "--env_var ENV_VARIABLES" command line option “ What environment variable should I pass for the version in dev_appserver? I tried a few obvious options but did not work.

Thanks


-- 
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/ET5WW9yx2O4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/650553bd-47cf-431a-b058-011b6db6f3fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yannick (Cloud Platform Support)

unread,
Jun 27, 2017, 9:13:39 AM6/27/17
to Google App Engine
There are no specific environment variables you should use, as you would need to implement this behavior yourself. Sorry if that wasn't clear.

What I meant is that you could omit the version and service from app.yaml for both gcloud and dev_appserver and have your code check if environment variables that you defined are set and if so skip on using the Modules API. You would of course only do this on the local dev server. On production that environment variable check would fail and you would simply use the Modules API.

On Monday, June 26, 2017 at 7:53:04 PM UTC-4, PK wrote:
wrt "could you use the "--env_var ENV_VARIABLES" command line option “ What environment variable should I pass for the version in dev_appserver? I tried a few obvious options but did not work.

Thanks

David Nicholson

unread,
Jul 7, 2017, 1:46:58 PM7/7/17
to Google App Engine
Hi PK, Yannick,

This does seem like an oversight, and I don't see a way to pass this information in via gcloud without doing something like what Yannick has suggested. We should add an equivalent flag option to the devappserver to support service versioning. Stay tuned on this thread, and we'll post updates here.

Cheers,
Dave

PK

unread,
Jul 7, 2017, 3:45:56 PM7/7/17
to Google App Engine
I agree and look forward to proper resolution. Thank you Dave!!

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/ET5WW9yx2O4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.

PK

unread,
Jul 7, 2017, 3:52:46 PM7/7/17
to Google App Engine
I filed this issue about this: https://issuetracker.google.com/issues/63445280
Reply all
Reply to author
Forward
0 new messages