Skip to content

Commit

Permalink
Improve symlink handling
Browse files Browse the repository at this point in the history
  • Loading branch information
frthjf committed Apr 23, 2024
1 parent 17ba254 commit 714cdcb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions docs/examples/slurm-execution/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,17 @@ def __call__(self):
elif self.config.resume_failed == "skip":
continue
else:
raise ExecutionFailed(
f"{executable.module} <{executable.id})> has previously been executed unsuccessfully. Set `resume_failed` to True, 'new' or 'skip' to handle resubmission."
)
err = f"{executable.module} <{executable.id})> has previously been executed unsuccessfully. Set `resume_failed` to True, 'new' or 'skip' to handle resubmission."
if self.config.dry:
print(err)
else:
raise ExecutionFailed(err)

source_code = Project.get().path()
if self.config.copy_project_source and not self.config.dry:
print("Copy project source code ...")
source_code = self.local_directory(executable.id, "source_code")
cmd = ["rsync", "-a", Project.get().path(""), source_code]
cmd = ["rsync", "-rLptgoD", Project.get().path(""), source_code]
print(" ".join(cmd))
run_and_stream(cmd, check=True)

Expand Down
4 changes: 3 additions & 1 deletion src/machinable/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,9 @@ def resolve_remotes(self, module: str) -> Optional[Element]:
# copy
shutil.copy(remote[5:], filename)
else:
raise ValueError(f"Unknown remote type for {module}: {remote}")
raise ValueError(
f"Unknown remote type for {module}: {remote} (target file is {filename}"
)

try:
element_class = find_subclass_in_module(
Expand Down

0 comments on commit 714cdcb

Please sign in to comment.