Skip to content

Commit

Permalink
Add compatibility test for the 'eventlet' Python package.
Browse files Browse the repository at this point in the history
The eventlet worker for gunicorn dies if /etc/protocols isn't present,
which was previously the case.  We now install the Debian 'netbase'
package which provides this file and others.
  • Loading branch information
Doug Greiman committed Aug 11, 2017
1 parent bc20cb4 commit 50e51f6
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ for outfile in \
python-interpreter-builder/Dockerfile \
runtime-image/Dockerfile \
tests/benchmark/Dockerfile \
tests/eventlet/Dockerfile \
tests/google-cloud-python/Dockerfile \
tests/google-cloud-python-system/Dockerfile \
tests/integration/Dockerfile \
Expand All @@ -167,6 +168,9 @@ for file in \
cp -a "${file}" "builder/gen-dockerfile/${file##scripts/}"
done

# Make a file available to the eventlet test.
cp -a scripts/testdata/hello_world/main.py tests/eventlet/main.py

# Build images and push to GCR
if [ "${build}" -eq 1 ]; then
echo "Building images"
Expand Down
4 changes: 4 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ steps:
'--config', '/workspace/tests/license-test/license-test.yaml',
'-v'
]
- # Run compatibility tests
name: gcr.io/cloud-builders/docker:latest
args: ['build', '--tag=${_DOCKER_NAMESPACE}/python/tests/eventlet:${_TAG}',
'--no-cache', '/workspace/tests/eventlet/']
- # Build image to run google client library unit tests
name: gcr.io/cloud-builders/docker:latest
args: ['build', '--tag=${_DOCKER_NAMESPACE}/python/tests/google-cloud-python:${_TAG}',
Expand Down
4 changes: 4 additions & 0 deletions cloudbuild_library_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ steps:
# Avoid warning about unused substitutions
'UNUSED1=${_BUILDER_DOCKER_NAMESPACE}',
]
- # Run compatibility tests
name: gcr.io/cloud-builders/docker:latest
args: ['build', '--tag=${_DOCKER_NAMESPACE}/python/tests/eventlet:${_TAG}',
'--no-cache', '/workspace/tests/eventlet/']
images: [
]
2 changes: 2 additions & 0 deletions tests/eventlet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dockerfile
main.py
13 changes: 13 additions & 0 deletions tests/eventlet/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ${STAGING_IMAGE}
LABEL python_version=python3.6
RUN virtualenv --no-download /env -p python3.6

# Set virtualenv environment variables. This is equivalent to running
# source /env/bin/activate
ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH
ADD requirements.txt /app/
RUN pip install -r requirements.txt
ADD . /app/
RUN gunicorn -k eventlet -b :$PORT --daemon main:app ; \
wget --retry-connrefused --tries=5 http://localhost:$PORT/
1 change: 1 addition & 0 deletions tests/eventlet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Test the Python base image against the 'eventlet' library
10 changes: 10 additions & 0 deletions tests/eventlet/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
click==6.7
enum-compat==0.0.2
eventlet==0.21.0
Flask==0.12.2
greenlet==0.4.12
gunicorn==19.7.1
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
Werkzeug==0.12.2

0 comments on commit 50e51f6

Please sign in to comment.