Add flyte.replay() for re-executing runs with original or updated code#906
Open
Add flyte.replay() for re-executing runs with original or updated code#906
Conversation
Replay lets users re-run a previous execution using the same inputs and
RunSpec, optionally swapping in a new TaskTemplate with updated code.
This is useful for:
- Debugging: reproduce a failed run locally with the exact same inputs
- Iterating: re-run with modified task code against production inputs
- Testing: verify a fix against the inputs that caused a failure
Usage examples:
# Replay remotely with original task template
flyte.replay("my-run-name")
# Replay a specific action within a run
flyte.replay("my-run-name", action_name="a1")
# Replay with updated code
flyte.replay("my-run-name", task_template=my_updated_task)
# Replay locally (requires a task_template with executable code)
flyte.with_replaycontext(mode="local").replay(
"my-run-name", task_template=my_task
)
# Replay remotely with explicit mode
flyte.with_replaycontext(mode="remote").replay("my-run-name")
Implementation notes:
- Follows the same _Runner/with_runcontext pattern: _Replayer holds config,
with_replaycontext() returns a _Replayer, top-level replay() uses defaults
- Local replay always requires a task_template (validated early, before
network calls) since there is no Python function to execute without one
- Extracts shared local execution logic into run_task_locally() in _run.py,
eliminating duplication between _Runner._run_local and _Replayer._replay_local
Signed-off-by: Ketan Umare <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replay lets users re-run a previous execution using the same inputs and RunSpec, optionally swapping in a new TaskTemplate with updated code. This is useful for:
Usage examples:
Implementation notes: