浏览代码

Docker Remaining Python Tests (#3415)

* Docker python

* docker python
Nate 7 年之前
父节点
当前提交
22b26e76ee
共有 34 个文件被更改,包括 159 次插入137 次删除
  1. 6 6
      .travis.yml
  2. 0 8
      frameworks/Python/.gitignore
  3. 0 2
      frameworks/Python/uwsgi/benchmark_config.json
  4. 0 7
      frameworks/Python/uwsgi/setup.sh
  5. 0 11
      frameworks/Python/uwsgi/setup_nginx.sh
  6. 18 0
      frameworks/Python/uwsgi/uwsgi-nginx-uwsgi.dockerfile
  7. 9 0
      frameworks/Python/uwsgi/uwsgi.dockerfile
  8. 0 1
      frameworks/Python/web2py/.gitignore
  9. 0 2
      frameworks/Python/web2py/benchmark_config.json
  10. 0 22
      frameworks/Python/web2py/setup.sh
  11. 25 0
      frameworks/Python/web2py/web2py-base.dockerfile
  12. 5 0
      frameworks/Python/web2py/web2py-optimized.dockerfile
  13. 5 0
      frameworks/Python/web2py/web2py.dockerfile
  14. 0 1
      frameworks/Python/webware/.gitignore
  15. 0 1
      frameworks/Python/webware/benchmark_config.json
  16. 0 16
      frameworks/Python/webware/setup.sh
  17. 19 0
      frameworks/Python/webware/webware.dockerfile
  18. 0 4
      frameworks/Python/weppy/benchmark_config.json
  19. 0 11
      frameworks/Python/weppy/setup_nginxuwsgi.sh
  20. 0 7
      frameworks/Python/weppy/setup_py2.sh
  21. 0 7
      frameworks/Python/weppy/setup_py3.sh
  22. 0 7
      frameworks/Python/weppy/setup_pypy2.sh
  23. 18 0
      frameworks/Python/weppy/weppy-nginx-uwsgi.dockerfile
  24. 9 0
      frameworks/Python/weppy/weppy-py3.dockerfile
  25. 9 0
      frameworks/Python/weppy/weppy-pypy2.dockerfile
  26. 9 0
      frameworks/Python/weppy/weppy.dockerfile
  27. 0 2
      frameworks/Python/wheezyweb/benchmark_config.json
  28. 0 7
      frameworks/Python/wheezyweb/setup.sh
  29. 0 7
      frameworks/Python/wheezyweb/setup_py3.sh
  30. 9 0
      frameworks/Python/wheezyweb/wheezyweb-py3.dockerfile
  31. 9 0
      frameworks/Python/wheezyweb/wheezyweb.dockerfile
  32. 0 1
      frameworks/Python/wsgi/benchmark_config.json
  33. 0 7
      frameworks/Python/wsgi/setup.sh
  34. 9 0
      frameworks/Python/wsgi/wsgi.dockerfile

+ 6 - 6
.travis.yml

@@ -164,12 +164,12 @@ env:
      - "TESTDIR=Python/tornado"
      - "TESTDIR=Python/tornado"
      - "TESTDIR=Python/turbogears"
      - "TESTDIR=Python/turbogears"
      - "TESTDIR=Python/uvicorn"
      - "TESTDIR=Python/uvicorn"
-    # - "TESTDIR=Python/uwsgi"
-    # - "TESTDIR=Python/web2py"
-    # - "TESTDIR=Python/webware"
-    # - "TESTDIR=Python/weppy"
-    # - "TESTDIR=Python/wheezyweb"
-    # - "TESTDIR=Python/wsgi"
+     - "TESTDIR=Python/uwsgi"
+     - "TESTDIR=Python/web2py"
+     - "TESTDIR=Python/webware"
+     - "TESTDIR=Python/weppy"
+     - "TESTDIR=Python/wheezyweb"
+     - "TESTDIR=Python/wsgi"
     # - "TESTDIR=Ruby/grape"
     # - "TESTDIR=Ruby/grape"
     # - "TESTDIR=Ruby/h2o_mruby"
     # - "TESTDIR=Ruby/h2o_mruby"
     # - "TESTDIR=Ruby/hanami"
     # - "TESTDIR=Ruby/hanami"

+ 0 - 8
frameworks/Python/.gitignore

@@ -1,8 +0,0 @@
-uwsgi_params
-*.pid
-__pycache__
-!*.lock
-
-# ignore virtual environments
-pyvenv*/
-venv*/

+ 0 - 2
frameworks/Python/uwsgi/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "uwsgi",
   "framework": "uwsgi",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
-      "setup_file": "setup",
       "json_url": "/json",
       "json_url": "/json",
       "port": 8080,
       "port": 8080,
       "approach": "Stripped",
       "approach": "Stripped",
@@ -21,7 +20,6 @@
       "versus": ""
       "versus": ""
     },
     },
     "nginx-uwsgi": {
     "nginx-uwsgi": {
-      "setup_file": "setup_nginx",
       "json_url": "/json",
       "json_url": "/json",
       "port": 8080,
       "port": 8080,
       "approach": "Stripped",
       "approach": "Stripped",

+ 0 - 7
frameworks/Python/uwsgi/setup.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends python2
-
-pip install --install-option="--prefix=${PY2_ROOT}" -r $TROOT/requirements.txt
-
-uwsgi --master -L -l 5000 --gevent 1000 --http :8080 --http-keepalive --http-processes $CPU_COUNT -p $CPU_COUNT -w hello --add-header "Connection: keep-alive" --pidfile /tmp/uwsgi.pid &

+ 0 - 11
frameworks/Python/uwsgi/setup_nginx.sh

@@ -1,11 +0,0 @@
-#!/bin/bash
-
-fw_depends python2 nginx
-
-sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' nginx.conf
-
-pip install --install-option="--prefix=${PY2_ROOT}" -r $TROOT/requirements.txt
-
-nginx -c $TROOT/nginx.conf
-
-uwsgi --ini uwsgi.ini --processes $CPU_COUNT --gevent 1000 --wsgi hello &

+ 18 - 0
frameworks/Python/uwsgi/uwsgi-nginx-uwsgi.dockerfile

@@ -0,0 +1,18 @@
+FROM tfb/nginx:latest
+
+FROM tfb/python2:latest
+
+COPY --from=0 /nginx /nginx
+
+ENV NGINX_HOME="/nginx"
+ENV PATH=/nginx/sbin:${PATH}
+
+ADD ./ /uw
+
+WORKDIR /uw
+
+RUN pip install --install-option="--prefix=${PY2_ROOT}" -r /uw/requirements.txt
+
+RUN sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' /uw/nginx.conf
+
+CMD nginx -c /uw/nginx.conf && uwsgi --ini uwsgi.ini --processes $CPU_COUNT --gevent 1000 --wsgi hello

+ 9 - 0
frameworks/Python/uwsgi/uwsgi.dockerfile

@@ -0,0 +1,9 @@
+FROM tfb/python2:latest
+
+ADD ./ /uw
+
+WORKDIR /uw
+
+RUN pip install --install-option="--prefix=${PY2_ROOT}" -r /uw/requirements.lock
+
+CMD uwsgi --master -L -l 5000 --gevent 1000 --http :8080 --http-keepalive --http-processes $CPU_COUNT -p $CPU_COUNT -w hello --add-header "Connection: keep-alive" --pidfile /tmp/uwsgi.pid

+ 0 - 1
frameworks/Python/web2py/.gitignore

@@ -1 +0,0 @@
-/web2py/

+ 0 - 2
frameworks/Python/web2py/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "web2py",
   "framework": "web2py",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
-      "setup_file": "setup",
       "plaintext_url": "/standard/plaintext",
       "plaintext_url": "/standard/plaintext",
       "json_url": "/standard/json",
       "json_url": "/standard/json",
       "db_url": "/standard/db",
       "db_url": "/standard/db",
@@ -26,7 +25,6 @@
       "versus": "wsgi"
       "versus": "wsgi"
     },
     },
     "optimized": {
     "optimized": {
-      "setup_file": "setup",
       "plaintext_url": "/optimized/plaintext",
       "plaintext_url": "/optimized/plaintext",
       "json_url": "/optimized/json",
       "json_url": "/optimized/json",
       "db_url": "/optimized/db",
       "db_url": "/optimized/db",

+ 0 - 22
frameworks/Python/web2py/setup.sh

@@ -1,22 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql python2
-
-pip install --install-option="--prefix=${PY2_ROOT}" -r $TROOT/requirements.txt
-
-rm -fr web2py
-git clone --recursive --branch master https://github.com/web2py/web2py.git
-cd web2py
-# The following commit is checked out in order to take advantage of several
-# bug fixes that were made after the latest stable release. This can be changed
-# in future rounds once a new stable release has been made.
-git checkout 623f3b99477eb97ffadb20d6f7cb3da398253c9c
-cd ..
-cp -r app/standard/ web2py/applications/
-cp -r app/optimized/ web2py/applications/
-cp app/wsgi.py web2py/
-cp app/routes.py web2py/
-touch web2py/__init__.py
-python compile_apps.py
-
-gunicorn web2py.wsgi:application -c gunicorn_conf.py &

+ 25 - 0
frameworks/Python/web2py/web2py-base.dockerfile

@@ -0,0 +1,25 @@
+FROM tfb/python2:latest
+
+ADD ./ /web2py
+
+WORKDIR /web2py
+
+RUN pip install --install-option="--prefix=${PY2_ROOT}" -r /web2py/requirements.txt
+
+RUN git clone --recursive --branch master https://github.com/web2py/web2py.git
+
+WORKDIR /web2py/web2py
+
+# The following commit is checked out in order to take advantage of several
+# bug fixes that were made after the latest stable release. This can be changed
+# in future rounds once a new stable release has been made.
+RUN git checkout 623f3b99477eb97ffadb20d6f7cb3da398253c9c
+
+WORKDIR /web2py
+
+RUN cp -r app/standard/ web2py/applications/
+RUN cp -r app/optimized/ web2py/applications/
+RUN cp app/wsgi.py web2py/
+RUN cp app/routes.py web2py/
+RUN touch web2py/__init__.py
+RUN python compile_apps.py

+ 5 - 0
frameworks/Python/web2py/web2py-optimized.dockerfile

@@ -0,0 +1,5 @@
+FROM tfb/web2py-base:latest
+
+WORKDIR /web2py
+
+CMD gunicorn web2py.wsgi:application -c gunicorn_conf.py

+ 5 - 0
frameworks/Python/web2py/web2py.dockerfile

@@ -0,0 +1,5 @@
+FROM tfb/web2py-base:latest
+
+WORKDIR /web2py
+
+CMD gunicorn web2py.wsgi:application -c gunicorn_conf.py

+ 0 - 1
frameworks/Python/webware/.gitignore

@@ -1 +0,0 @@
-Webware*

+ 0 - 1
frameworks/Python/webware/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "webware",
   "framework": "webware",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
-      "setup_file": "setup",
       "json_url": "/json2",
       "json_url": "/json2",
       "plaintext_url": "/plaintext",
       "plaintext_url": "/plaintext",
       "db_url": "/db",
       "db_url": "/db",

+ 0 - 16
frameworks/Python/webware/setup.sh

@@ -1,16 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql python2 apache
-
-pip install --install-option="--prefix=${PY2_ROOT}" -r $TROOT/requirements.txt
-
-rm -fr Webware Webware-1.1.1 Webware-1.1.1.tar.gz
-
-fw_get -O https://downloads.sourceforge.net/webware/Webware-1.1.1.tar.gz
-fw_untar Webware-1.1.1.tar.gz
-cp -r app/ Webware-1.1.1/
-
-cd $TROOT/Webware-1.1.1
-python install.py --no-password-prompt 
-cd $TROOT/Webware-1.1.1/app
-python Launch.py &

+ 19 - 0
frameworks/Python/webware/webware.dockerfile

@@ -0,0 +1,19 @@
+FROM tfb/python2:latest
+
+ADD ./ /webware
+
+WORKDIR /webware
+
+RUN pip install --install-option="--prefix=${PY2_ROOT}" -r /webware/requirements.txt
+
+RUN wget -q https://downloads.sourceforge.net/webware/Webware-1.1.1.tar.gz
+RUN tar xvf Webware-1.1.1.tar.gz
+RUN cp -r app/ Webware-1.1.1/
+
+WORKDIR /webware/Webware-1.1.1
+
+RUN python install.py --no-password-prompt
+
+WORKDIR /webware/Webware-1.1.1/app
+
+CMD python Launch.py

+ 0 - 4
frameworks/Python/weppy/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "weppy",
   "framework": "weppy",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
-      "setup_file": "setup_py2",
       "json_url": "/json",
       "json_url": "/json",
       "db_url": "/db",
       "db_url": "/db",
       "query_url": "/queries?queries=",
       "query_url": "/queries?queries=",
@@ -25,7 +24,6 @@
       "versus": "wsgi"
       "versus": "wsgi"
     },
     },
     "py3": {
     "py3": {
-      "setup_file": "setup_py3",
       "json_url": "/json",
       "json_url": "/json",
       "db_url": "/db",
       "db_url": "/db",
       "query_url": "/queries?queries=",
       "query_url": "/queries?queries=",
@@ -48,7 +46,6 @@
       "versus": "wsgi"
       "versus": "wsgi"
     },
     },
     "pypy2": {
     "pypy2": {
-      "setup_file": "setup_pypy2",
       "json_url": "/json",
       "json_url": "/json",
       "db_url": "/db",
       "db_url": "/db",
       "query_url": "/queries?queries=",
       "query_url": "/queries?queries=",
@@ -72,7 +69,6 @@
       "versus": "wsgi"
       "versus": "wsgi"
     },
     },
     "nginx-uwsgi": {
     "nginx-uwsgi": {
-      "setup_file": "setup_nginxuwsgi",
       "json_url": "/json",
       "json_url": "/json",
       "db_url": "/db",
       "db_url": "/db",
       "query_url": "/queries?queries=",
       "query_url": "/queries?queries=",

+ 0 - 11
frameworks/Python/weppy/setup_nginxuwsgi.sh

@@ -1,11 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql python2 nginx
-
-sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' nginx.conf
-
-pip install --install-option="--prefix=${PY2_ROOT}" -r $TROOT/requirements.txt
-
-nginx -c $TROOT/nginx.conf
-
-uwsgi --ini $TROOT/uwsgi.ini --processes $CPU_COUNT --wsgi app:app &

+ 0 - 7
frameworks/Python/weppy/setup_py2.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql python2
-
-pip install --install-option="--prefix=${PY2_ROOT}" -r $TROOT/requirements.txt
-
-gunicorn app:app -c gunicorn_conf.py &

+ 0 - 7
frameworks/Python/weppy/setup_py3.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql python3
-
-pip3 install --install-option="--prefix=${PY3_ROOT}" -r $TROOT/requirements.txt
-
-gunicorn app:app -c gunicorn_conf.py &

+ 0 - 7
frameworks/Python/weppy/setup_pypy2.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql pypy2
-
-pip install --install-option="--prefix=${PYPY2_ROOT}" -r $TROOT/requirements-pypy.txt
-
-gunicorn app:app -c gunicorn_conf.py &

+ 18 - 0
frameworks/Python/weppy/weppy-nginx-uwsgi.dockerfile

@@ -0,0 +1,18 @@
+FROM tfb/nginx:latest
+
+FROM tfb/python2:latest
+
+COPY --from=0 /nginx /nginx
+
+ENV NGINX_HOME="/nginx"
+ENV PATH=/nginx/sbin:${PATH}
+
+ADD ./ /weppy
+
+WORKDIR /weppy
+
+RUN pip install --install-option="--prefix=${PY2_ROOT}" -r /weppy/requirements.txt
+
+RUN sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' /weppy/nginx.conf
+
+CMD nginx -c /weppy/nginx.conf && uwsgi --ini /weppy/uwsgi.ini --processes $CPU_COUNT --wsgi app:app

+ 9 - 0
frameworks/Python/weppy/weppy-py3.dockerfile

@@ -0,0 +1,9 @@
+FROM tfb/python3:latest
+
+ADD ./ /weppy
+
+WORKDIR /weppy
+
+RUN pip3 install --install-option="--prefix=${PY3_ROOT}" -r /weppy/requirements.txt
+
+CMD gunicorn app:app -c gunicorn_conf.py

+ 9 - 0
frameworks/Python/weppy/weppy-pypy2.dockerfile

@@ -0,0 +1,9 @@
+FROM tfb/pypy2:latest
+
+ADD ./ /weppy
+
+WORKDIR /weppy
+
+RUN pip install --install-option="--prefix=${PYPY2_ROOT}" -r /weppy/requirements-pypy.txt
+
+CMD gunicorn app:app -c gunicorn_conf.py

+ 9 - 0
frameworks/Python/weppy/weppy.dockerfile

@@ -0,0 +1,9 @@
+FROM tfb/python2:latest
+
+ADD ./ /weppy
+
+WORKDIR /weppy
+
+RUN pip install --install-option="--prefix=${PY2_ROOT}" -r /weppy/requirements.txt
+
+CMD gunicorn app:app -c gunicorn_conf.py

+ 0 - 2
frameworks/Python/wheezyweb/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "wheezyweb",
   "framework": "wheezyweb",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
-      "setup_file": "setup",
       "json_url": "/json",
       "json_url": "/json",
       "db_url": "/db",
       "db_url": "/db",
       "query_url": "/queries?queries=",
       "query_url": "/queries?queries=",
@@ -25,7 +24,6 @@
       "notes": ""
       "notes": ""
     },
     },
     "py3": {
     "py3": {
-      "setup_file": "setup_py3",
       "json_url": "/json",
       "json_url": "/json",
       "db_url": "/db",
       "db_url": "/db",
       "query_url": "/queries?queries=",
       "query_url": "/queries?queries=",

+ 0 - 7
frameworks/Python/wheezyweb/setup.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql python2
-
-pip install --install-option="--prefix=${PY2_ROOT}" -r $TROOT/requirements.txt
-
-gunicorn app:app -c gunicorn_conf.py &

+ 0 - 7
frameworks/Python/wheezyweb/setup_py3.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql python3
-
-pip3 install --install-option="--prefix=${PY3_ROOT}" -r $TROOT/requirements.txt
-
-gunicorn app:app -c gunicorn_conf.py &

+ 9 - 0
frameworks/Python/wheezyweb/wheezyweb-py3.dockerfile

@@ -0,0 +1,9 @@
+FROM tfb/python3:latest
+
+ADD ./ /wheezyweb
+
+WORKDIR /wheezyweb
+
+RUN pip3 install --install-option="--prefix=${PY3_ROOT}" -r /wheezyweb/requirements.txt
+
+CMD gunicorn app:app -c gunicorn_conf.py

+ 9 - 0
frameworks/Python/wheezyweb/wheezyweb.dockerfile

@@ -0,0 +1,9 @@
+FROM tfb/python2:latest
+
+ADD ./ /wheezyweb
+
+WORKDIR /wheezyweb
+
+RUN pip install --install-option="--prefix=${PY2_ROOT}" -r /wheezyweb/requirements.txt
+
+CMD gunicorn app:app -c gunicorn_conf.py

+ 0 - 1
frameworks/Python/wsgi/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "wsgi",
   "framework": "wsgi",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
-      "setup_file": "setup",
       "json_url": "/json",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "plaintext_url": "/plaintext",
       "port": 8080,
       "port": 8080,

+ 0 - 7
frameworks/Python/wsgi/setup.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends python3
-
-pip3 install --install-option="--prefix=${PY3_ROOT}" -r $TROOT/requirements.txt
-
-gunicorn hello:app -c gunicorn_conf.py &

+ 9 - 0
frameworks/Python/wsgi/wsgi.dockerfile

@@ -0,0 +1,9 @@
+FROM tfb/python3:latest
+
+ADD ./ /wsgi
+
+WORKDIR /wsgi
+
+RUN pip3 install --install-option="--prefix=${PY3_ROOT}" -r /wsgi/requirements.txt
+
+CMD gunicorn hello:app -c gunicorn_conf.py