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 index b6248c719..8d2fca53e 100644 Binary files a/source/dependencies/docx_generator-0.8.0-py3-none-any.whl and b/source/dependencies/docx_generator-0.8.0-py3-none-any.whl differ 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)