Skip to content Skip to sidebar Skip to footer

Multiple Services In Google App Engine Python 3.7

I have an application that ran fine under the Python 2.7 Standard framework, and runs fine as two separate applications in the 3.7 framework, but I can't figure out how to configur

Solution 1:

Looking at what you described and assuming you are aiming for a directory structure similar to the one mentioned in the Example section of the doc you referenced I see a few problems.

You still have code in the app's top/root directory, above the services' directories - the main.py and app.yaml files - such code isn't accessible to the services. The app.yaml file in particular may actually cause problems as it might accidentally be interpreted as the .yaml file of a single-service app. I'd get rid of these files.

I would only keep in the app's top-level dir app-level optional config files and, if applicable, files intended to contain code shared by multiple services, which I would symlink inside each of the services sharing the code, see Sharing entities between App Engine modules

In the update/app.yaml file you're using the wrong syntax for the entrypoint configuration:

  • you should have a single: delimiter between the module name and the WSGI app variable name, i.e main:update, not main::update or main.update. This assumes you have an update/main.py file defining your WSGI-compatible application called update (if the application is called app instead then you'd use main:app)
  • in one example you have b instead of -b

You don't have an entrypoint defined in the app/app.yaml file. Most likely your default service meets the conditions in which a default entrypoint is automatically added, see Application startup:

  • The root of your app directory contains a main.py file with a WSGI-compatible object called app.
  • app.yaml does not contain the entrypoint field.
  • Your app does not contain Pipfile or Pipfile.lock files.

Personally I prefer to not rely on this default behaviour, I'd explicitly add the entry point:

entrypoint: gunicorn -b :$PORT main:app

Post a Comment for "Multiple Services In Google App Engine Python 3.7"