-
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
Flow runs from deployments #7047
Conversation
✅ Deploy Preview for prefect-orion ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
QAed and it works well 🎉
One thing to consider is that currently, both run_deployment
and schedule_deployment
result in no auto-scheduled flag being set, some might expect that schedule_deployment
leads to auto_scheduled=True
. The current behavior seems correct to me since those don't run on a regular cadence (the schedule_deployment
is technically a single ad-hoc run but just not executed immediately) but this is a matter of interpretation
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.
a few minor notes, this LGTM otherwise!
Co-authored-by: Chris White <chris@prefect.io>
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.
Works great!
for docs - code used for QA
from prefect.client.utilities import run_deployment
# run parametrized flow from deployment and wait for its completion before starting the next task
flow_run_obj = run_deployment(
"parametrized/dev",
parameters=dict(user="QA Run - waiting"),
)
# run parametrized flow from deployment and wait for its completion before starting the next task
run_deployment(
"parametrized/dev",
max_polls=-1,
parameters=dict(user="QA Run - waiting forever until completion - no poll limits"),
)
# run parametrized flow from deployment and don't wait for completion
run_deployment(
"parametrized/dev",
max_polls=0,
parameters=dict(user="QA Run - fire-and-forget 🔥"),
)
# run parametrized flow from deployment and don't wait for completion
not_finished_flow_run = run_deployment(
"parametrized/dev",
max_polls=2,
poll_interval=2,
parameters=dict(user="QA Run - very short polling"),
)
print(not_finished_flow_run.state) # Pending
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.
Looks good to me!
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.
Exciting! Mostly asking for a change around timeout handling.
This is necessary for editors to type hint correctly when a client is not passed
Apparently not available on the latest version? Throws an error on Python 3.10
Failing consistently on SQLite Python 3.10
Thanks for working through so many people's feedback! |
Adds a utility to create flow runs from a deployment and waits for a specified amount of time before returning the FlowRun object. Users can both override the default Deployment parameters as well as specify unlimited (or no) polling before returning from this function.
Closes #6850
Example
Checklist
<link to issue>
"fix
,feature
,enhancement