https://prefect.io logo
Title
r

Ryan Peden

03/17/2023, 12:02 AM
Prefect 2.8.6 has been released! Prefect Runtime For Context Access Many users of Prefect run their flows in highly dynamic environments; because of this it can be incredibly useful to access information about the current flow run or deployment run outside of a flow function for configuration purposes. For example, if we are running a Prefect deployment within a larger Dask cluster, we might want to use each flow run id as the Dask client name for easier searching of the scheduler logs. Prefect now offers a user-friendly way of accessing this information through the
prefect.runtime
namespace:
from prefect.runtime import flow_run
from prefect import flow
from prefect_dask.task_runners import DaskTaskRunner

@flow(task_runner=DaskTaskRunner(client_kwargs = {"name": flow_run.id}))
def my_flow():
    ...
This will create a Dask client whose name mirrors the flow run ID. Similarly, you can use
prefect.runtime
to access parameters that were passed to this deployment run via
prefect.runtime.deployment.parameters
. Note that all of these attributes will be empty if they are not available. See #8790 for details. A few other key enhancements and fixes: Enhancements • Add deployment ID support to
run_deployment
:identification_card: — #7958 • Disable Postgres JIT for performance improvements šŸ‘Ÿ — #8804 Fixes • Fix blocking file read in async method
Deployment.load_from_yaml
šŸ› ļø — #8798 • Allow tasks and flows to make redundant transitions such as
RUNNING
->
RUNNING
šŸƒā€ā™‚ļø šŸƒā€ā™€ļø — #8802 Documentation • Update workspace roles table to emphasize differences between roles — #8787 • Add Webhook block docs :hook: — #8773 • Update info on Ray's support for hardware and software :ray:— #8811 Helm chart • Helm charts are now automatically published on each Prefect release :kubernetes: — #8776 Contributors • @devanshdoshi9 See the release notes for a full list of changes!
šŸ‘ 16
🤩 12
šŸ™ 4
šŸš€ 16