Skip to content
This repository was archived by the owner on Jan 12, 2022. It is now read-only.

Commit 6dfcbba

Browse files
committed
update README and Dockerfile
1 parent cf6a30e commit 6dfcbba

3 files changed

Lines changed: 80 additions & 173 deletions

File tree

README

Lines changed: 0 additions & 172 deletions
This file was deleted.

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
Google Managed VMs Python Runtime
2+
3+
Warning
4+
=======
5+
6+
The instructions here are for a multi-process version of the Python 2.7 runtime
7+
**currently in alpha**. Please do not use this version for production workloads.
8+
To use the stable version of the runtime, follow the documentation at
9+
https://cloud.google.com/appengine/docs/managed-vms/ instead.
10+
11+
Contents
12+
========
13+
14+
* Using the multi-process runtime
15+
* Configuration
16+
* Building your own version
17+
18+
Using the multi-process runtime
19+
===============================
20+
*These instructions assume you have a working Python application that has
21+
already been deployed successfully to Managed VMs using the default runtime
22+
version.*
23+
24+
As this version of the Python runtime is currently in alpha, it is not built
25+
as a stable Docker image like other runtimes. Instead it can be put into place
26+
via modifications to an application's Dockerfile.
27+
28+
If your application has an automatically generated Dockerfile (this will be
29+
created during the deployment process the first time your app is deployed),
30+
copy multicore_runtime/dev/Dockerfile from this repository to your application
31+
directory.
32+
33+
If your application has a custom Dockerfile, then compare the two files and
34+
merge them. In typical cases this can be done by removing the first line of your
35+
application's Dockerfile (starting with FROM) and the last line of
36+
multicore_runtime/dev/Dockerfile (ADD . /app) and concatenating the files, with
37+
the repository's version first.
38+
39+
This Dockerfile will download the latest release of the runtime directly from
40+
Github. If you would like to instead use a version of the runtime you have
41+
modified or that has not yet been released, see the "Building your own version"
42+
section.
43+
44+
*Post-release, this version of the Python runtime will be made available as a
45+
prebuilt Docker image with no manual Dockerfile modification required.*
46+
47+
Configuration
48+
=============
49+
By default the multi-process version of the runtime is launched via the Gunicorn
50+
webserver and is configured to use a fixed number of processes and gevent-based
51+
concurrency.
52+
53+
This can be changed by editing the ENTRYPOINT line in the Dockerfile. For
54+
instance, Gunicorn can be changed to Waitress or another Python webserver, or
55+
the number of processes can be increased, or gevent-based concurrency can be
56+
turned off.
57+
58+
A future version of this runtime may automatically adapt the default settings to
59+
accommodate a given instance size. This version instead uses a fixed number of
60+
processes. If you are using an instance type with more than 4 CPU cores, change
61+
the number of processes in the Dockerfile to between 1 and 2 times the number of
62+
CPU cores available.
63+
64+
Building your own version
65+
=========================
66+
If you would like to make modifications to the runtime (either for personal use
67+
or to debug or resolve an outstanding issue), you can build and deploy a custom
68+
version with the following steps:
69+
70+
- After cloning the repository locally and making your changes, build a source
71+
distribution by running `python setup.py sdist` from the root directory of the
72+
repository.
73+
- Copy the resulting tar.gz file to your application's folder, in the same
74+
directory as the Dockerfile.
75+
- Edit the Dockerfile in your application and look for the line that says
76+
`COPY (...) /home/vmagent/python-runtime.tar.gz`
77+
- Replace the URL in that line with the filename of your generated tar.gz file.
78+
- Deploy your application. A warning during deployment where your tar.gz file is
79+
rejected for addition because it is too large can be ignored.

multicore_runtime/dev/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RUN apt-get -q update && \
55
python2.7 python-pip python-gevent python-greenlet && \
66
apt-get clean && rm /var/lib/apt/lists/*_*
77

8-
COPY appengine-python-vm-runtime-0.1.tar.gz /home/vmagent/python-runtime.tar.gz
8+
COPY https://github.com/GoogleCloudPlatform/appengine-python-vm-runtime/releases/download/0.1/python-runtime-0.1.tar.gz /home/vmagent/python-runtime.tar.gz
99

1010
RUN pip install --upgrade pip>=6.1.1 gunicorn==19.1.1
1111
RUN pip install /home/vmagent/python-runtime.tar.gz

0 commit comments

Comments
 (0)