From 8a1f67d724827ad93af1dc282ea9f81e46d31f12 Mon Sep 17 00:00:00 2001 From: whikernel Date: Tue, 17 Dec 2024 09:38:53 +0100 Subject: [PATCH] [UPD] Updated to Python 3.12 --- docker/webApp/Dockerfile | 4 +-- docker/webApp/iris-entrypoint.sh | 2 +- source/app/__init__.py | 11 +++---- .../app/blueprints/graphql/graphql_route.py | 6 ++++ source/app/configuration.py | 1 + source/app/flask_dropzone/__init__.py | 2 +- .../docx_generator-0.8.0-py3-none-any.whl | Bin 23759 -> 23751 bytes source/requirements.txt | 31 +++++++++--------- source/run.py | 2 +- 9 files changed, 32 insertions(+), 27 deletions(-) diff --git a/docker/webApp/Dockerfile b/docker/webApp/Dockerfile index 34ddba730..d80a424a1 100644 --- a/docker/webApp/Dockerfile +++ b/docker/webApp/Dockerfile @@ -20,7 +20,7 @@ ################# # COMPILE IMAGE # ################# -FROM python:3.9 AS compile-image +FROM python:3.12 AS compile-image RUN apt-get update RUN python -m venv /opt/venv @@ -35,7 +35,7 @@ RUN pip3 install -r requirements.txt ############### # BUILD IMAGE # ############### -FROM python:3.9 as iriswebapp +FROM python:3.12 as iriswebapp ENV PYTHONUNBUFFERED=1 DOCKERIZED=1 COPY --from=compile-image /opt/venv /opt/venv diff --git a/docker/webApp/iris-entrypoint.sh b/docker/webApp/iris-entrypoint.sh index 8ca0a64bc..68357b553 100755 --- a/docker/webApp/iris-entrypoint.sh +++ b/docker/webApp/iris-entrypoint.sh @@ -28,7 +28,7 @@ printf "Running ${target} ...\n" if [[ "${target}" == iris-worker ]] ; then celery -A app.celery worker -E -B -l INFO & else - gunicorn app:app --worker-class eventlet --bind 0.0.0.0:8000 --timeout 180 --worker-connections 1000 --log-level=info & + gunicorn app:app --bind 0.0.0.0:8000 --timeout 180 --worker-connections 1000 --threads 100 -w 1 --log-level=info & fi while true; do sleep 2; done diff --git a/source/app/__init__.py b/source/app/__init__.py index f92449f88..1bdfb1808 100644 --- a/source/app/__init__.py +++ b/source/app/__init__.py @@ -29,7 +29,6 @@ from flask_socketio import SocketIO, Namespace from flask_sqlalchemy import SQLAlchemy from functools import partial -from sqlalchemy_imageattach.stores.fs import HttpExposedFileSystemStore from werkzeug.middleware.proxy_fix import ProxyFix from app.flask_dropzone import Dropzone @@ -116,13 +115,13 @@ def ac_current_user_has_manage_perms(): celery = make_celery(app) -store = HttpExposedFileSystemStore( - path='images', - prefix='/static/assets/images/' -) +# store = HttpExposedFileSystemStore( +# path='images', +# prefix='/static/assets/images/' +# ) app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1) -app.wsgi_app = store.wsgi_middleware(app.wsgi_app) +#app.wsgi_app = store.wsgi_middleware(app.wsgi_app) socket_io = SocketIO(app, cors_allowed_origins="*") diff --git a/source/app/blueprints/graphql/graphql_route.py b/source/app/blueprints/graphql/graphql_route.py index 42e0ca987..8bbd587b1 100644 --- a/source/app/blueprints/graphql/graphql_route.py +++ b/source/app/blueprints/graphql/graphql_route.py @@ -49,6 +49,12 @@ from app.blueprints.graphql.cases import CaseUpdate from app.blueprints.graphql.cases import CaseConnection +import warnings + +# Ignore all UserWarnings +warnings.filterwarnings("ignore", category=UserWarning) + + class Query(ObjectType): """This is the IRIS GraphQL queries documentation!""" diff --git a/source/app/configuration.py b/source/app/configuration.py index 9b4dc093c..20ea79dbb 100644 --- a/source/app/configuration.py +++ b/source/app/configuration.py @@ -259,6 +259,7 @@ class CeleryConfig: result_extended = True result_serializer = "json" worker_pool_restarts = True + broker_connection_retry_on_startup =True # --------- APP --------- diff --git a/source/app/flask_dropzone/__init__.py b/source/app/flask_dropzone/__init__.py index 19abc0d0a..ef84ce27d 100644 --- a/source/app/flask_dropzone/__init__.py +++ b/source/app/flask_dropzone/__init__.py @@ -9,7 +9,7 @@ """ import warnings from flask import Blueprint -from flask import Markup +from markupsafe import Markup from flask import current_app from flask import render_template_string from flask import url_for diff --git a/source/dependencies/docx_generator-0.8.0-py3-none-any.whl b/source/dependencies/docx_generator-0.8.0-py3-none-any.whl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0Co?xy|7I2$lnCgwvt{95 zOPrxln|`$X3~M_%?Wy0NWzDDwq4j4zbyzSIUZhX_96?iTL&La+!!V*RyOkE@Fy>}w zyU_+%iW)atj$0BzMz8#(kk9Jz0(;CUJ1p6fZ;K+OoA0kTuWSkCrq{5bvxxL1Ahv?; zsFhpt7l|!Hj&#_{@5;tG%uVmlwcFnr&@0A7NNy($uszzkgMA>O=)BAO(oW4z9rjHa zU=>lGa+4OHsl=#`?z|UpTa$Nl%yBFp!GotV?pp_KG{;UKE*5epsDwj0?7x-j~V8Y4BXhOwF^XR*{K8}doBh`hPGz_JN zAjM!st{A$mT~?J4Ko8I5AK!&s>Rk@C_fAN2(vx+SXM3aNDHhVV4*t5eIpbr7LjRh~ z)V6M+?v3IGji%IQuOHQqMP1aP?T<;!d4`HT!hLS~_)v0VkWk+|BPOQ)BX0kjlO6o9 z?+?Q#W!vX2D5tXc^TC@;!ddYF1o=%>K`b~~9OFq8bGTF*ZeRWhkE1^1$-a7r`Q@29 z$`B8Dnjjh8MBeFlm}7*-Xp^GKjDR2f@^*TM63ulJn`|-SQ9sM3&{uamA9F(Bxl3_IcdcSUk*E^#gmC988Meh8`i-8%Hv-!jIajg n6Clh$f9*AR%_V98K)DtGVETnzxvNwf{(-svP>tt4t3Q7Ofwl4% diff --git a/source/requirements.txt b/source/requirements.txt index b4209c480..ecb4bf0b8 100644 --- a/source/requirements.txt +++ b/source/requirements.txt @@ -1,28 +1,27 @@ azure-identity==1.10.0 azure-keyvault-secrets==4.5.1 -celery==5.2.7 -Flask==2.3.2 +celery==5.4.0 +Flask==3.1.0 Flask-Bcrypt==1.0.1 -Flask-Login==0.6.2 -Flask-SQLAlchemy==3.0.2 -Flask-WTF==1.1.1 -flask-marshmallow==0.14.0 -Flask-Caching==1.10.1 -marshmallow==3.20.1 -marshmallow-sqlalchemy==0.30.0 -gunicorn==20.1.0 +Flask-Login==0.6.3 +Flask-SQLAlchemy==3.1.1 +Flask-WTF==1.2.2 +flask-marshmallow==1.2.1 +Flask-Caching==2.3.0 +marshmallow==3.23.1 +marshmallow-sqlalchemy==1.1.0 +gunicorn==23.0.0 psycopg2-binary==2.9.10 pyunpack==0.2.2 packaging==21.3 requests==2.31.0 -SQLAlchemy==2.0.24 +SQLAlchemy==2.0.36 SQLAlchemy-ImageAttach==1.1.0 -SQLAlchemy-Utils==0.41.1 +SQLAlchemy-Utils==0.41.2 urllib3==1.26.18 -Werkzeug==2.3.7 -WTForms==2.2.1 -flask-socketio==5.1.1 -eventlet==0.30.2 +Werkzeug==3.1.3 +WTForms==3.2.1 +Flask-SocketIO==5.4.1 alembic==1.7.5 setuptools~=70.3.0 python-dateutil==2.8.2 diff --git a/source/run.py b/source/run.py index 32dbe6204..d3dccd4e7 100644 --- a/source/run.py +++ b/source/run.py @@ -27,5 +27,5 @@ if __name__ == "__main__": - socket_io.run(app, host='127.0.0.1', port=8000, debug=True) + socket_io.run(app, host='127.0.0.1', port=8000, debug=True, allow_unsafe_werkzeug=True)