Are requirements.txt entries for Python Flex service installed upon deployment, or upon scaling?

46 views
Skip to first unread message

Nickolas Daskalou

unread,
Mar 2, 2017, 7:25:09 PM3/2/17
to Google App Engine
Hi,

For Python runtimes on App Engine flex, are the entries in requirements.txt installed by pip during the deployment process (and then stored in a saved image, whereby that image is then simply duplicated when needing to scaling out), or are they installed by pip during a scale out event (i.e. when the App Engine scheduler decides it needs a new instance of a service)?

Thanks,
Nick

Nicholas (Google Cloud Support)

unread,
Mar 3, 2017, 5:06:00 PM3/3/17
to Google App Engine
As I understand it, the python runtime in the flexible environment is essentially using the gcr.io/google-appengine/python docker image referred to in the custom runtime documentation except with an ENTRYPOINT specified in the app.yaml.  We can see in the linked Dockerfile repository that 'pip install -r /app/requirements.txt' is executed with RUN which occurs at build time, thus before the image is run as a container.

If this was otherwise done when instances were created, it would add significant start up time and run the risk of having inconsistent application containers as dependencies fetched at a later time may result in different packages if versions are not explicit.
Reply all
Reply to author
Forward
0 new messages