Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0ed01f2

Browse files
author
Douglas Greiman
authored
Merge pull request GoogleCloudPlatform#138 from GoogleCloudPlatform/dgreiman/eventlet
Add compatibility test for the 'eventlet' Python package.
2 parents ef5dc45 + 50e51f6 commit 0ed01f2

File tree

8 files changed

+40
-0
lines changed

8 files changed

+40
-0
lines changed

build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ for outfile in \
150150
python-interpreter-builder/Dockerfile \
151151
runtime-image/Dockerfile \
152152
tests/benchmark/Dockerfile \
153+
tests/eventlet/Dockerfile \
153154
tests/google-cloud-python/Dockerfile \
154155
tests/google-cloud-python-system/Dockerfile \
155156
tests/integration/Dockerfile \
@@ -167,6 +168,9 @@ for file in \
167168
cp -a "${file}" "builder/gen-dockerfile/${file##scripts/}"
168169
done
169170

171+
# Make a file available to the eventlet test.
172+
cp -a scripts/testdata/hello_world/main.py tests/eventlet/main.py
173+
170174
# Build images and push to GCR
171175
if [ "${build}" -eq 1 ]; then
172176
echo "Building images"

cloudbuild.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ steps:
2525
'--config', '/workspace/tests/license-test/license-test.yaml',
2626
'-v'
2727
]
28+
- # Run compatibility tests
29+
name: gcr.io/cloud-builders/docker:latest
30+
args: ['build', '--tag=${_DOCKER_NAMESPACE}/python/tests/eventlet:${_TAG}',
31+
'--no-cache', '/workspace/tests/eventlet/']
2832
- # Build image to run google client library unit tests
2933
name: gcr.io/cloud-builders/docker:latest
3034
args: ['build', '--tag=${_DOCKER_NAMESPACE}/python/tests/google-cloud-python:${_TAG}',

cloudbuild_library_tests.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@ steps:
1212
# Avoid warning about unused substitutions
1313
'UNUSED1=${_BUILDER_DOCKER_NAMESPACE}',
1414
]
15+
- # Run compatibility tests
16+
name: gcr.io/cloud-builders/docker:latest
17+
args: ['build', '--tag=${_DOCKER_NAMESPACE}/python/tests/eventlet:${_TAG}',
18+
'--no-cache', '/workspace/tests/eventlet/']
1519
images: [
1620
]

runtime-image/resources/apt-packages.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ libsasl2-2
3636
libsasl2-dev
3737
libsasl2-modules
3838
sasl2-bin
39+
# Needed by eventlet
40+
netbase

tests/eventlet/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Dockerfile
2+
main.py

tests/eventlet/Dockerfile.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ${STAGING_IMAGE}
2+
LABEL python_version=python3.6
3+
RUN virtualenv --no-download /env -p python3.6
4+
5+
# Set virtualenv environment variables. This is equivalent to running
6+
# source /env/bin/activate
7+
ENV VIRTUAL_ENV /env
8+
ENV PATH /env/bin:$PATH
9+
ADD requirements.txt /app/
10+
RUN pip install -r requirements.txt
11+
ADD . /app/
12+
RUN gunicorn -k eventlet -b :$PORT --daemon main:app ; \
13+
wget --retry-connrefused --tries=5 http://localhost:$PORT/

tests/eventlet/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Test the Python base image against the 'eventlet' library

tests/eventlet/requirements.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
click==6.7
2+
enum-compat==0.0.2
3+
eventlet==0.21.0
4+
Flask==0.12.2
5+
greenlet==0.4.12
6+
gunicorn==19.7.1
7+
itsdangerous==0.24
8+
Jinja2==2.9.6
9+
MarkupSafe==1.0
10+
Werkzeug==0.12.2

0 commit comments

Comments
 (0)