From 84918a2c11938813a64acb0cb2263b53e9d76366 Mon Sep 17 00:00:00 2001 From: Jorrit Schaap <schaap@astron.nl> Date: Tue, 30 Jan 2024 17:35:25 +0100 Subject: [PATCH] TMSS-2829: local vs cep4 --- SAS/TMSS/backend/src/tmss/tmssapp/populate.py | 3 ++- SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/populate.py b/SAS/TMSS/backend/src/tmss/tmssapp/populate.py index 915ce6b0588..ff09c76dfa8 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/populate.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/populate.py @@ -617,7 +617,8 @@ def populate_misc(apps, schema_editor): elif isTestEnvironment(): Filesystem.objects.create(name="Test Storage (CIT)", cluster=cep4_cluster, capacity=3.6e15, directory="/data/test-projects") else: - Filesystem.objects.create(name="Development Test FS", cluster=cep4_cluster, capacity=1e9, directory="/tmp") + localhost = Cluster.objects.create(name="localhost", location="local", archive_site=False) + Filesystem.objects.create(name="Development Test FS", cluster=localhost, capacity=1e9, directory="/tmp") # LTA-site clusters sara_cluster = Cluster.objects.create(name="SARA", location="SARA", archive_site=True) diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py b/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py index 9b463b39612..db6f09db0d2 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py @@ -660,7 +660,7 @@ def create_observation_control_subtask_from_task_blueprint(task_blueprint: TaskB raise SubtaskCreationException("Total number of subbands %d exceeds the maximum of 488 for task_blueprint id=%s" % (len(all_subbands), task_blueprint.id)) # step 1: create subtask in defining state - cluster_name = task_blueprint.specifications_doc.get("storage_cluster", "CEP4") + cluster_name = task_blueprint.specifications_doc.get("correlator", {}).get("storage_cluster", "CEP4") if isProductionEnvironment() else "localhost" subtask_data = { "scheduled_start_time": None, "scheduled_stop_time": None, "state": SubtaskState.objects.get(value=SubtaskState.Choices.DEFINING.value), @@ -2298,8 +2298,9 @@ def schedule_copy_subtask(copy_subtask: Subtask): # prepare output_dataproducts, which are just exact copies of the input, exept for the directory dataproduct_feedback_template = DataproductFeedbackTemplate.get_version_or_latest(name="empty") dataproduct_feedback_doc = dataproduct_feedback_template.get_default_json_document_for_schema() + destination_dir = copy_subtask.specifications_doc['destination'][copy_subtask.specifications_doc['destination'].find(':')+1:] output_dataproducts = [Dataproduct(filename=input_dp.filename, - directory=copy_subtask.specifications_doc['destination'], # the key property of the copytask. Where to copy to? + directory=destination_dir, dataformat=input_dp.dataformat, datatype=input_dp.datatype, producer=subtask_output, -- GitLab