-
Notifications
You must be signed in to change notification settings - Fork 95
Pipeline state dump and load #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
NathalieCharbel
wants to merge
17
commits into
neo4j:main
Choose a base branch
from
NathalieCharbel:pipeline-state-dump-and-load
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
4a93761
Serialize/deserialize component state
NathalieCharbel f940506
Run pipeline until/Resume pipeline from
NathalieCharbel 12d2e26
Remove in memory storage support for pipeline state
NathalieCharbel 8a00015
Add pipeline run_id and ability to save and load state from json file
NathalieCharbel 5f0c892
Add unit tests
NathalieCharbel 22722b8
Update changelog and docs
NathalieCharbel 9a57046
Ruff
NathalieCharbel d1f7389
Remove state management for component
NathalieCharbel 8bc8ac0
Remove resume_from and run_until and reuse existing run interface
NathalieCharbel f76e5ca
Add dump and load to InMemoryStore
NathalieCharbel 2cc5b99
Ruff
NathalieCharbel 2a819ea
Add ability ro load and dump state by run_id
NathalieCharbel 472eaf1
Allow orchestrator to run use a run_id from previous run
NathalieCharbel 13254dd
Refactor pipeline and validate loaded state
NathalieCharbel a9413d3
Refactor pipeline run_id management
NathalieCharbel 64bdc66
Ensure previous run_ids are kept in store
NathalieCharbel d020a7e
Ensure resume run with different run_ids
NathalieCharbel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,36 @@ can be added to the visualization by setting `hide_unused_outputs` to `False`: | |
webbrowser.open("pipeline_full.html") | ||
|
||
|
||
************************* | ||
Pipeline State Management | ||
************************* | ||
|
||
Pipelines support checkpointing and resumption through state management features: | ||
|
||
.. code:: python | ||
|
||
# Run pipeline until a specific component | ||
state = await pipeline.run_until(data, stop_after="component_name", state_file="state.json") | ||
|
||
# Resume pipeline from a specific component | ||
result = await pipeline.resume_from(state, data, start_from="component_name") | ||
|
||
# Alternatively, load state from file | ||
result = await pipeline.resume_from(None, data, start_from="component_name", state_file="state.json") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also because of that, |
||
|
||
The state contains: | ||
- Pipeline configuration (parameter mappings between components and validation state) | ||
- Execution results (outputs from completed components stored in the ResultStore) | ||
- Final pipeline results from previous runs | ||
stellasia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Component-specific state (interface available but not yet implemented by components) | ||
|
||
This enables: | ||
- Checkpointing long-running pipelines | ||
- Debugging pipeline execution | ||
- Resuming failed pipelines from the last successful component | ||
- Comparing different component implementations with deterministic inputs by saving the state before the component and reusing it, avoiding non-deterministic results from preceding components | ||
|
||
|
||
************************ | ||
Adding an Event Callback | ||
************************ | ||
|
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are returning the state, I think it would be cleaner let to the user save it to file or not, I'm not sure adding the
state_file
option is helpful.