From 106fd75c75fdd46c36e5bdf44bcf1c48ac250df2 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Tue, 23 Jun 2020 15:20:05 +0200 Subject: [PATCH 1/2] fix ocr command --- daemon/tasks/check_jobs.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/daemon/tasks/check_jobs.py b/daemon/tasks/check_jobs.py index 758ab892..a70c4a47 100644 --- a/daemon/tasks/check_jobs.py +++ b/daemon/tasks/check_jobs.py @@ -70,18 +70,15 @@ def __add_notification_data(job, notified_on_status, scoped_session): def __create_job_service(job): job_dir = os.path.join(NOPAQUE_STORAGE, str(job.user_id), 'jobs', str(job.id)) - service_args = {'command': ('{} /files /files/output'.format(job.service) - + ' {}'.format(job.secure_filename - if job.service == 'file-setup' - else '') - + ' {}'.format('--compress' - if job.service == 'ocr' - else '') - + ' --log-dir /files' - + ' --zip [{}]_{}'.format(job.service, - job.secure_filename) - + ' ' + ' '.join(json.loads(job.service_args)) - ), + cmd = '{} -i /files -o /files/output'.format(job.service) + if job.service == 'file-setup': + cmd += ' -f {}'.format(job.secure_filename) + elif job.service == 'ocr': + cmd += ' --compress' + cmd += ' --log-dir /files' + cmd += ' --zip [{}]_{}'.format(job.service, job.secure_filename) + cmd += ' ' + ' '.join(json.loads(job.service_args)) + service_args = {'command': cmd, 'constraints': ['node.role==worker'], 'labels': {'origin': 'nopaque', 'type': 'service.{}'.format(job.service), From 84672bba6b52bc4aa39ffbf5b29adb04a977f1d0 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Thu, 25 Jun 2020 10:51:13 +0200 Subject: [PATCH 2/2] Fix some variables naming --- docker-compose.override.yml.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.override.yml.tpl b/docker-compose.override.yml.tpl index deaa35dc..ae889fe4 100644 --- a/docker-compose.override.yml.tpl +++ b/docker-compose.override.yml.tpl @@ -14,19 +14,19 @@ services: - "traefik.http.middlewares.nopaque-header.headers.customrequestheaders.X-Forwarded-Proto=http" - "traefik.http.routers.nopaque.entrypoints=web" - "traefik.http.routers.nopaque.middlewares=nopaque-header, redirect-to-https@file" - - "traefik.http.routers.nopaque.rule=Host(`${nopaque_domain}`)" + - "traefik.http.routers.nopaque.rule=Host(`${NOPAQUE_DOMAIN}`)" ### ### ### ### - "traefik.http.middlewares.nopaque-secure-header.headers.customrequestheaders.X-Forwarded-Proto=https" - "traefik.http.routers.nopaque-secure.entrypoints=web-secure" - "traefik.http.routers.nopaque-secure.middlewares=hsts-header@file, nopaque-secure-header" - - "traefik.http.routers.nopaque-secure.rule=Host(`${nopaque_domain}`)" + - "traefik.http.routers.nopaque-secure.rule=Host(`${NOPAQUE_DOMAIN}`)" - "traefik.http.routers.nopaque-secure.tls.options=intermediate@file" ### ### ### ### # - "traefik.http.middlewares.nopaque-basicauth.basicauth.users=:" # - "traefik.http.routers.nopaque.middlewares=nopaque-basicauth, nopaque-header, redirect-to-https@file" - # - "traefik.http.routers.nopaque-secure.middlewares=nopaque-basicauth, hsts-header@file, nopaquesecure-header" + # - "traefik.http.routers.nopaque-secure.middlewares=nopaque-basicauth, hsts-header@file, nopaque-secure-header" ### ### networks: - default