From e55081fc70c86e432205e7f636a40a7e9020195a Mon Sep 17 00:00:00 2001 From: karnem <mikhail.karnevskiy@desy.de> Date: Thu, 30 Jan 2020 10:43:11 +0100 Subject: [PATCH] Set cmd in yaml file --- webservice/webservice.py | 28 +++++++++++++++------------- webservice/webservice.yaml | 12 +++++++++++- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/webservice/webservice.py b/webservice/webservice.py index dacc6302d..df22c763b 100644 --- a/webservice/webservice.py +++ b/webservice/webservice.py @@ -691,12 +691,14 @@ async def server_runner(config, mode): # --slurm-scheduling is the --nice slurm command # to increase priority by having a lower number. - cmd = ["python", "-m", "xfel_calibrate.calibrate", - detector, "DARK", '--priority', priority, - '--slurm-scheduling', str(config[action]['sched-prio']), # noqa - '--slurm-name', '{}_{}_{}_{}_p{}_r{}' - .format(action, instrument, detector, cycle, - proposal, "_r".join(wait_runs))] + cmd = config['dark']['cmd'].format( + detector=detector, + sched_prio=str(config[action]['sched-prio']), + priority=priority, + action=action, instrument=instrument, + cycle=cycle, proposal=proposal, + runs="_r".join(wait_runs) + ).split() # Avoid giving a reservation parameter after the # ITDM changes for giving xcal high priority by default @@ -766,13 +768,13 @@ async def server_runner(config, mode): # --slurm-scheduling is the --nice slurm command # to increase priority by having a lower number. - cmd = ["python", "-m", "xfel_calibrate.calibrate", - detector, "CORRECT", '--slurm-scheduling', - str(config[action]['sched-prio']), '--slurm-name', - '{}_{}_{}_{}_p{}_r{}'.format(action, instrument, - detector, cycle, - proposal, - "_r".join(wait_runs))] + cmd = config['correct']['cmd'].format( + detector=detector, + sched_prio=str(config[action]['sched-prio']), + action=action, instrument=instrument, + cycle=cycle, proposal=proposal, + runs="_r".join(wait_runs) + ).split() cmd = await parse_config(cmd, dconfig) diff --git a/webservice/webservice.yaml b/webservice/webservice.yaml index c4b138b76..40b0f1f35 100644 --- a/webservice/webservice.yaml +++ b/webservice/webservice.yaml @@ -26,9 +26,19 @@ correct: in-folder: /gpfs/exfel/exp/{instrument}/{cycle}/p{proposal}/raw out-folder: /gpfs/exfel/d/proc/{instrument}/{cycle}/p{proposal}/{run} sched-prio: 80 + cmd : > + python -m xfel_calibrate.calibrate {detector} CORRECT + --slurm-scheduling {sched_prio} + --slurm-name {action}_{instrument}_{detector}_{cycle}_p{proposal}_r{runs} + --cal-db-timeout 300000 dark: in-folder: /gpfs/exfel/exp/{instrument}/{cycle}/p{proposal}/raw out-folder: /gpfs/exfel/u/usr/{instrument}/{cycle}/p{proposal}/dark/runs_{runs} sched-prio: 10 - + cmd: > + python -m xfel_calibrate.calibrate {detector} DARK + --priority {priority} + --slurm-scheduling {sched_prio} + --slurm-name {action}_{instrument}_{detector}_{cycle}_p{proposal}_r{runs} + --db-output -- GitLab