Multiple Services In Google App Engine Python 3.7
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.emain:update, notmain::updateormain.update. This assumes you have anupdate/main.pyfile defining your WSGI-compatible application calledupdate(if the application is calledappinstead then you'd usemain:app) - in one example you have
binstead 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.pyfile with a WSGI-compatible object calledapp.app.yamldoes not contain the entrypoint field.- Your app does not contain
PipfileorPipfile.lockfiles.
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"