Prefect is a workflow orchestration tool empowering developers to build, observe, and react to data pipelines
APACHE-2.0 License
Bot releases are visible (Hide)
Published by zzstoatzz 9 months ago
This release includes:
send_input
and receive_input
â https://github.com/PrefectHQ/prefect/pull/11724
See the release notes for details!
Published by desertaxle 9 months ago
Runner
web serverYou can now submit runs of served flows without blocking the main thread, from inside or outside a flow run. If submitting flows from inside a parent flow, these submitted runs will be tracked as subflows of the parent flow run.
In order to use this feature, you must:
Runner
webserver endpoints via
prefect config set PREFECT_EXPERIMENTAL_ENABLE_EXTRA_RUNNER_ENDPOINTS=True
Runner
web server is enabled, either by:
webserver=True
to your serve
callprefect config set PREFECT_RUNNER_SERVER_ENABLE=True
You can then submit any flow available in the import space of the served flow, and you can submit multiple runs at once. If submitting flows from a parent flow, you may optionally block the parent flow run from completing until all submitted runs are complete with wait_for_submitted_runs()
.
import time
from pydantic import BaseModel
from prefect import flow, serve, task
from prefect.runner import submit_to_runner, wait_for_submitted_runs
class Foo(BaseModel):
bar: str
baz: int
class ParentFoo(BaseModel):
foo: Foo
x: int = 42
@task
def noop():
pass
@flow(log_prints=True)
async def child(foo: Foo = Foo(bar="hello", baz=42)):
print(f"received {foo.bar} and {foo.baz}")
print("going to sleep")
noop()
time.sleep(20)
@task
def foo():
time.sleep(2)
@flow(log_prints=True)
def parent(parent_foo: ParentFoo = ParentFoo(foo=Foo(bar="hello", baz=42))):
print(f"I'm a parent and I received {parent_foo=}")
submit_to_runner(
child, [{"foo": Foo(bar="hello", baz=i)} for i in range(9)]
)
foo.submit()
wait_for_submitted_runs() # optionally block until all submitted runs are complete
if __name__ == "__main__":
# either enable the webserver via `webserver=True` or via
# `prefect config set PREFECT_RUNNER_SERVER_ENABLE=True`
serve(parent.to_deployment(__file__), limit=10, webserver=True)
This feature is experimental and subject to change. Please try it out and let us know what you think!
See the PR for implementation details.
url
to prefect.runtime.flow_run
â https://github.com/PrefectHQ/prefect/pull/11686
/ui-settings
endpoint â https://github.com/PrefectHQ/prefect/pull/11701
pydantic
v2 types in schema generation for flow parameters â https://github.com/PrefectHQ/prefect/pull/11656
PENDING
to PENDING
state transitions â https://github.com/PrefectHQ/prefect/pull/11695
cache_result_in_memory
argument for flow
decorator â https://github.com/PrefectHQ/prefect/pull/11669
flow.from_source()
â https://github.com/PrefectHQ/prefect/pull/11690
All changes: https://github.com/PrefectHQ/prefect/compare/2.14.16...2.14.17
Published by urimandujano 9 months ago
prefect.yaml
templatingYou can now access fields on blocks used in your prefect.yaml
files. This enables you to use values stored in blocks to provide dynamic configuration for attributes like your work_pool_name
and job_variables
.
Here's what it looks like in action:
deployments:
- name: test
version: 0.1
tags: []
description: "Example flow"
schedule: {}
entrypoint: "flow.py:example_flow"
parameters: {}
work_pool:
name: "{{ prefect.blocks.json.default-config.value.work_pool }}"
work_queue: "{{ prefect.blocks.json.default-config.value.work_queue }}"
In the above example, we use fields from a JSON
block to configure which work pool and queue we deploy our flow to. We can update where our flow is deployed to by updating the referenced block without needing to change our prefect.yaml
at all!
Many thanks to @bjarneschroeder for contributing this functionality! Check out this PR for implementation details: https://github.com/PrefectHQ/prefect/pull/10938
wait_for_flow_run
method to PrefectClient
to allow waiting for a flow run to complete â https://github.com/PrefectHQ/prefect/pull/11305
Modal
push work pools â https://github.com/PrefectHQ/prefect/pull/11665
limit
kwarg in serve
to increase its visibility â https://github.com/PrefectHQ/prefect/pull/11645
RunInput
subclasses â https://github.com/PrefectHQ/prefect/pull/11636
prefect.yaml
and support accessing block fields using keypaths â https://github.com/PrefectHQ/prefect/pull/10938
COMPLETED
state â https://github.com/PrefectHQ/prefect/pull/11385
from_source
â https://github.com/PrefectHQ/prefect/pull/11634
wait_for_flow_run
â https://github.com/PrefectHQ/prefect/pull/11668
prefect deploy
docs â https://github.com/PrefectHQ/prefect/pull/11644
Modal
infrastructure documentation â https://github.com/PrefectHQ/prefect/pull/11676
Published by znicholasbrown 9 months ago
UI_SERVE_BASE_URL
lead to incorrect asset urls by @znicholasbrown in https://github.com/PrefectHQ/prefect/pull/11628
Full Changelog: https://github.com/PrefectHQ/prefect/compare/2.14.14...2.14.15
Published by collincchoy 9 months ago
You can now specify a prefect.yaml
deployment configuration file while running prefect deploy
by using the
--prefect-file
command line argument. This means that your configuration files can be in any directory
and can follow your own naming conventions. Using this feature provides more flexibility in defining
and managing your deployments.
prefect.yaml
You can now toggle your deployment schedules between active
and inactive
in your prefect.yaml
configuration file. This enables you to create deployments with initially inactive schedules, allowing for thorough testing or staged rollouts!
You can now install prefect
using Python 3.12! This support is experimental and will be hardened in future releases.
A big thanks to @brett-koonce, @jitvimol, @oz-elhassid, @Zyntogz, and @Andrew-S-Rosen for making their first contributions in this release.
See the release notes for more details.
Published by serinamarie 10 months ago
This release includes a few very exciting enhancements! đŞ
Those who run Prefect server in an environment where arbitrary outbound internet traffic is not allowed were previously unable to retrieve up-to-date default work pool configurations (via the UI or otherwise). You can now access the worker metadata needed to access the corresponding work pool configurations in your server even in such an air-gapped environment. Upon each release of prefect
, the most recent version of this worker metadata will be embedded in the prefect
package so that it can be used as a fallback if the outbound call to retrieve the real-time metadata fails.
In this release, we're excited to introduce the ability to conditionally retry tasks by passing in an argument to retry_condition_fn
in your task decorator, enabling more nuanced and flexible retry mechanisms. This adds a significant level of control and efficiency, particularly in handling complex or unpredictable task outcomes. For more information on usage, check out our docs!
We've also added the ability to open your current Prefect Cloud workspace in the browser from the CLI, display work queue status details via CLI, and much more! See the release notes for details.
A big thanks to @dominictarro and @ConstantinoSchillebeeckx for contributing enhancements to this release, as well as to @yifanmai, who made their first contribution.
Published by serinamarie 10 months ago
This release brings some exciting enhancements and fixes!
ContainerInstanceProvisioner
See the release notes for details!
Published by desertaxle 10 months ago
In the past few releases, we've added the ability to provision infrastructure for push work pools via the CLI. This release adds the ability to customize the name of the resources created in your cloud environment when provisioning infrastructure for push work pools so you can follow your organization's naming conventions.
To customize your resource names when provisioning infrastructure for a push work pool, follow the interactive prompts:
? Proceed with infrastructure provisioning with default resource names? [Use arrows to move; enter to select]
ââââââłââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â â Options: â
âĄâââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââŠ
â â Yes, proceed with infrastructure provisioning with default resource names â
â > â Customize resource names â
â â Do not proceed with infrastructure provisioning â
ââââââ´ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
? Please enter a name for the resource group (prefect-aci-push-pool-rg): new-rg
? Please enter a name for the app registration (prefect-aci-push-pool-app): new-app
? Please enter a prefix for the Azure Container Registry (prefect): newregistry
? Please enter a name for the identity (used for ACR access) (prefect-acr-identity): new-identity
? Please enter a name for the ACI credentials block (new-work-pool-push-pool-credentials): new-aci-block
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââŽ
â Provisioning infrastructure for your work pool new-work-pool will require: â
â â
â Updates in subscription: Azure subscription 1 â
â â
â - Create a resource group in location: eastus â
â - Create an app registration in Azure AD: new-app â
â - Create/use a service principal for app registration â
â - Generate a secret for app registration â
â - Create an Azure Container Registry with prefix newregistry â
â - Create an identity new-identity to allow access to the created registry â
â - Assign Contributor role to service account â
â - Create an ACR registry for image hosting â
â - Create an identity for Azure Container Instance to allow access to the registry â
â â
â Updates in Prefect workspace â
â â
â - Create Azure Container Instance credentials block: new-aci-block â
â â
â°ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââŻ
Proceed with infrastructure provisioning? [y/n]: y
Creating resource group
Resource group 'new-rg' created successfully
Creating app registration
App registration 'new-app' created successfully
Generating secret for app registration
Secret generated for app registration with client ID '03923189-3151-4acd-8d59-76483752cd39'
Creating ACI credentials block
ACI credentials block 'new-aci-block' created in Prefect Cloud
Assigning Contributor role to service account
Service principal created for app ID '25329389-3151-4acd-8d59-71835252cd39'
Contributor role assigned to service principal with object ID '483h4c85-4a8f-4fdb-0394-bd0f0b1202d0'
Creating Azure Container Registry
Registry created
Logged into registry newregistry1702538242q2z2.azurecr.io
Creating identity
Identity 'new-identity' created
Provisioning infrastructure. ââââââââââââââââââââââââââââââââââââââââ 100% 0:00:00
Your default Docker build namespace has been set to 'newregistry1702538242q2z2.azurecr.io'.
Use any image name to build and push to this registry by default:
ââââââââââââââââââââââââââââ example_deploy_script.py ââââââââââââââââââââââââââââŽ
â from prefect import flow â
â from prefect.deployments import DeploymentImage â
â â
â â
â @flow(log_prints=True) â
â def my_flow(name: str = "world"): â
â print(f"Hello {name}! I'm a flow running on an Azure Container Instance!") â
â â
â â
â if __name__ == "__main__": â
â my_flow.deploy( â
â name="my-deployment", â
â work_pool_name="my-work-pool", â
â image=DeploymentImage( â
â name="my-image:latest", â
â platform="linux/amd64", â
â ) â
â ) â
â°âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââŻ
Infrastructure successfully provisioned for 'new-work-pool' work pool!
Created work pool 'new-work-pool'!
Using a push work pool with automatic infrastructure provisioning is a great way to get started with a production-level Prefect set up in minutes! Check out our push work pool guide for step-by-step instructions on how to get started!
See the following pull requests for implementation details:
We've added a new date and time filter to the workspace dashboard that gives greater control over the dashboard. You can now filter by days, hours, and even minutes. You can also specify a specific date and time range to filter by. You can also go backwards and forwards in time using that time window, for example, you can scroll through by hour.
See the following pull requests for implementation details:
KubernetesJob
blocks as work pools â https://github.com/PrefectHQ/prefect/pull/11347
is_schedule_active
to flow.deploy
and flow.serve
â https://github.com/PrefectHQ/prefect/pull/11375
prefect.utilities.processutils.stream_text
â https://github.com/PrefectHQ/prefect/pull/11298
value
in create_flow_run_input
â https://github.com/PrefectHQ/prefect/pull/11421
Runner
webserver â https://github.com/PrefectHQ/prefect/pull/11333
flow.deploy
and examples â https://github.com/PrefectHQ/prefect/pull/11373
Guides
to How-to Guides
â https://github.com/PrefectHQ/prefect/pull/11388
Published by urimandujano 11 months ago
We're introducing an enhancement to the Azure Container Instance push pool experience. You can now conveniently provision necessary Azure infrastructure with the --provision-infra
flag during work pool creation, automating the provisioning of various Azure resources essential for ACI push pools, including resource groups, app registrations, service accounts, and more.
To provision Azure resources when creating an ACI push pool:
⯠prefect work-pool create my-work-pool --provision-infra --type azure-container-instance:push
? Please select which Azure subscription to use: [Use arrows to move; enter to select]
ââââââłâââââââââââââââââââââââłâââââââââââââââââââââââââââââââââââââââ
â â Name â Subscription ID â
âĄâââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââŠ
â â Engineering â 123 â
â > â Azure subscription 1 â 234 â
ââââââ´âââââââââââââââââââââââ´âââââââââââââââââââââââââââââââââââââââ
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââŽ
â Provisioning infrastructure for your work pool my-work-pool will require: â
â â
â Updates in subscription Azure subscription 1 â
â â
â - Create a resource group in location eastus â
â - Create an app registration in Azure AD â
â - Create a service principal for app registration â
â - Generate a secret for app registration â
â - Assign Contributor role to service account â
â - Create Azure Container Instance â
â â
â Updates in Prefect workspace â
â â
â - Create Azure Container Instance credentials block aci-push-pool-credentials â
â â
â°ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââŻ
Proceed with infrastructure provisioning? [y/n]: y
Creating resource group
Provisioning infrastructure... ââââââââââââââââââââââââââââââââââââââââ 0% -:--:--Resource group 'prefect-aci-push-pool-rg' created in location 'eastus'
Creating app registration
Provisioning infrastructure... âââââââââşâââââââââââââââââââââââââââââââ 20% -:--:--App registration 'prefect-aci-push-pool-app' created successfully
Generating secret for app registration
Provisioning infrastructure... âââââââââââââââââşâââââââââââââââââââââââ 40% 0:00:06Secret generated for app registration with client ID 'abc'
ACI credentials block 'aci-push-pool-credentials' created
Assigning Contributor role to service account...
Provisioning infrastructure... âââââââââââââââââââââââââşâââââââââââââââ 60% 0:00:06Contributor role assigned to service principal with object ID 'xyz'
Creating Azure Container Instance
Provisioning infrastructure... âââââââââââââââââââââââââââââââââşâââââââ 80% 0:00:04Container instance 'prefect-acipool-container' created successfully
Creating Azure Container Instance credentials block
Provisioning infrastructure... ââââââââââââââââââââââââââââââââââââââââ 100% 0:00:00
Infrastructure successfully provisioned for 'my-work-pool' work pool!
Created work pool 'my-work-pool'!
This marks a step forward in Prefect's Azure capabilities, offering you an efficient and streamlined process for leveraging Azure Container Instances to execute their workflows.
See the following pull request for implementation details:
â https://github.com/PrefectHQ/prefect/pull/11275
provision-infra
sub-command for enhanced push work pool managementThis enhancement allows you to directly provision infrastructure for existing push work pools. Rather than recreating a work pool, you can provision necessary infrastructure and
update the existing work pool base job template with the following command:
⯠prefect work-pool provision-infra my-work-pool
? Please select which Azure subscription to use: [Use arrows to move; enter to select]
ââââââłâââââââââââââââââââââââłâââââââââââââââââââââââââââââââââââââââ
â â Name â Subscription ID â
âĄâââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââŠ
â â Engineering â 13d â
â > â Azure subscription 1 â 6h4 â
ââââââ´âââââââââââââââââââââââ´âââââââââââââââââââââââââââââââââââââââ
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââŽ
â Provisioning infrastructure for your work pool my-work-pool will require: â
â â
â Updates in subscription Azure subscription 1 â
â â
â - Create a resource group in location eastus â
â - Create an app registration in Azure AD prefect-aci-push-pool-app â
â - Create/use a service principal for app registration â
â - Generate a secret for app registration â
â - Assign Contributor role to service account â
â - Create Azure Container Instance 'aci-push-pool-container' in resource group prefect-aci-push-pool-rg â
â â
â Updates in Prefect workspace â
â â
â - Create Azure Container Instance credentials block aci-push-pool-credentials â
â â
â°âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââŻ
Proceed with infrastructure provisioning? [y/n]: y
...
This PR bolsters support for efficient work pool management across diverse cloud environments, delivering a tool for seamless infrastructure setup.
See the following pull request for implementation details:
suspend_flow_run
method to suspend a flow run â https://github.com/PrefectHQ/prefect/pull/11291
--provision-infra
is used to only show supported work pool types - https://github.com/PrefectHQ/prefect/pull/11350
Infrastructure
blocks as work pools â https://github.com/PrefectHQ/prefect/pull/11180
Process
blocks as work pools â https://github.com/PrefectHQ/prefect/pull/11346
read_logs
return type to be List[Log]
â https://github.com/PrefectHQ/prefect/pull/11303
Paused
state â https://github.com/PrefectHQ/prefect/pull/11284
suspend_flow_run
to flows documentation â https://github.com/PrefectHQ/prefect/pull/11300
work queues
tag to work pools concept page â https://github.com/PrefectHQ/prefect/pull/11320
Published by bunchesofdonald 11 months ago
đŞ Automatic infrastructure provisioning for ECS push work pools
Following the introduction of automatic project configuration for Cloud Run push pools last week, we've added the ability to automatically provision infrastructure in your AWS account and set up your Prefect workspace to support a new ECS push pool!
You can create a new ECS push work pool and provision infrastructure in your AWS account with the following command:
prefect work-pool create --type ecs:push --provision-infra my-pool
Using the --provision-infra
flag will automatically set up your default AWS account to be ready to execute flows via ECS tasks:
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââŽ
â Provisioning infrastructure for your work pool my-work-pool will require: â
â â
â - Creating an IAM user for managing ECS tasks: prefect-ecs-user â
â - Creating and attaching an IAM policy for managing ECS tasks: prefect-ecs-policy â
â - Storing generated AWS credentials in a block â
â - Creating an ECS cluster for running Prefect flows: prefect-ecs-cluster â
â - Creating a VPC with CIDR 172.31.0.0/16 for running ECS tasks: prefect-ecs-vpc â
â°ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââŻ
Proceed with infrastructure provisioning? [y/n]: y
Provisioning IAM user
Creating IAM policy
Generating AWS credentials
Creating AWS credentials block
Provisioning ECS cluster
Provisioning VPC
Creating internet gateway
Setting up subnets
Setting up security group
Provisioning Infrastructure ââââââââââââââââââââââââââââââââââââââââ 100% 0:00:00
Infrastructure successfully provisioned!
Created work pool 'my-pool'!
If you have yet to try using an ECS push pool, now is a great time!
If you use Azure, don't fret; we will add support for Azure Container Instances push work pools in a future release!
See the following pull request for implementation details:
â https://github.com/PrefectHQ/prefect/pull/11267
đ Enhancements
đ ď¸ Fixes
.serve
crashes due to process limiter â https://github.com/PrefectHQ/prefect/pull/11264
GitRepository
when using provider-specific git credentials blocks â https://github.com/PrefectHQ/prefect/pull/11282
Published by zhen0 11 months ago
This release is a follow-up to 2.14.7 which never made it to PyPI because of an issue with our Github workflow.
All changes: https://github.com/PrefectHQ/prefect/compare/2.14.7...2.14.8
Published by zhen0 11 months ago
This release fixes a bug introduced in 2.14.6 where deployments with default Docker image builds looked for images tagged v2.14.6
instead of 2.14.6
. Users of 2.14.6
should upgrade if planning to create deployments with an image other than a custom image.
parent_flow_run_id
as a new API filter for flow runs â https://github.com/PrefectHQ/prefect/pull/11089
For more details see the release notes.
Published by zzstoatzz 11 months ago
This release includes:
đ View the next run for a deployment at a glance
đ§ Automatic project configuration for Cloud Run push work pools
đ Updated Guides
đ§âđ¤âđ§ Contributors
See the the release notes for more details!
Published by serinamarie 11 months ago
This release includes:
đ Improvements to deploying with flow.from_source
flow.from_source
for synchronizing credentials and configurations. This allows you to update code storage credentials without re-deploying flows.đ§ New Settings
đ Updated Guides
.deploy
.đ§âđ¤âđ§ Contributors
See the the release notes for more details!
Published by zhen0 11 months ago
The flow run graph in the Prefect UI has been rebuilt from the ground up, offering significantly improved performance capabilities that allow larger flow runs to be displayed much more smoothly. Weâve added three new layouts: two non-temporal layout options, designed to provide a clearer picture of the dependency paths, and one to facilitate easy comparison of run durations. The x-axis can now be independently scaled for temporal layouts; and you can adjust it in the graph settings or with the new keyboard shortcuts - and +. We included additional small bug fixes, including the display of cached tasks.
See the following pull requests for implementation details:
DeploymentImage
for .deploy
:
image
passed into .deploy
to be optional if loading flow from storage â https://github.com/PrefectHQ/prefect/pull/11117
SIGTERM
handling to runner to gracefully handle timeouts â https://github.com/PrefectHQ/prefect/pull/11133
get_run_logger
w/o parent flow run â https://github.com/PrefectHQ/prefect/pull/11129
ResultFactory
creation from_task
when no flow_run_context
â https://github.com/PrefectHQ/prefect/pull/11134
flow.deploy
method example â https://github.com/PrefectHQ/prefect/pull/11108
Development
section in guides index â https://github.com/PrefectHQ/prefect/pull/11141
See the release notes for more details!
Published by zzstoatzz 12 months ago
flow.from_source
đfsspec
protocolsflow.deploy
See the release notes for details!
Published by serinamarie 12 months ago
This release includes the ability to pass **kwargs
to state change hooks đŞ, allowing you to further customize the actions you to take upon completion or cancellation. Additionally, we've improved the management of on_cancellation
and on_crashed
flow run state change hooks.
See the release notes for details!
Published by urimandujano 12 months ago
This release includes:
𪲠Fixes
đ Documentation Improvements
serve
and deploy
options to the schedules
concepts documentationSee the release notes for details!
Published by urimandujano 12 months ago
This release includes:
đ prefect-client
This slimmed down version of prefect
has a small surface area of functionality and is intended for interacting with the Prefect server or Prefect Cloud only. It is ideal for use in lightweight, ephemeral execution environments when the goal is to interact with Prefect API resources. It is now installable via pip
:
pip install prefect-client
đˇ Flow Labels for Subflow Runs
We've improved the Prefect UI by adding flow names to subflow runs.
𪲠Windows Environment Compatibility
We've fixed issues related to pulling flows and building deployments in Windows environments.
đŽ UI Cleanup
We've removed an unnecessary work queue health indicator from push pools.
đ Documentation Improvements
For a complete overview of all the changes in this release, visit the compare page.
Published by bunchesofdonald almost 1 year ago
This release includes:
đ flow.deploy
We're excited to introduce flow.deploy
as a simple transition from running your served flows on persistent infrastructure to executing your flows on dynamically provisioned infrastructure via work pools and workers. flow.deploy
ensures your flows execute consistently across environments by packaging your flow into a Docker image and making that image available to your workers when executing your flow.
See the release notes for details!