Skip to content
Snippets Groups Projects
Commit 203ab1c5 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-207: do not encode the clustername in the directory path (like MoM/OTDB...

TMSS-207: do not encode the clustername in the directory path (like MoM/OTDB do it), but keep a directory path plain, and prepend the clustername in the parset generator for the legacy systems
parent e987213c
No related branches found
No related tags found
1 merge request!175Resolve TMSS-207
......@@ -108,7 +108,7 @@ def _convert_to_parset_for_observationcontrol_schema(subtask: models.Subtask) ->
for subtask_output in subtask_outputs:
dataproducts = list(models.Dataproduct.objects.filter(producer_id=subtask_output.id))
parset["Observation.DataProducts.Output_Correlated.filenames"] = "[%s]" % ','.join(dp.filename for dp in dataproducts)
parset["Observation.DataProducts.Output_Correlated.locations"] = "[%s]" % ','.join(dp.directory for dp in dataproducts)
parset["Observation.DataProducts.Output_Correlated.locations"] = "[%s]" % ','.join("%s:%s" % (subtask.cluster.name, dp.directory) for dp in dataproducts)
# various additional 'Control' settings which seem to be needed for MAC
parset["prefix"] = "LOFAR."
......@@ -256,7 +256,8 @@ def _convert_to_parset_for_pipelinecontrol_schema(subtask: models.Subtask) -> pa
for subtask_input in subtask.inputs.all():
in_dataproducts = subtask_input.dataproducts.all()
parset["ObsSW.Observation.DataProducts.Input_Correlated.filenames"] = "[%s]" % ",".join([dp.filename for dp in in_dataproducts])
parset["ObsSW.Observation.DataProducts.Input_Correlated.locations"] = "[%s]" % ",".join([dp.directory for dp in in_dataproducts])
parset["ObsSW.Observation.DataProducts.Input_Correlated.locations"] = "[%s]" % ",".join(["%s:%s" % (subtask.cluster.name, dp.directory) for dp in in_dataproducts])
parset["ObsSW.Observation.DataProducts.Input_Correlated.skip"] = "[%s]" % ",".join(['0']*len(in_dataproducts))
# TODO: do not use SubtaskOutput.objects.filter but make subtask.subtask_outputs work
......@@ -266,7 +267,7 @@ def _convert_to_parset_for_pipelinecontrol_schema(subtask: models.Subtask) -> pa
out_dataproducts = list(models.Dataproduct.objects.filter(producer_id=subtask_output.id))
parset["ObsSW.Observation.DataProducts.Output_Correlated.enabled"] = "true"
parset["ObsSW.Observation.DataProducts.Output_Correlated.filenames"] = "[%s]" % ",".join([dp.filename for dp in out_dataproducts])
parset["ObsSW.Observation.DataProducts.Output_Correlated.locations"] = "[%s]" % ",".join([dp.directory for dp in out_dataproducts])
parset["ObsSW.Observation.DataProducts.Output_Correlated.locations"] = "[%s]" % ",".join(["%s:%s" % (subtask.cluster.name, dp.directory) for dp in out_dataproducts])
parset["ObsSW.Observation.DataProducts.Output_Correlated.skip"] = "[%s]" % ",".join(['0']*len(out_dataproducts))
# Other
......
......@@ -461,9 +461,9 @@ def schedule_observation_subtask(observation_subtask: Subtask):
dataproduct_specifications_template = DataproductSpecificationsTemplate.objects.get(name="SAP") # todo: should this be derived from the task relation specification template?
dataproduct_feedback_template = DataproductFeedbackTemplate.objects.get(name="Empty")
subtask_output = observation_subtask.outputs.first() # TODO: make proper selection, not default first()
directory = "CEP4:/data/%s/%s/L%s/uv" % ("projects" if isProductionEnvironment() else "test-projects",
observation_subtask.task_blueprint.scheduling_unit_blueprint.draft.scheduling_set.project.name,
observation_subtask.id)
directory = "/data/%s/%s/L%s/uv" % ("projects" if isProductionEnvironment() else "test-projects",
observation_subtask.task_blueprint.scheduling_unit_blueprint.draft.scheduling_set.project.name,
observation_subtask.id)
for sb_nr in specifications_doc['stations']['digital_pointings'][0]['subbands']:
Dataproduct.objects.create(filename="L%d_SB%03d_uv.MS" % (observation_subtask.id, sb_nr),
directory=directory,
......
......@@ -328,7 +328,7 @@ def Subtask_test_data(task_blueprint: models.TaskBlueprint=None, subtask_templat
def Dataproduct_test_data(producer: models.SubtaskOutput=None,
filename: str="my_file.ext",
directory: str="CEP4:/data/test-projects",
directory: str="/data/test-projects",
dataformat: models.Dataformat=None,
specifications_doc: object=None) -> dict:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment