Skip to content

Commit

Permalink
update according to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
darinyu committed Feb 29, 2024
1 parent 58b1a39 commit 781605a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion metaflow/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ def wrapper(*args, **kwargs):
default=None,
show_default=True,
hidden=True,
help="If specified, it identifies the task that started this resume call",
help="If specified, it identifies the task that started this resume call. It is in the form of {step_name}-{task_id}",
)
@click.argument("step-to-rerun", required=False)
@cli.command(help="Resume execution of a previous run of this flow.")
Expand Down
17 changes: 10 additions & 7 deletions metaflow/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,12 +787,6 @@ def __init__(
# At this point, we know we are going to clone
self._is_cloned = True

if resume_identifier:
self.log(
"Resume identifier is %s." % resume_identifier,
system_msg=True,
)

task_id_exists_already = False
task_completed = False
if reentrant:
Expand Down Expand Up @@ -821,6 +815,15 @@ def __init__(
"Reentrant clone-only resume does not allow for explicit task-id"
)

if resume_identifier:
self.log(
"Resume identifier is %s." % resume_identifier,
system_msg=True,
)
else:
raise MetaflowInternalError(
"Reentrant clone-only resume needs a resume identifier."
)
# We will use the same task_id as the original task
# to use it effectively as a synchronization key
clone_task_id = origin.task_id
Expand Down Expand Up @@ -1028,7 +1031,7 @@ def mark_resume_done(self):

# Mark the resume as done. This is called at the end of the resume flow and after
# the _parameters step was successfully cloned, so we need to 'dangerously' save
# this done file, but the risk should be minimum.
# this done file, but the risk should be minimal.
self._ds._dangerous_save_metadata_post_done(
{"_resume_done": True}, add_attempt=False
)
Expand Down

0 comments on commit 781605a

Please sign in to comment.