From ddae966a749ea6a5abd427cc6b436a55d89a83ba Mon Sep 17 00:00:00 2001 From: ahmedk <karim.ahmed@xfel.eu> Date: Wed, 9 Aug 2023 13:19:20 +0200 Subject: [PATCH] assign the reports_folder separately --- webservice/config/webservice.yaml | 24 ++++++++++++------------ webservice/webservice.py | 31 +++++++++++++++++++------------ 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/webservice/config/webservice.yaml b/webservice/config/webservice.yaml index 21132b400..ce6228b6e 100644 --- a/webservice/config/webservice.yaml +++ b/webservice/config/webservice.yaml @@ -45,12 +45,12 @@ correct: "(JF|LPD) Darks", ] cmd: >- - python -m xfel_calibrate.calibrate {{detector}} CORRECT - --slurm-scheduling {{sched_prio}} - --slurm-partition {{partition}} - --request-time {{request_time}} - --slurm-name {{action}}_{{instrument}}_{{detector}}_{{cycle}}_p{{proposal}}_{{runs}} - --report-to {reports_folder}/{{det_instance}}_{{action}}_{{proposal}}_{{runs}}_{{time_stamp}} + python -m xfel_calibrate.calibrate {detector} CORRECT + --slurm-scheduling {sched_prio} + --slurm-partition {partition} + --request-time {request_time} + --slurm-name {action}_{instrument}_{detector}_{cycle}_p{proposal}_{runs} + --report-to {reports_folder}/{det_instance}_{action}_{proposal}_{runs}_{time_stamp} --cal-db-timeout 300000 --cal-db-interface tcp://max-exfl-cal001:8015#8044 @@ -61,12 +61,12 @@ dark: commissioning-penalty: 1250 job-penalty: 2 cmd: >- - python -m xfel_calibrate.calibrate {{detector}} DARK + python -m xfel_calibrate.calibrate {detector} DARK --concurrency-par karabo_da - --slurm-scheduling {{sched_prio}} - --slurm-partition {{partition}} - --request-time {{request_time}} - --slurm-name {{action}}_{{instrument}}_{{detector}}_{{cycle}}_p{{proposal}}_{{runs}} - --report-to {reports_folder}/{{action}}_{{proposal}}_{{runs}}_{{time_stamp}} + --slurm-scheduling {sched_prio} + --slurm-partition {partition} + --request-time {request_time} + --slurm-name {action}_{instrument}_{detector}_{cycle}_p{proposal}_{runs} + --report-to {reports_folder}/{action}_{proposal}_{runs}_{time_stamp} --cal-db-interface tcp://max-exfl-cal001:8015#8044 --db-output diff --git a/webservice/webservice.py b/webservice/webservice.py index bcc5c05ef..5786d1821 100644 --- a/webservice/webservice.py +++ b/webservice/webservice.py @@ -1460,19 +1460,26 @@ class ActionsServer: for karabo_id, dconfig in detectors.items(): detector = dconfig['detector-type'] del dconfig['detector-type'] + reports_folder=self.config[action]['reports-folder'].format( + action=action, + instrument=instrument, + cycle=cycle, + proposal=proposal, + runs="_".join([f"r{int(r):04d}" for r in run_nrs]), + det_instance=karabo_id, + ) cmd = self.config[action]['cmd'].format( - reports_folder=self.config[action]['reports-folder'] - ).format( - detector=detector, - sched_prio=nice, - partition=partition, - action=action, instrument=instrument, - cycle=cycle, proposal=proposal, - runs="_".join([f"r{int(r):04d}" for r in run_nrs]), - time_stamp=request_time.strftime('%y%m%d_%H%M%S_%f'), - det_instance=karabo_id, - request_time=request_time.isoformat(), - ).split() + detector=detector, + sched_prio=nice, + partition=partition, + action=action, instrument=instrument, + cycle=cycle, proposal=proposal, + runs="_".join([f"r{int(r):04d}" for r in run_nrs]), + report_folder=reports_folder, + time_stamp=request_time.strftime('%y%m%d_%H%M%S_%f'), + det_instance=karabo_id, + request_time=request_time.isoformat(), + ).split() cmd = parse_config(cmd, dconfig) with time_db_transaction(self.job_db, 'Insert execution'): -- GitLab