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