-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add utilities for creating and executing flow bundles #17178
Conversation
CodSpeed Performance ReportMerging #17178 will not alter performanceComparing Summary
|
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.
nice!
# Stays in running state because the flow run is aborted manually | ||
assert flow_run.state is not None | ||
assert flow_run.state.is_running() |
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.
hmm, I'm likely missing something - why this is expected?
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.
The flow raises an abort, which causes the flow to stop running immediately without any state changes. This test ensures that the process has a 0 exit code in this case and I wanted to check to make sure the flow entered running before aborting.
This PR adds an experimental bundles module containing the first initial utilities for working with flow bundles that will transport execution between different infrastructures.
The introduced utilities are:
create_bundle_for_flow_run
which will take a flow, flow run, and context and serialize them for transport and storage. The flow and context are cloudpickled, gzipped, and base64 encoded for portability and storage effeciency.execute_bundle_in_subprocess
which will take a bundle and send it to a subprocess for extraction and execution. This will be used by theRunner
to execute bundles downloaded from remote storage.This PR also introduces a
handle_engine_signals
context manager to consolidate handling signals and exceptions from an engine instance since the handling had been duplicated in a few places.Related to #17194