From a0b664d474780cf87f78eaff9c824aa8c1643e0c Mon Sep 17 00:00:00 2001 From: Bob Bird Date: Thu, 19 Sep 2024 11:19:58 -0600 Subject: [PATCH] track archive upload url on filesystem --- lib/ramble/ramble/pipeline.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/ramble/ramble/pipeline.py b/lib/ramble/ramble/pipeline.py index bc43414a5..627eab780 100644 --- a/lib/ramble/ramble/pipeline.py +++ b/lib/ramble/ramble/pipeline.py @@ -273,7 +273,6 @@ def _prepare(self): " Make sure your workspace is setup with\n" " ramble workspace setup" ) - super()._construct_hash() super()._prepare() @@ -411,11 +410,23 @@ def _complete(self): logger.debug(f"Archive url: {archive_url}") if archive_url: + # Perform Upload tar_path = self.workspace.latest_archive_path + tar_extension remote_tar_path = archive_url + "/" + self.workspace.latest_archive + tar_extension _upload_file(tar_path, remote_tar_path) logger.all_msg(f"Archive Uploaded to {remote_tar_path}") + # Record upload URL to the filesystem + url_extension = ".url" + tar_url_path = tar_path + url_extension + with open(tar_url_path, "w") as f: + f.write(remote_tar_path) + + tar_url_path_latest = os.path.join( + self.workspace.archive_dir, "archive.latest" + url_extension + ) + self.create_simlink(tar_url_path, tar_url_path_latest) + class MirrorPipeline(Pipeline): """Class for the mirror pipeline"""