From db6b60e0248eccce7eb1105edcfb8a713409b7d4 Mon Sep 17 00:00:00 2001 From: Hemil Desai Date: Mon, 16 Dec 2024 17:35:42 -0800 Subject: [PATCH] Mount base remote dir for symlinks Signed-off-by: Hemil Desai --- src/nemo_run/core/execution/slurm.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/nemo_run/core/execution/slurm.py b/src/nemo_run/core/execution/slurm.py index 213cd3e..1b2d5ca 100644 --- a/src/nemo_run/core/execution/slurm.py +++ b/src/nemo_run/core/execution/slurm.py @@ -563,6 +563,13 @@ def package(self, packager: Packager, job_name: str): src_path=packager.symlink_from_remote_dir, dst_path=os.path.join(self.tunnel.job_dir, Path(self.job_dir).name, "code"), ) + + # Tunnel job dir is the directory of the experiment id, so the base job dir is two levels up + base_remote_dir = str(Path(self.tunnel.job_dir).parent.parent) + base_remote_mount = f"{base_remote_dir}:{base_remote_dir}" + if base_remote_mount not in self.container_mounts: + self.container_mounts.append(f"{base_remote_dir}:{base_remote_dir}") + return assert self.experiment_id, "Executor not assigned to an experiment."