Răsfoiți Sursa

Docker python (#3406)

Nate 7 ani în urmă
părinte
comite
14fed64a25
73 a modificat fișierele cu 303 adăugiri și 421 ștergeri
  1. 8 8
      .travis.yml
  2. 9 0
      frameworks/Python/aiohttp/aiohttp-base.dockerfile
  3. 7 0
      frameworks/Python/aiohttp/aiohttp-pg-raw.dockerfile
  4. 5 0
      frameworks/Python/aiohttp/aiohttp.dockerfile
  5. 0 2
      frameworks/Python/aiohttp/benchmark_config.json
  6. 0 7
      frameworks/Python/aiohttp/setup.sh
  7. 0 5
      frameworks/Python/aiohttp/setup_raw.sh
  8. 0 1
      frameworks/Python/api_hour/.gitignore
  9. 0 64
      frameworks/Python/api_hour/aiohttp.web/.gitignore
  10. 0 22
      frameworks/Python/api_hour/aiohttp.web/README.rst
  11. 0 5
      frameworks/Python/api_hour/aiohttp.web/setup-mysql.sh
  12. 0 5
      frameworks/Python/api_hour/aiohttp.web/setup-postgresql.sh
  13. 0 8
      frameworks/Python/api_hour/aiohttp.web/setup.sh
  14. 8 0
      frameworks/Python/api_hour/aiohttpweb-base.dockerfile
  15. 5 0
      frameworks/Python/api_hour/api_hour-dbs.dockerfile
  16. 5 0
      frameworks/Python/api_hour/api_hour-json.dockerfile
  17. 5 0
      frameworks/Python/api_hour/api_hour-mysql.dockerfile
  18. 5 0
      frameworks/Python/api_hour/api_hour-plaintext.dockerfile
  19. 5 0
      frameworks/Python/api_hour/api_hour.dockerfile
  20. 0 5
      frameworks/Python/api_hour/benchmark_config.json
  21. 8 0
      frameworks/Python/api_hour/yocto_http-base.dockerfile
  22. 0 64
      frameworks/Python/api_hour/yocto_http/.gitignore
  23. 0 22
      frameworks/Python/api_hour/yocto_http/README.rst
  24. 0 8
      frameworks/Python/api_hour/yocto_http/setup.sh
  25. 9 0
      frameworks/Python/apistar/apistar.dockerfile
  26. 0 1
      frameworks/Python/apistar/benchmark_config.json
  27. 0 7
      frameworks/Python/apistar/setup.sh
  28. 0 4
      frameworks/Python/bottle/benchmark_config.json
  29. 18 0
      frameworks/Python/bottle/bottle-nginx-uwsgi.dockerfile
  30. 9 0
      frameworks/Python/bottle/bottle-pypy2.dockerfile
  31. 9 0
      frameworks/Python/bottle/bottle-raw.dockerfile
  32. 9 0
      frameworks/Python/bottle/bottle.dockerfile
  33. 0 7
      frameworks/Python/bottle/setup.sh
  34. 0 10
      frameworks/Python/bottle/setup_nginxuwsgi.sh
  35. 0 7
      frameworks/Python/bottle/setup_pypy2.sh
  36. 0 2
      frameworks/Python/cherrypy/benchmark_config.json
  37. 9 0
      frameworks/Python/cherrypy/cherrypy-py3.dockerfile
  38. 9 0
      frameworks/Python/cherrypy/cherrypy.dockerfile
  39. 0 7
      frameworks/Python/cherrypy/setup.sh
  40. 0 7
      frameworks/Python/cherrypy/setup_py3.sh
  41. 0 1
      frameworks/Python/django/.gitignore
  42. 0 3
      frameworks/Python/django/benchmark_config.json
  43. 7 0
      frameworks/Python/django/django-base.dockerfile
  44. 5 0
      frameworks/Python/django/django-postgresql.dockerfile
  45. 9 0
      frameworks/Python/django/django-py3.dockerfile
  46. 5 0
      frameworks/Python/django/django.dockerfile
  47. 0 7
      frameworks/Python/django/setup.sh
  48. 0 7
      frameworks/Python/django/setup_pg.sh
  49. 0 7
      frameworks/Python/django/setup_py3.sh
  50. 0 3
      frameworks/Python/falcon/benchmark_config.json
  51. 9 0
      frameworks/Python/falcon/falcon-py3.dockerfile
  52. 9 0
      frameworks/Python/falcon/falcon-pypy2.dockerfile
  53. 9 0
      frameworks/Python/falcon/falcon.dockerfile
  54. 0 7
      frameworks/Python/falcon/setup.sh
  55. 0 7
      frameworks/Python/falcon/setup_py3.sh
  56. 0 7
      frameworks/Python/falcon/setup_pypy2.sh
  57. 0 4
      frameworks/Python/flask/benchmark_config.json
  58. 18 0
      frameworks/Python/flask/flask-nginx-uwsgi.dockerfile
  59. 7 0
      frameworks/Python/flask/flask-py3-base.dockerfile
  60. 7 0
      frameworks/Python/flask/flask-pypy2-base.dockerfile
  61. 5 0
      frameworks/Python/flask/flask-pypy2-raw.dockerfile
  62. 5 0
      frameworks/Python/flask/flask-pypy2.dockerfile
  63. 5 0
      frameworks/Python/flask/flask-raw.dockerfile
  64. 3 0
      frameworks/Python/flask/flask.dockerfile
  65. 0 11
      frameworks/Python/flask/setup_nginxuwsgi.sh
  66. 0 7
      frameworks/Python/flask/setup_py3.sh
  67. 0 7
      frameworks/Python/flask/setup_pypy2.sh
  68. 13 0
      toolset/setup/docker/languages/pypy2.dockerfile
  69. 22 0
      toolset/setup/docker/languages/python2.dockerfile
  70. 23 0
      toolset/setup/docker/languages/python3.dockerfile
  71. 0 19
      toolset/setup/linux/languages/pypy2.sh
  72. 0 23
      toolset/setup/linux/languages/python2.sh
  73. 0 23
      toolset/setup/linux/languages/python3.sh

+ 8 - 8
.travis.yml

@@ -148,14 +148,14 @@ env:
     # - "TESTDIR=PHP/zend"
     # - "TESTDIR=PHP/zend1"
     # - "TESTDIR=PHP/phreeze"
-    # - "TESTDIR=Python/aiohttp"
-    # - "TESTDIR=Python/apistar"
-    # - "TESTDIR=Python/api_hour"
-    # - "TESTDIR=Python/bottle"
-    # - "TESTDIR=Python/cherrypy"
-    # - "TESTDIR=Python/django"
-    # - "TESTDIR=Python/falcon"
-    # - "TESTDIR=Python/flask"
+     - "TESTDIR=Python/aiohttp"
+     - "TESTDIR=Python/apistar"
+     - "TESTDIR=Python/api_hour"
+     - "TESTDIR=Python/bottle"
+     - "TESTDIR=Python/cherrypy"
+     - "TESTDIR=Python/django"
+     - "TESTDIR=Python/falcon"
+     - "TESTDIR=Python/flask"
     # - "TESTDIR=Python/japronto"
     # - "TESTDIR=Python/klein"
     # - "TESTDIR=Python/morepath"

+ 9 - 0
frameworks/Python/aiohttp/aiohttp-base.dockerfile

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

+ 7 - 0
frameworks/Python/aiohttp/aiohttp-pg-raw.dockerfile

@@ -0,0 +1,7 @@
+FROM tfb/aiohttp-base:latest
+
+WORKDIR /aiohttp
+
+ENV CONNECTION=RAW
+
+CMD gunicorn app.gunicorn:app -c gunicorn_conf.py

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

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

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

@@ -2,7 +2,6 @@
   "framework": "aiohttp",
   "tests": [{
     "default": {
-      "setup_file": "setup",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/queries/",
@@ -25,7 +24,6 @@
       "notes": "uses aiopg with sqlalchemy for database access"
     },
     "pg-raw": {
-      "setup_file": "setup_raw",
       "db_url": "/db",
       "query_url": "/queries/",
       "fortune_url": "/fortunes",

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

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

+ 0 - 5
frameworks/Python/aiohttp/setup_raw.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-export CONNECTION=RAW
-
-source $TROOT/setup.sh

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

@@ -1 +0,0 @@
-/src/

+ 0 - 64
frameworks/Python/api_hour/aiohttp.web/.gitignore

@@ -1,64 +0,0 @@
-# Created by .gitignore support plugin (hsz.mobi)
-### Python template
-# Byte-compiled / optimized / DLL files
-__pycache__/
-*.py[cod]
-
-# C extensions
-*.so
-
-# Distribution / packaging
-.Python
-env/
-build/
-develop-eggs/
-dist/
-downloads/
-eggs/
-lib/
-lib64/
-parts/
-sdist/
-var/
-*.egg-info/
-.installed.cfg
-*.egg
-
-# PyInstaller
-#  Usually these files are written by a python script from a template
-#  before PyInstaller builds the exe, so as to inject date/other infos into it.
-*.manifest
-*.spec
-
-# Installer logs
-pip-log.txt
-pip-delete-this-directory.txt
-
-# Unit test / coverage reports
-htmlcov/
-.tox/
-.coverage
-.cache
-nosetests.xml
-coverage.xml
-
-# Translations
-*.mo
-*.pot
-
-# Django stuff:
-*.log
-
-# Sphinx documentation
-docs/_build/
-
-# PyBuilder
-target/
-
-# PyCharm/IDEA files
-.idea
-*.iml
-
-# Virtualenvs
-venv/
-pyvenv/

+ 0 - 22
frameworks/Python/api_hour/aiohttp.web/README.rst

@@ -1,22 +0,0 @@
-hello
-=====
-
-Install
--------
-
-#. Follow pythonz install doc
-#. pythonz install 3.4.2
-#. cd /opt
-#. Git clone your app here
-#. cd /opt/hello/
-#. /usr/local/pythonz/pythons/CPython-3.4.2/bin/pyvenv pyvenv
-#. . pyvenv/bin/activate
-#. pip install -r requirements.txt
-#. cd /etc/init.d/ && ln -s /opt/hello/etc/init.d/hello
-#. cd /etc/default/ && ln -s /opt/hello/etc/default/hello
-#. cd /etc/monit/conf.d/ && ln -s /opt/hello/etc/monit/conf.d/hello
-#. update-rc.d hello defaults
-#. cp -a /opt/hello/etc/hello /etc/
-#. Adapt rsyslog and lograte
-#. service hello start
-#. service monit restart

+ 0 - 5
frameworks/Python/api_hour/aiohttp.web/setup-mysql.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql
-
-source $TROOT/aiohttp.web/setup.sh

+ 0 - 5
frameworks/Python/api_hour/aiohttp.web/setup-postgresql.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql
-
-source $TROOT/aiohttp.web/setup.sh

+ 0 - 8
frameworks/Python/api_hour/aiohttp.web/setup.sh

@@ -1,8 +0,0 @@
-#!/bin/bash
-
-fw_depends python3
-
-pip3 install --install-option="--prefix=${PY3_ROOT}" -r $TROOT/requirements.txt
-
-cd $TROOT/aiohttp.web
-api_hour -ac hello:Container &

+ 8 - 0
frameworks/Python/api_hour/aiohttpweb-base.dockerfile

@@ -0,0 +1,8 @@
+FROM tfb/python3:latest
+
+ADD ./aiohttp.web /aiohttp.web
+ADD ./requirements.txt /aiohttp.web
+
+WORKDIR /aiohttp.web
+
+RUN pip3 install --install-option="--prefix=${PY3_ROOT}" -r /aiohttp.web/requirements.txt

+ 5 - 0
frameworks/Python/api_hour/api_hour-dbs.dockerfile

@@ -0,0 +1,5 @@
+FROM tfb/yocto_http-base:latest
+
+WORKDIR /yocto_http
+
+CMD api_hour -ac hello:Container

+ 5 - 0
frameworks/Python/api_hour/api_hour-json.dockerfile

@@ -0,0 +1,5 @@
+FROM tfb/yocto_http-base:latest
+
+WORKDIR /yocto_http
+
+CMD api_hour -ac hello:Container

+ 5 - 0
frameworks/Python/api_hour/api_hour-mysql.dockerfile

@@ -0,0 +1,5 @@
+FROM tfb/aiohttpweb-base:latest
+
+WORKDIR /aiohttp.web
+
+CMD api_hour -ac hello:Container

+ 5 - 0
frameworks/Python/api_hour/api_hour-plaintext.dockerfile

@@ -0,0 +1,5 @@
+FROM tfb/yocto_http-base:latest
+
+WORKDIR /yocto_http
+
+CMD api_hour -ac hello:Container

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

@@ -0,0 +1,5 @@
+FROM tfb/aiohttpweb-base:latest
+
+WORKDIR /aiohttp.web
+
+CMD api_hour -ac hello:Container

+ 0 - 5
frameworks/Python/api_hour/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "api_hour",
   "tests": [{
     "default": {
-      "setup_file": "aiohttp.web/setup-postgresql",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/queries?queries=",
@@ -25,7 +24,6 @@
       "notes": "Python 3 + API-Hour + AsyncIO + aiohttp + PostgreSQL"
     },
     "mysql": {
-      "setup_file": "aiohttp.web/setup-mysql",
       "db_url": "/db_mysql",
       "query_url": "/queries_mysql?queries=",
       "fortune_url": "/fortunes_mysql",
@@ -46,7 +44,6 @@
       "notes": "Python 3 + API-Hour + AsyncIO + aiohttp + MySQL"
     },
     "json": {
-      "setup_file": "yocto_http/setup",
       "json_url": "/json",
       "port": 8080,
       "approach": "Stripped",
@@ -64,7 +61,6 @@
       "notes": "Python 3 + API-Hour + AsyncIO"
     },
     "dbs": {
-      "setup_file": "yocto_http/setup",
       "db_url": "/db",
       "query_url": "/queries?queries=",
       "update_url": "/updates?queries=",
@@ -84,7 +80,6 @@
       "notes": "Python 3 + API-Hour + AsyncIO"
     },
     "plaintext": {
-      "setup_file": "yocto_http/setup",
       "plaintext_url": "/plaintext",
       "port": 8082,
       "approach": "Stripped",

+ 8 - 0
frameworks/Python/api_hour/yocto_http-base.dockerfile

@@ -0,0 +1,8 @@
+FROM tfb/python3:latest
+
+ADD ./yocto_http /yocto_http
+ADD ./requirements.txt /yocto_http
+
+WORKDIR /yocto_http
+
+RUN pip3 install --install-option="--prefix=${PY3_ROOT}" -r /yocto_http/requirements.txt

+ 0 - 64
frameworks/Python/api_hour/yocto_http/.gitignore

@@ -1,64 +0,0 @@
-# Created by .gitignore support plugin (hsz.mobi)
-### Python template
-# Byte-compiled / optimized / DLL files
-__pycache__/
-*.py[cod]
-
-# C extensions
-*.so
-
-# Distribution / packaging
-.Python
-env/
-build/
-develop-eggs/
-dist/
-downloads/
-eggs/
-lib/
-lib64/
-parts/
-sdist/
-var/
-*.egg-info/
-.installed.cfg
-*.egg
-
-# PyInstaller
-#  Usually these files are written by a python script from a template
-#  before PyInstaller builds the exe, so as to inject date/other infos into it.
-*.manifest
-*.spec
-
-# Installer logs
-pip-log.txt
-pip-delete-this-directory.txt
-
-# Unit test / coverage reports
-htmlcov/
-.tox/
-.coverage
-.cache
-nosetests.xml
-coverage.xml
-
-# Translations
-*.mo
-*.pot
-
-# Django stuff:
-*.log
-
-# Sphinx documentation
-docs/_build/
-
-# PyBuilder
-target/
-
-# PyCharm/IDEA files
-.idea
-*.iml
-
-# Virtualenvs
-venv/
-pyvenv/

+ 0 - 22
frameworks/Python/api_hour/yocto_http/README.rst

@@ -1,22 +0,0 @@
-hello
-=====
-
-Install
--------
-
-#. Follow pythonz install doc
-#. pythonz install 3.4.2
-#. cd /opt
-#. Git clone your app here
-#. cd /opt/hello/
-#. /usr/local/pythonz/pythons/CPython-3.4.2/bin/pyvenv pyvenv
-#. . pyvenv/bin/activate
-#. pip install -r requirements.txt
-#. cd /etc/init.d/ && ln -s /opt/hello/etc/init.d/hello
-#. cd /etc/default/ && ln -s /opt/hello/etc/default/hello
-#. cd /etc/monit/conf.d/ && ln -s /opt/hello/etc/monit/conf.d/hello
-#. update-rc.d hello defaults
-#. cp -a /opt/hello/etc/hello /etc/
-#. Adapt rsyslog and lograte
-#. service hello start
-#. service monit restart

+ 0 - 8
frameworks/Python/api_hour/yocto_http/setup.sh

@@ -1,8 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql postgresql python3
-
-pip3 install --install-option="--prefix=${PY3_ROOT}" -r $TROOT/requirements.txt
-
-cd $TROOT/yocto_http
-api_hour -ac hello:Container &

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

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

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

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

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

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

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

@@ -2,7 +2,6 @@
   "framework": "bottle",
   "tests": [{
     "default": {
-      "setup_file": "setup",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/queries?queries=",
@@ -26,7 +25,6 @@
       "versus": "wsgi"
     },
     "pypy2": {
-      "setup_file": "setup_pypy2",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/queries?queries=",
@@ -50,7 +48,6 @@
       "versus": "wsgi"
     },
     "raw": {
-      "setup_file": "setup",
       "db_url": "/raw-db",
       "query_url": "/raw-queries?queries=",
       "fortune_url": "/raw-fortune",
@@ -72,7 +69,6 @@
       "versus": "wsgi"
     },
     "nginx-uwsgi": {
-      "setup_file": "setup_nginxuwsgi",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/queries?queries=",

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

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

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

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

+ 9 - 0
frameworks/Python/bottle/bottle-raw.dockerfile

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

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

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

+ 0 - 7
frameworks/Python/bottle/setup.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 &

+ 0 - 10
frameworks/Python/bottle/setup_nginxuwsgi.sh

@@ -1,10 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql python3 nginx
-
-sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' nginx.conf
-
-pip3 install --install-option="--prefix=${PY3_ROOT}" -r $TROOT/requirements.txt
-
-nginx -c $TROOT/nginx.conf
-uwsgi --ini $TROOT/uwsgi.ini --processes $((CPU_COUNT*3)) --wsgi app:app &

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -1 +0,0 @@
-*.sqlite

+ 0 - 3
frameworks/Python/django/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "django",
   "tests": [{
     "default": {
-      "setup_file": "setup",
       "plaintext_url" : "/plaintext",
       "json_url": "/json",
       "db_url": "/db",
@@ -26,7 +25,6 @@
       "versus": "wsgi"
     },
     "py3": {
-      "setup_file": "setup_py3",
       "plaintext_url" : "/plaintext",
       "json_url": "/json",
       "db_url": "/db",
@@ -50,7 +48,6 @@
       "versus": "wsgi"
     },
     "postgresql": {
-      "setup_file": "setup_pg",
       "db_url": "/db",
       "query_url": "/dbs?queries=",
       "fortune_url": "/fortunes",

+ 7 - 0
frameworks/Python/django/django-base.dockerfile

@@ -0,0 +1,7 @@
+FROM tfb/python2:latest
+
+ADD ./ /django
+
+WORKDIR /django
+
+RUN pip install --install-option="--prefix=${PY2_ROOT}" -r /django/requirements.txt

+ 5 - 0
frameworks/Python/django/django-postgresql.dockerfile

@@ -0,0 +1,5 @@
+FROM tfb/django-base:latest
+
+WORKDIR /django
+
+CMD gunicorn --pid=gunicorn.pid hello.wsgi:application -c gunicorn_conf.py --env DJANGO_DB=postgresql_psycopg2

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

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

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

@@ -0,0 +1,5 @@
+FROM tfb/django-base:latest
+
+WORKDIR /django
+
+CMD gunicorn --pid=gunicorn.pid hello.wsgi:application -c gunicorn_conf.py --env DJANGO_DB=mysql

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

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

+ 0 - 7
frameworks/Python/django/setup_pg.sh

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

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

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql python3
-
-pip3 install --install-option="--prefix=${PY3_ROOT}" -r $TROOT/requirements_py3.txt
-
-gunicorn --pid=gunicorn.pid hello.wsgi:application -c gunicorn_conf.py --env DJANGO_DB=mysql &

+ 0 - 3
frameworks/Python/falcon/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "falcon",
   "tests": [{
     "default": {
-      "setup_file": "setup",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "port": 8080,
@@ -22,7 +21,6 @@
       "versus": "wsgi"
     },
     "py3": {
-      "setup_file": "setup_py3",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "port": 8080,
@@ -42,7 +40,6 @@
       "versus": "wsgi"
     },
     "pypy2": {
-      "setup_file": "setup_pypy2",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "port": 8080,

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -2,7 +2,6 @@
   "framework": "flask",
   "tests": [{
     "default": {
-      "setup_file": "setup_py3",
       "json_url": "/json",
       "db_url": "/dbs",
       "query_url": "/db?queries=",
@@ -26,7 +25,6 @@
       "versus": "wsgi"
     },
     "raw": {
-      "setup_file": "setup_py3",
       "db_url": "/dbsraw",
       "query_url": "/dbraw?queries=",
       "fortune_url": "/fortunesraw",
@@ -48,7 +46,6 @@
       "versus": "wsgi"
     },
     "pypy2": {
-      "setup_file": "setup_pypy2",
       "json_url": "/json",
       "db_url": "/dbs",
       "query_url": "/db?queries=",
@@ -94,7 +91,6 @@
       "versus": "wsgi"
     },
     "nginx-uwsgi": {
-      "setup_file": "setup_nginxuwsgi",
       "json_url": "/json",
       "db_url": "/dbs",
       "query_url": "/db?queries=",

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

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

+ 7 - 0
frameworks/Python/flask/flask-py3-base.dockerfile

@@ -0,0 +1,7 @@
+FROM tfb/python3:latest
+
+ADD ./ /flask
+
+WORKDIR /flask
+
+RUN pip3 install --install-option="--prefix=${PY3_ROOT}" -r /flask/requirements.txt

+ 7 - 0
frameworks/Python/flask/flask-pypy2-base.dockerfile

@@ -0,0 +1,7 @@
+FROM tfb/pypy2:latest
+
+ADD ./ /flask
+
+WORKDIR /flask
+
+RUN pip install --install-option="--prefix=${PYPY2_ROOT}" -r /flask/requirements-pypy.txt

+ 5 - 0
frameworks/Python/flask/flask-pypy2-raw.dockerfile

@@ -0,0 +1,5 @@
+FROM tfb/flask-pypy2-base:latest
+
+WORKDIR /flask
+
+CMD gunicorn app:app -c gunicorn_conf.py

+ 5 - 0
frameworks/Python/flask/flask-pypy2.dockerfile

@@ -0,0 +1,5 @@
+FROM tfb/flask-pypy2-base:latest
+
+WORKDIR /flask
+
+CMD gunicorn app:app -c gunicorn_conf.py

+ 5 - 0
frameworks/Python/flask/flask-raw.dockerfile

@@ -0,0 +1,5 @@
+FROM tfb/flask-py3-base:latest
+
+WORKDIR /flask
+
+CMD gunicorn app:app -c gunicorn_conf.py

+ 3 - 0
frameworks/Python/flask/flask.dockerfile

@@ -0,0 +1,3 @@
+FROM tfb/flask-py3-base:latest
+
+CMD gunicorn app:app -c gunicorn_conf.py

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

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

+ 0 - 7
frameworks/Python/flask/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 &

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

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

+ 13 - 0
toolset/setup/docker/languages/pypy2.dockerfile

@@ -0,0 +1,13 @@
+FROM tfb/base:latest
+  
+ENV PYPY2_ROOT=/pypy2
+ENV PYTHONHOME=${PYPY2_ROOT}
+ENV PYPY2_VERSION=5.10.0
+ENV PATH=${PYPY2_ROOT}/bin:${PATH}
+
+RUN wget -q https://bitbucket.org/pypy/pypy/downloads/pypy2-v${PYPY2_VERSION}-linux64.tar.bz2
+RUN tar xvf pypy2-v${PYPY2_VERSION}-linux64.tar.bz2
+RUN mv pypy2-v${PYPY2_VERSION}-linux64 $PYPY2_ROOT
+
+RUN pypy -m ensurepip
+RUN pip install -U pip setuptools wheel

+ 22 - 0
toolset/setup/docker/languages/python2.dockerfile

@@ -0,0 +1,22 @@
+FROM tfb/base:latest
+  
+ENV PY2_ROOT=/py2
+ENV PYTHONHOME=${PY2_ROOT}
+ENV PY2_VERSION=2.7.14
+ENV PATH=${PY2_ROOT}/bin:${PATH}
+
+RUN mkdir $PY2_ROOT
+
+RUN wget -q http://www.python.org/ftp/python/${PY2_VERSION}/Python-${PY2_VERSION}.tar.xz
+RUN tar xvf Python-${PY2_VERSION}.tar.xz
+
+WORKDIR Python-${PY2_VERSION}
+
+RUN ./configure --prefix=$PY2_ROOT --disable-shared --with-computed-gotos --quiet
+RUN make -j4 --quiet 2>&1 | tee python2-install.log | awk '{ if (NR%100 == 0) printf "."}'
+RUN make install --quiet 2>&1 | tee -a python2-install.log | awk '{ if (NR%100 == 0) printf "."}'
+
+WORKDIR /py2
+
+RUN python -m ensurepip -U
+RUN pip install -U setuptools pip wheel

+ 23 - 0
toolset/setup/docker/languages/python3.dockerfile

@@ -0,0 +1,23 @@
+FROM tfb/base:latest
+  
+ENV PY3_ROOT=/py3
+ENV PYTHONHOME=${PY3_ROOT}
+ENV PY3_VERSION=3.6.4
+ENV PATH=${PY3_ROOT}/bin:${PATH}
+
+RUN mkdir py3
+
+RUN wget -q http://www.python.org/ftp/python/${PY3_VERSION}/Python-${PY3_VERSION}.tar.xz
+RUN tar xvf Python-${PY3_VERSION}.tar.xz
+
+WORKDIR Python-${PY3_VERSION}
+
+RUN ./configure --prefix=$PY3_ROOT --disable-shared --with-computed-gotos --quiet
+RUN make -j4 --quiet 2>&1 | tee python3-install.log | awk '{ if (NR%100 == 0) printf "."}'
+RUN make install --quiet 2>&1 | tee -a python3-install.log | awk '{ if (NR%100 == 0) printf "."}'
+
+WORKDIR /py3
+
+
+RUN python3 -m ensurepip -U
+RUN pip3 install -U setuptools pip wheel

+ 0 - 19
toolset/setup/linux/languages/pypy2.sh

@@ -1,19 +0,0 @@
-#!/bin/bash
-
-fw_installed pypy2 && return 0
-  
-PYPY2_ROOT=$IROOT/pypy2
-PYPY2_VERSION=5.10.0
-
-fw_get -o pypy2-v${PYPY2_VERSION}-linux64.tar.bz2 https://bitbucket.org/pypy/pypy/downloads/pypy2-v${PYPY2_VERSION}-linux64.tar.bz2
-fw_untar pypy2-v${PYPY2_VERSION}-linux64.tar.bz2
-mv pypy2-v${PYPY2_VERSION}-linux64 pypy2
-
-$PYPY2_ROOT/bin/pypy -m ensurepip
-$PYPY2_ROOT/bin/pip install -U pip setuptools wheel
-
-echo "export PYPY2_ROOT=${PYPY2_ROOT}" > $IROOT/pypy2.installed
-echo "export PYTHONHOME=${PYPY2_ROOT}" >> $IROOT/pypy2.installed
-echo -e "export PATH=${PYPY2_ROOT}/bin:\$PATH" >> $IROOT/pypy2.installed
-  
-source $IROOT/pypy2.installed

+ 0 - 23
toolset/setup/linux/languages/python2.sh

@@ -1,23 +0,0 @@
-#!/bin/bash
-
-fw_installed py2 && return 0
-
-PY2_ROOT=$IROOT/py2
-PY2_VERSION=2.7.14
-
-fw_get -O http://www.python.org/ftp/python/${PY2_VERSION}/Python-${PY2_VERSION}.tar.xz
-fw_untar Python-${PY2_VERSION}.tar.xz
-cd Python-${PY2_VERSION}
-./configure --prefix=${IROOT}/py2 --disable-shared --quiet
-make -j4 --quiet 2>&1 | tee $IROOT/python-install.log | awk '{ if (NR%100 == 0) printf "."}'
-make install --quiet 2>&1 | tee -a $IROOT/python-install.log | awk '{ if (NR%100 == 0) printf "."}'
-cd ..
-
-$PY2_ROOT/bin/python -m ensurepip -U
-$PY2_ROOT/bin/pip install -U setuptools pip wheel
-
-echo "export PY2_ROOT=${PY2_ROOT}" > $IROOT/py2.installed
-echo -e "export PYTHONHOME=\$PY2_ROOT" >> $IROOT/py2.installed
-echo -e "export PATH=\$PY2_ROOT/bin:\$PATH" >> $IROOT/py2.installed
-
-source $IROOT/py2.installed

+ 0 - 23
toolset/setup/linux/languages/python3.sh

@@ -1,23 +0,0 @@
-#!/bin/bash
-
-fw_installed py3 && return 0
-  
-PY3_ROOT=$IROOT/py3
-PY3_VERSION=3.6.4
-
-fw_get -O http://www.python.org/ftp/python/${PY3_VERSION}/Python-${PY3_VERSION}.tar.xz
-fw_untar Python-${PY3_VERSION}.tar.xz
-cd Python-${PY3_VERSION}
-./configure --prefix=$PY3_ROOT --disable-shared --with-computed-gotos --quiet
-make -j4 --quiet 2>&1 | tee $IROOT/python3-install.log | awk '{ if (NR%100 == 0) printf "."}'
-make install --quiet 2>&1 | tee -a $IROOT/python3-install.log | awk '{ if (NR%100 == 0) printf "."}'
-cd ..
-
-$PY3_ROOT/bin/python3 -m ensurepip -U
-$PY3_ROOT/bin/pip3 install -U setuptools pip wheel
-
-echo "export PY3_ROOT=${PY3_ROOT}" > $IROOT/py3.installed
-echo -e "export PYTHONHOME=\$PY3_ROOT" >> $IROOT/py3.installed
-echo -e "export PATH=\$PY3_ROOT/bin:\$PATH" >> $IROOT/py3.installed
-
-source $IROOT/py3.installed