Browse Source

[Python] Falcon: use 3.11 python and delete repeated tests (#8180)

Issues: #8137, #8178
Oleg S 2 years ago
parent
commit
d60390ddc2
26 changed files with 75 additions and 59 deletions
  1. 3 0
      frameworks/Python/falcon/app.py
  2. 0 2
      frameworks/Python/falcon/benchmark_config.json
  3. 0 2
      frameworks/Python/falcon/config.toml
  4. 7 5
      frameworks/Python/falcon/falcon-asgi.dockerfile
  5. 4 1
      frameworks/Python/falcon/falcon-bjoern.dockerfile
  6. 5 2
      frameworks/Python/falcon/falcon-fastwsgi.dockerfile
  7. 7 4
      frameworks/Python/falcon/falcon-orjson.dockerfile
  8. 4 1
      frameworks/Python/falcon/falcon-pypy3.dockerfile
  9. 3 1
      frameworks/Python/falcon/falcon-socketify-asgi-pypy3.dockerfile
  10. 6 5
      frameworks/Python/falcon/falcon-socketify-asgi.dockerfile
  11. 4 1
      frameworks/Python/falcon/falcon-socketify-wsgi-pypy3.dockerfile
  12. 7 5
      frameworks/Python/falcon/falcon-socketify-wsgi.dockerfile
  13. 4 1
      frameworks/Python/falcon/falcon-waitress.dockerfile
  14. 6 4
      frameworks/Python/falcon/falcon.dockerfile
  15. 2 5
      frameworks/Python/falcon/helpers.py
  16. 0 1
      frameworks/Python/falcon/requirements-bjoern.txt
  17. 3 0
      frameworks/Python/falcon/requirements-db-pony.txt
  18. 3 0
      frameworks/Python/falcon/requirements-db-tortoise.txt
  19. 0 1
      frameworks/Python/falcon/requirements-fastwsgi.txt
  20. 2 0
      frameworks/Python/falcon/requirements-meinheld.txt
  21. 0 4
      frameworks/Python/falcon/requirements-pypy.txt
  22. 0 1
      frameworks/Python/falcon/requirements-socketify-pypy.txt
  23. 0 1
      frameworks/Python/falcon/requirements-socketify.txt
  24. 4 0
      frameworks/Python/falcon/requirements-uvicorn.txt
  25. 1 0
      frameworks/Python/falcon/requirements-waitress.txt
  26. 0 12
      frameworks/Python/falcon/requirements.txt

+ 3 - 0
frameworks/Python/falcon/app.py

@@ -140,6 +140,8 @@ if __name__ == "__main__":
         logging.basicConfig()
         logging.getLogger().setLevel(logging.CRITICAL)
         logging.disable(True)
+        if workers < 4:
+            workers = 4
         waitress.serve(
             app=wsgi,
             listen=f"{opt.host}:{opt.port}",
@@ -170,6 +172,7 @@ if __name__ == "__main__":
             import fastwsgi
             response_server = "FastWSGI"
             response_add_date = False
+            fastwsgi.server.backlog = 4096
             fastwsgi.run(app, host=opt.host, port=opt.port, loglevel=opt.verbose)
 
         if opt.server == 'socketify':

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

@@ -151,8 +151,6 @@
       "db_url": "/db",
       "query_url": "/queries/",
       "update_url": "/updates/",
-      "fortune_url": "/fortunes",
-      "plaintext_url": "/plaintext",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Micro",

+ 0 - 2
frameworks/Python/falcon/config.toml

@@ -75,8 +75,6 @@ json.url = "/json"
 db.url = "/db"
 query.url = "/queries/"
 update.url = "/updates/"
-fortune.url = "/fortunes"
-plaintext.url = "/plaintext"
 port = 8080
 approach = "Realistic"
 classification = "Micro"

+ 7 - 5
frameworks/Python/falcon/falcon-asgi.dockerfile

@@ -1,12 +1,14 @@
-FROM python:3.9-bullseye
+FROM python:3.10-bullseye
 
 RUN apt-get update; apt-get install libpq-dev python3-dev -y
 WORKDIR /falcon
 COPY ./ /falcon
-RUN pip3 install -U pip; \
-    pip3 install cython==0.29.26; \
-    pip3 install -r /falcon/requirements.txt; \
-    pip3 install falcon==3.1.1 --no-binary :all:;
+RUN pip3 install -U pip
+RUN pip3 install cython==0.29.26
+#RUN pip3 install falcon==3.1.1 --no-binary :all:
+RUN pip3 install -r /falcon/requirements.txt
+RUN pip3 install -r /falcon/requirements-uvicorn.txt
+RUN pip3 install -r /falcon/requirements-db-tortoise.txt
 
 ENV ASYNCIO=true
 

+ 4 - 1
frameworks/Python/falcon/falcon-bjoern.dockerfile

@@ -3,7 +3,10 @@ FROM python:3.9-bullseye
 RUN apt-get update; apt-get install libpq-dev python3-dev libev-dev -y
 WORKDIR /falcon
 COPY ./ /falcon
-RUN pip3 install -U pip; pip3 install -r /falcon/requirements-bjoern.txt
+RUN pip3 install -U pip
+RUN pip3 install -r /falcon/requirements.txt
+RUN pip3 install -r /falcon/requirements-bjoern.txt
+RUN pip3 install -r /falcon/requirements-db-pony.txt
 
 EXPOSE 8080
 

+ 5 - 2
frameworks/Python/falcon/falcon-fastwsgi.dockerfile

@@ -1,9 +1,12 @@
-FROM python:3.9-bullseye
+FROM python:3.11-bullseye
 
 RUN apt-get update; apt-get install libpq-dev python3-dev -y
 WORKDIR /falcon
 COPY ./ /falcon
-RUN pip3 install -U pip; pip3 install -r /falcon/requirements-fastwsgi.txt
+RUN pip3 install -U pip
+RUN pip3 install -r /falcon/requirements.txt
+RUN pip3 install -r /falcon/requirements-fastwsgi.txt
+RUN pip3 install -r /falcon/requirements-db-pony.txt
 
 EXPOSE 8080
 

+ 7 - 4
frameworks/Python/falcon/falcon-orjson.dockerfile

@@ -3,10 +3,13 @@ FROM python:3.9-bullseye
 RUN apt-get update; apt-get install libpq-dev python3-dev -y
 WORKDIR /falcon
 COPY ./ /falcon
-RUN pip3 install -U pip; \
-    pip3 install cython==0.29.26; \
-    pip3 install -r /falcon/requirements.txt; \
-    pip3 install falcon==3.1.1 --no-binary :all:;
+RUN pip3 install -U pip
+RUN pip3 install cython==0.29.26
+RUN pip3 install orjson==3.8.10
+#RUN pip3 install falcon==3.1.1 --no-binary :all:
+RUN pip3 install -r /falcon/requirements.txt
+RUN pip3 install -r /falcon/requirements-meinheld.txt
+RUN pip3 install -r /falcon/requirements-db-pony.txt
 
 EXPOSE 8080
 

+ 4 - 1
frameworks/Python/falcon/falcon-pypy3.dockerfile

@@ -3,7 +3,10 @@ FROM pypy:3.9-bullseye
 RUN apt-get update; apt-get install libpq-dev python3-dev -y
 COPY ./ /falcon
 WORKDIR /falcon
-RUN pip3 install -U pip; pip3 install -r /falcon/requirements-pypy.txt
+RUN pip3 install -U pip
+RUN pip3 install -r /falcon/requirements.txt
+RUN pip3 install gunicorn==20.1.0
+RUN pip3 install -r /falcon/requirements-db-pony.txt
 
 EXPOSE 8080
 

+ 3 - 1
frameworks/Python/falcon/falcon-socketify-asgi-pypy3.dockerfile

@@ -3,7 +3,9 @@ FROM pypy:3.9-bullseye
 RUN apt-get update; apt-get install libpq-dev python3-dev libuv1-dev -y
 COPY ./ /falcon
 WORKDIR /falcon
-RUN pip3 install -U pip; pip3 install -r /falcon/requirements-socketify-pypy.txt
+RUN pip3 install -U pip
+RUN pip3 install -r /falcon/requirements.txt
+RUN pip3 install -r /falcon/requirements-socketify.txt
 
 EXPOSE 8080
 

+ 6 - 5
frameworks/Python/falcon/falcon-socketify-asgi.dockerfile

@@ -1,12 +1,13 @@
-FROM python:3.9-bullseye
+FROM python:3.11-bullseye
 
 RUN apt-get update; apt-get install libpq-dev python3-dev libuv1-dev -y
 COPY ./ /falcon
 WORKDIR /falcon
-RUN pip3 install -U pip; \
-    pip3 install cython==0.29.26; \
-    pip3 install falcon==3.1.1 --no-binary :all:; \
-    pip3 install -r /falcon/requirements-socketify.txt
+RUN pip3 install -U pip
+RUN pip3 install cython==0.29.26
+#RUN pip3 install falcon==3.1.1 --no-binary :all:
+RUN pip3 install -r /falcon/requirements.txt
+RUN pip3 install -r /falcon/requirements-socketify.txt
 
 EXPOSE 8080
 

+ 4 - 1
frameworks/Python/falcon/falcon-socketify-wsgi-pypy3.dockerfile

@@ -3,7 +3,10 @@ FROM pypy:3.9-bullseye
 RUN apt-get update; apt-get install libpq-dev python3-dev libuv1-dev -y
 COPY ./ /falcon
 WORKDIR /falcon
-RUN pip3 install -U pip; pip3 install -r /falcon/requirements-socketify-pypy.txt
+RUN pip3 install -U pip
+RUN pip3 install -r /falcon/requirements.txt
+RUN pip3 install -r /falcon/requirements-socketify.txt
+RUN pip3 install -r /falcon/requirements-db-pony.txt
 
 EXPOSE 8080
 

+ 7 - 5
frameworks/Python/falcon/falcon-socketify-wsgi.dockerfile

@@ -1,12 +1,14 @@
-FROM python:3.9-bullseye
+FROM python:3.11-bullseye
 
 RUN apt-get update; apt-get install libpq-dev python3-dev libuv1-dev -y
 COPY ./ /falcon
 WORKDIR /falcon
-RUN pip3 install -U pip; \
-    pip3 install cython==0.29.26; \
-    pip3 install falcon==3.1.1 --no-binary :all:; \
-    pip3 install -r /falcon/requirements-socketify.txt
+RUN pip3 install -U pip
+RUN pip3 install cython==0.29.26
+#RUN pip3 install falcon==3.1.1 --no-binary :all:
+RUN pip3 install -r /falcon/requirements.txt
+RUN pip3 install -r /falcon/requirements-socketify.txt
+RUN pip3 install -r /falcon/requirements-db-pony.txt
 
 EXPOSE 8080
 

+ 4 - 1
frameworks/Python/falcon/falcon-waitress.dockerfile

@@ -3,7 +3,10 @@ FROM python:3.9-bullseye
 RUN apt-get update; apt-get install libpq-dev python3-dev -y
 WORKDIR /falcon
 COPY ./ /falcon
-RUN pip3 install -U pip; pip3 install -r /falcon/requirements.txt
+RUN pip3 install -U pip
+RUN pip3 install -r /falcon/requirements.txt
+RUN pip3 install -r /falcon/requirements-waitress.txt
+RUN pip3 install -r /falcon/requirements-db-pony.txt
 
 EXPOSE 8080
 

+ 6 - 4
frameworks/Python/falcon/falcon.dockerfile

@@ -3,10 +3,12 @@ FROM python:3.9-bullseye
 RUN apt-get update; apt-get install libpq-dev python3-dev -y
 WORKDIR /falcon
 COPY ./ /falcon
-RUN pip3 install -U pip; \
-    pip3 install cython==0.29.26; \
-    pip3 install -r /falcon/requirements.txt; \
-    pip3 install falcon==3.1.1 --no-binary :all:;
+RUN pip3 install -U pip
+RUN pip3 install cython==0.29.26
+#RUN pip3 install falcon==3.1.1 --no-binary :all:
+RUN pip3 install -r /falcon/requirements.txt
+RUN pip3 install -r /falcon/requirements-meinheld.txt
+RUN pip3 install -r /falcon/requirements-db-pony.txt
 
 EXPOSE 8080
 

+ 2 - 5
frameworks/Python/falcon/helpers.py

@@ -1,7 +1,7 @@
 import jinja2
 from pathlib import Path
 from collections import namedtuple
-from random import randint
+import random
 
 
 def sanitize(query):
@@ -19,10 +19,7 @@ def sanitize(query):
 
 
 def generate_ids(num_queries):
-    ids = {randint(1, 10000) for _ in range(num_queries)}
-    while len(ids) < num_queries:
-        ids.add(randint(1, 10000))
-    return list(sorted(ids))
+    return random.sample(range(1, 10000), num_queries)
 
 
 def load_template():

+ 0 - 1
frameworks/Python/falcon/requirements-bjoern.txt

@@ -1,2 +1 @@
--r requirements.txt
 bjoern==3.1.0

+ 3 - 0
frameworks/Python/falcon/requirements-db-pony.txt

@@ -0,0 +1,3 @@
+pony==0.7.16
+psycopg2-binary==2.9.3; implementation_name=='cpython'
+psycopg2cffi==2.9.0; implementation_name=='pypy'

+ 3 - 0
frameworks/Python/falcon/requirements-db-tortoise.txt

@@ -0,0 +1,3 @@
+asyncpg==0.27.0
+orjson==3.8.10
+tortoise-orm==0.19.3

+ 0 - 1
frameworks/Python/falcon/requirements-fastwsgi.txt

@@ -1,3 +1,2 @@
--r requirements.txt
 click==8.0.1
 fastwsgi==0.0.9

+ 2 - 0
frameworks/Python/falcon/requirements-meinheld.txt

@@ -0,0 +1,2 @@
+gunicorn==20.1.0
+meinheld==1.0.2

+ 0 - 4
frameworks/Python/falcon/requirements-pypy.txt

@@ -1,5 +1 @@
-falcon==3.1.1
 gunicorn==20.1.0
-jinja2==3.0.3
-pony==0.7.16
-psycopg2cffi==2.9.0; implementation_name=='pypy'

+ 0 - 1
frameworks/Python/falcon/requirements-socketify-pypy.txt

@@ -1,2 +1 @@
--r requirements-pypy.txt
 git+https://github.com/cirospaciari/socketify.py.git@main#socketify

+ 0 - 1
frameworks/Python/falcon/requirements-socketify.txt

@@ -1,2 +1 @@
--r requirements.txt
 git+https://github.com/cirospaciari/socketify.py.git@main#socketify

+ 4 - 0
frameworks/Python/falcon/requirements-uvicorn.txt

@@ -0,0 +1,4 @@
+gunicorn==20.1.0
+httptools==0.5.0
+uvloop==0.17.0
+uvicorn==0.21.1

+ 1 - 0
frameworks/Python/falcon/requirements-waitress.txt

@@ -0,0 +1 @@
+waitress==2.1.2

+ 0 - 12
frameworks/Python/falcon/requirements.txt

@@ -1,14 +1,2 @@
-asyncpg==0.27.0
-Cython==0.29.26
 falcon==3.1.1
-gunicorn==20.1.0
 jinja2==3.0.3
-meinheld==1.0.2
-orjson==3.6.5
-pony==0.7.16
-psycopg2-binary==2.9.3; implementation_name=='cpython'
-tortoise-orm==0.19.2
-httptools==0.5.0
-uvloop==0.17.0
-uvicorn==0.20.0
-waitress==2.1.2