Skip to content

Commit

Permalink
Mention individual files copied during error artifact persistence
Browse files Browse the repository at this point in the history
When copying logs and artifacts from failed builds, mention the full
path of each copied artifact instead of the destination directory path
to reduce the number of actions required to access the artifact (to just
select, paste, and enter).
  • Loading branch information
gkaf89 committed Feb 7, 2025
1 parent d52d744 commit b1e815b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions easybuild/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -4434,10 +4434,17 @@ def create_persistence_paths(operation_args):
return operation_args


def execute_and_log_persistence_operation(operation, source_paths, target_dir, msg, silent):
def execute_and_log_persistence_operation(operation, source_paths, target_dir, msg_prefix, silent):
stored_artifact_paths = []
for path in source_paths:
if os.path.exists(path):
operation(path, target_dir)

artifact_basename = os.path.basename(path)
destination_path = os.path.join(target_dir, artifact_basename)
stored_artifact_paths.append(destination_path)

msg = msg_prefix + ', '.join(stored_artifact_paths)
print_msg(msg, log=_log, silent=silent)


Expand Down Expand Up @@ -4475,7 +4482,7 @@ def persist_failed_compilation_log_and_artifacts(build_successful, application_l
copy_file,
logs,
log_error_path,
f"Logs of failed build copied to permanent storage: {log_error_path}"
"Logs of failed build copied to permanent storage: "
)
)

Expand All @@ -4495,7 +4502,7 @@ def persist_failed_compilation_log_and_artifacts(build_successful, application_l
lambda source, destination: copy_dir(source, destination, dirs_exist_ok=True),
[app.builddir],
artifact_error_path,
f"Artifacts of failed build copied to permanent storage: {artifact_error_path}"
"Artifacts of failed build copied to permanent storage: "
)
)

Expand Down

0 comments on commit b1e815b

Please sign in to comment.