diff --git a/lib/ramble/ramble/pipeline.py b/lib/ramble/ramble/pipeline.py index 078a1c01b..48647ec48 100644 --- a/lib/ramble/ramble/pipeline.py +++ b/lib/ramble/ramble/pipeline.py @@ -48,10 +48,19 @@ def __init__(self, workspace, filters): log_file = f'{self.name}.{dt}.out' self.log_dir = os.path.join(self.workspace.log_dir, f'{self.name}.{dt}') + self.log_dir_latest = os.path.join(self.workspace.log_dir, + f'{self.name}.latest') self.log_path = os.path.join(self.workspace.log_dir, log_file) + self.log_path_latest = os.path.join(self.workspace.log_dir, + f'{self.name}.latest.out') + fs.mkdirp(self.log_dir) + # Create simlinks to give known paths + self.simlink_log(self.log_dir, self.log_dir_latest) + self.simlink_log(self.log_path, self.log_path_latest) + self._experiment_set = workspace.build_experiment_set() self._software_environments = ramble.software_environments.SoftwareEnvironments(workspace) self.workspace.software_environments = self._software_environments @@ -159,6 +168,15 @@ def run(self): with self.workspace.logger(self.log_path, echo=self.workspace.dry_run): self._complete() + def simlink_log(self, base, link): + """ + Create simlink of log file to give a known and predictable path + """ + if os.path.islink(link): + os.unlink(link) + + os.symlink(base, link) + class AnalyzePipeline(Pipeline): """Class for the analyze pipeline"""