aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Nathaniel Manista <nathaniel@google.com>2015-02-15 01:21:53 +0000
committerGravatar Nathaniel Manista <nathaniel@google.com>2015-02-15 01:21:53 +0000
commitd4cb0d649c3c4c6b0fa8094629d728f24c419597 (patch)
tree1e0fa5d253c1e734d10f15b3bfb6d7d680be2cae
parent1d1f952731887521117b863625d60da05a85aec8 (diff)
Add Docker files for Python.
-rw-r--r--tools/dockerfile/grpc_python/Dockerfile38
-rw-r--r--tools/dockerfile/grpc_python/README.md11
-rw-r--r--tools/dockerfile/grpc_python_base/Dockerfile20
-rw-r--r--tools/dockerfile/grpc_python_base/README.md7
4 files changed, 76 insertions, 0 deletions
diff --git a/tools/dockerfile/grpc_python/Dockerfile b/tools/dockerfile/grpc_python/Dockerfile
new file mode 100644
index 0000000000..2390ed7bcf
--- /dev/null
+++ b/tools/dockerfile/grpc_python/Dockerfile
@@ -0,0 +1,38 @@
+# Dockerfile for GRPC Python
+FROM grpc/python_base
+
+# Build the C library
+RUN cd /var/local/git/grpc \
+ && git pull --recurse-submodules \
+ && git submodule update --init --recursive
+
+# Build the C core.
+RUN make install_c -C /var/local/git/grpc
+
+# Build Python GRPC
+RUN cd /var/local/git/grpc \
+ && pip install src/python/src \
+ && pip install src/python/interop
+
+# Run Python GRPC's tests
+RUN cd /var/local/git/grpc \
+ # TODO(nathaniel): It would be nice for these to be auto-discoverable?
+ && python2.7 -B -m _adapter._blocking_invocation_inline_service_test
+ && python2.7 -B -m _adapter._c_test
+ && python2.7 -B -m _adapter._event_invocation_synchronous_event_service_test
+ && python2.7 -B -m _adapter._future_invocation_asynchronous_event_service_test
+ && python2.7 -B -m _adapter._links_test
+ && python2.7 -B -m _adapter._lonely_rear_link_test
+ && python2.7 -B -m _adapter._low_test
+ && python2.7 -B -m _framework.base.packets.implementations_test
+ && python2.7 -B -m _framework.face.blocking_invocation_inline_service_test
+ && python2.7 -B -m _framework.face.event_invocation_synchronous_event_service_test
+ && python2.7 -B -m _framework.face.future_invocation_asynchronous_event_service_test
+ && python2.7 -B -m _framework.foundation._later_test
+ && python2.7 -B -m _framework.foundation._logging_pool_test
+
+# Add a cacerts directory containing the Google root pem file, allowing the interop client to access the production test instance
+ADD cacerts cacerts
+
+# Specify the default command such that the interop server runs on its known testing port
+CMD ["/bin/bash", "-l", "-c", "python2.7 -m interop.server --use_tls --port 8050"]
diff --git a/tools/dockerfile/grpc_python/README.md b/tools/dockerfile/grpc_python/README.md
new file mode 100644
index 0000000000..efbdbeff82
--- /dev/null
+++ b/tools/dockerfile/grpc_python/README.md
@@ -0,0 +1,11 @@
+GRPC Python Dockerfile
+====================
+
+Dockerfile for creating the Python development instances
+
+As of 2015/02 this
+- is based on the GRPC Python base
+- adds a pull of the HEAD GRPC Python source from GitHub
+- builds it
+- runs its tests and aborts image creation if the tests don't pass
+- specifies the Python GRPC interop test server as default command
diff --git a/tools/dockerfile/grpc_python_base/Dockerfile b/tools/dockerfile/grpc_python_base/Dockerfile
new file mode 100644
index 0000000000..01292c2e12
--- /dev/null
+++ b/tools/dockerfile/grpc_python_base/Dockerfile
@@ -0,0 +1,20 @@
+# Base Dockerfile for GRPC Python.
+#
+# Includes Python environment and installation dependencies.
+FROM grpc/base
+
+# Allows 'source' to work
+RUN rm /bin/sh && ln -s /bin/bash /bin/sh
+
+# Install Python development
+RUN apt-get update && apt-get install -y \
+ python-all-dev \
+ python3-all-dev \
+ python-pip \
+ python-virtualenv \
+
+# Install Python packages from PyPI
+RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0-alpha-1
+
+# Get the GRPC source from GitHub
+RUN git clone --recursive git@github.com:google/grpc.git /var/local/git/grpc
diff --git a/tools/dockerfile/grpc_python_base/README.md b/tools/dockerfile/grpc_python_base/README.md
new file mode 100644
index 0000000000..1d4767ce5c
--- /dev/null
+++ b/tools/dockerfile/grpc_python_base/README.md
@@ -0,0 +1,7 @@
+GRPC Python Base Dockerfile
+========================
+
+Dockerfile for creating the Python GRPC development Docker instance.
+
+As of 2015/02 this
+- installs tools and dependencies needed to build GRPC Python