From 7ed2323dd35e8a06c624c095f9f8aceeb5ff2558 Mon Sep 17 00:00:00 2001 From: Avik Datta Date: Wed, 31 May 2023 15:03:34 +0100 Subject: [PATCH] report file upload for portal --- .gitignore | 2 ++ app/pre_demultiplexing_data_api.py | 4 ++++ config.py | 2 +- docker-compose.yaml | 6 +++++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 920709c..d15afc5 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ tests/1__init__.py aaa facebook.ico migration_docker_db.sh +static/* +celery_tmp/* diff --git a/app/pre_demultiplexing_data_api.py b/app/pre_demultiplexing_data_api.py index b10f9ab..4a1cda7 100644 --- a/app/pre_demultiplexing_data_api.py +++ b/app/pre_demultiplexing_data_api.py @@ -97,6 +97,10 @@ class PreDeMultiplexingDataApi(ModelRestApi): @protect() def add_report(self): try: + log.warn('received_res') + log.warn(f"Files: {request.files}") + log.warn(f"Data: {request.data}") + log.warn(f"Form: {request.form}") if not request.files: return self.response_400('No files') json_data = request.form diff --git a/config.py b/config.py index 7ab99bf..889bc46 100644 --- a/config.py +++ b/config.py @@ -109,7 +109,7 @@ # IMG_SIZE = (300, 200, True) ## report upload folder -REPORT_UPLOAD_PATH = "/static/reports/" +REPORT_UPLOAD_PATH = "/data/static/reports/" # Theme configuration # these are located on static/appbuilder/css/themes diff --git a/docker-compose.yaml b/docker-compose.yaml index 7b20005..e4f8cc9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -33,6 +33,7 @@ services: webserver: image: imperialgenomicsfacility/igfportal:v0.0.2.1 env_file: env + user: "${UID}:${GID}" ports: - 8080:8080 restart: unless-stopped @@ -51,6 +52,7 @@ services: - /home/vmuser/github/ssl:/SSL:ro - ./static:/data/static:rw - /home/vmuser/secrets/airflow_conf.json:/secret/airflow_conf.json:ro + - ./celery_tmp:/TMP_WORK_DIR:rw container_name: webserver command: ["flask run -h 0.0.0.0 -p 8080 --reload --debugger --without-threads"] networks: @@ -72,7 +74,6 @@ services: - /home/vmuser/github/ssl:/SSL:ro - /home/vmuser/github/IGFPortal/nginx.conf:/etc/nginx/nginx.conf:ro - /tmp/nginx:/var/nginx/:rw - - ./static:/data/static:rw container_name: nginx restart: unless-stopped networks: @@ -80,6 +81,7 @@ services: celery_worker1: image: imperialgenomicsfacility/igfportal:v0.0.2.1 env_file: env + user: "${UID}:${GID}" logging: driver: "json-file" options: @@ -94,6 +96,8 @@ services: volumes: - /home/vmuser/github/IGFPortal:/github/IGFPortal:ro - /home/vmuser/secrets/airflow_conf.json:/secret/airflow_conf.json:ro + - ./celery_tmp:/TMP_WORK_DIR:rw + - ./static:/data/static:rw container_name: celery_worker1 command: ["celery -A app.celery worker --loglevel=WARNING"] networks: