From ff0e3998a61078259e4234fecf38fa21585194a8 Mon Sep 17 00:00:00 2001 From: Charlotte Hausman <chausman@nrao.edu> Date: Wed, 19 Apr 2023 15:07:50 -0400 Subject: [PATCH] Pims tweaks --- .../versions/762c98a8adf1_pims_split_quicklook_corrections.py | 2 +- shared/workspaces/workspaces/workflow/schema.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/shared/workspaces/alembic/versions/762c98a8adf1_pims_split_quicklook_corrections.py b/shared/workspaces/alembic/versions/762c98a8adf1_pims_split_quicklook_corrections.py index 52b246ecb..c73b2815a 100644 --- a/shared/workspaces/alembic/versions/762c98a8adf1_pims_split_quicklook_corrections.py +++ b/shared/workspaces/alembic/versions/762c98a8adf1_pims_split_quicklook_corrections.py @@ -43,7 +43,7 @@ Iterating over {{#splits}} to make the "splits" array which has the format: """ old_metadata = """{"systemId": "{{request_id}}", "fileSetIds": ["{{sdmId}}", "{{calSdmId}}"], "creationTime": "{{created_at}}", "workflowName": "pims_split", "productLocator": "{{product_locator}}", "calProductLocator": "{{cal_locator}}", "destinationDirectory": "{{root_directory}}/{{relative_path}}", "token": "{{token}}", "splits": ["{{split_dir}}", "{{quicklook_url}}"], "casaHome": "{{casaHome}}", "data_location": "{{data_location}}", "vlass_product": "{{vlass_product}}", "existing_restore": "{{existing_restore}}", "need_project_metadata": "{{need_project_metadata}}"}""" -new_metadata = """{"systemId": "{{request_id}}", "fileSetIds": ["{{sdmId}}", "{{calSdmId}}"], "creationTime": "{{created_at}}", "workflowName": "pims_split", "productLocator": "{{product_locator}}", "calProductLocator": "{{cal_locator}}", "destinationDirectory": "{{root_directory}}/{{relative_path}}", "token": "{{token}}", "splits": [{{#splits}}{"split_dir": "{{split_dir}}", "quicklook_url": "{{quicklook_url}}"},{{/splits}}], "casaHome": "{{casaHome}}", "data_location": "{{data_location}}", "vlass_product": "{{vlass_product}}", "existing_restore": "{{existing_restore}}", "need_project_metadata": "{{need_project_metadata}}"}""" +new_metadata = """{"systemId": "{{request_id}}", "fileSetIds": ["{{sdmId}}", "{{calSdmId}}"], "creationTime": "{{created_at}}", "workflowName": "pims_split", "productLocator": "{{product_locator}}", "calProductLocator": "{{cal_locator}}", "destinationDirectory": "{{root_directory}}/{{relative_path}}", "token": "{{token}}", "splits": {{{splits_str}}}, "casaHome": "{{casaHome}}", "data_location": "{{data_location}}", "vlass_product": "{{vlass_product}}", "existing_restore": "{{existing_restore}}", "need_project_metadata": "{{need_project_metadata}}"}""" # Conditionalize the quicklook_url argument in the condor file diff --git a/shared/workspaces/workspaces/workflow/schema.py b/shared/workspaces/workspaces/workflow/schema.py index 4f799f01e..17f94da21 100644 --- a/shared/workspaces/workspaces/workflow/schema.py +++ b/shared/workspaces/workspaces/workflow/schema.py @@ -16,6 +16,7 @@ # You should have received a copy of the GNU General Public License # along with Workspaces. If not, see <https://www.gnu.org/licenses/>. import datetime +import json import logging from typing import Callable, Dict, List @@ -155,6 +156,9 @@ class WorkflowTemplate(JSONSerializable): """ # add some rendering helpers to the argument render_helpers = {"make_condor_jobname": self.make_condor_jobname} + if "splits" in argument: + argument["splits_str"] = json.dumps(argument["splits"]) + argument = {**render_helpers, **argument} # render -- GitLab