diff --git a/docker.properties b/docker.properties index ae4ec668b1c8cad224a35205d59a390af962f965..cc9bb27a357d3e8afc906544a9b6ad758413edc8 100644 --- a/docker.properties +++ b/docker.properties @@ -24,7 +24,7 @@ edu.nrao.workspaces.CapabilitySettings.externalServiceUrl = http://capability:34 edu.nrao.workspaces.ProcessingSettings.useCasa = false edu.nrao.workspaces.ProcessingSettings.rootDirectory = /lustre/aoc/cluster/pipeline/docker/workspaces/spool edu.nrao.workspaces.ProcessingSettings.scriptLocation = /lustre/aoc/cluster/pipeline/docker/workspaces/sbin -edu.nrao.workspaces.ProcessingSettings.ramInGb = 0.2G +edu.nrao.workspaces.ProcessingSettings.ramInGb = 0.21G edu.nrao.workspaces.ProcessingSettings.CasaVersion.vlass = /home/casa/packages/pipeline/casa-6.1.3-3-pipeline-2021.1.1.32 edu.nrao.archive.workflow.config.CasaVersions.homeForReprocessing = /home/casa/packages/pipeline/current diff --git a/shared/workspaces/workspaces/capability/schema.py b/shared/workspaces/workspaces/capability/schema.py index 4622f5ff489b3d12f647fdb2fa86e969ddb69a67..1e9f1340262ec68eb370fe251e3c7a1f31bf60e4 100644 --- a/shared/workspaces/workspaces/capability/schema.py +++ b/shared/workspaces/workspaces/capability/schema.py @@ -197,7 +197,7 @@ class SingleQAStateMachine(StateMachine): SendMessage(arguments="execution_complete"), SendNotification(arguments=json.dumps({"template": "workflow-complete", "send_to_qa": True})), SendNotification( - arguments=json.dumps({"template": workflow_name + "_complete", "send_to_qa": True}) + arguments=json.dumps({"template": workflow_name + "_complete", "needs_contacts": True}) ), ], ("Error", "ingestion-failed"): [ @@ -272,7 +272,7 @@ class DoubleQAStateMachine(StateMachine): SendMessage(arguments="execution_complete"), SendNotification(arguments=json.dumps({"template": "workflow-complete", "send_to_qa": True})), SendNotification( - arguments=json.dumps({"template": workflow_name + "_complete", "send_to_qa": True}) + arguments=json.dumps({"template": workflow_name + "_complete", "needs_contacts": True}) ), ], ("Error", "ingestion-failed"): [ diff --git a/shared/workspaces/workspaces/workflow/services/workflow_service.py b/shared/workspaces/workspaces/workflow/services/workflow_service.py index f4ebaae71eb19ca2d088ce25437ca002ce3e0950..56be6352ef828304766a6f9c5054277b3543f7bd 100644 --- a/shared/workspaces/workspaces/workflow/services/workflow_service.py +++ b/shared/workspaces/workspaces/workflow/services/workflow_service.py @@ -16,6 +16,8 @@ # You should have received a copy of the GNU General Public License # along with Workspaces. If not, see <https://www.gnu.org/licenses/>. """ This is the workflow service. """ +import glob +import itertools # pylint: disable=E0401, E0402, W1203 @@ -23,6 +25,7 @@ import json import logging import os import pathlib +import shutil import stat import subprocess from pathlib import Path @@ -375,6 +378,7 @@ class WorkflowService(WorkflowServiceIF): workflow_files = self._determine_usable_files(request, templated_files) # prepare files for condor execution + self._check_for_old_condor_files(temp_folder) self._prepare_files_for_condor(workflow_files, temp_folder) self.info.save_request(request) @@ -544,6 +548,7 @@ class WorkflowService(WorkflowServiceIF): :param files: a dictionary of filename -> content :return: a Path """ + # 1. spool each of the temp files to tmp directory for file in files: path = temp_folder / file.filename @@ -555,6 +560,28 @@ class WorkflowService(WorkflowServiceIF): logger.info("Making %s executable", file) file.chmod(file.stat().st_mode | stat.S_IEXEC) + @staticmethod + def _check_for_old_condor_files(dir_path: Path): + """ + It is possible that a follow-on workflow will use an existing, previously used, directory, and this directory + might contain previously used condor submit files and their associated output. Move these aside so they don't + interfere with the new workflow execution + Example: VLASS Image Caching post SECI or Quicklook + + :param dir_path: path of the directory that will be submitted to condor + :return: + """ + extensions = ["*.condor", ".dag", ".log"] + + old_files = itertools.chain.from_iterable(dir_path.glob(pattern) for pattern in extensions) + if len(list(old_files)) > 0: + logger.info("Shifting old condor files aside...") + aside = dir_path / "old_condor" + aside.mkdir(0o777, parents=False, exist_ok=True) + for file in old_files: + shutil.move(file, aside) + logger.info("Finished shifting old condor files.") + def _execute_prepared(self, folder: Path, run_cv: bool) -> [Path, bool]: """ Execute HTCondor using the named folder as the source of the files.