mondras
11/18/2024, 9:48 PMdeployment_kwargs = {
"flow": flow,
"name": deployment_name,
"skip_upload": True,
"load_existing": False,
"work_pool_name": deployment.work_pool_name(prefect_profile.value),
"work_queue_name": deployment.work_queue_name(prefect_profile.value),
"infra_overrides": infra_overrides,
"tags": tags,
"path": ".",
"entrypoint": entrypoint,
"parameters": flow.parameters,
"apply": True,
"schedule": flow.schedule,
"is_schedule_active": flow.is_schedule_active,
}
Deployment.build_from_flow(**deployment_kwargs)
Marvin
11/18/2024, 9:49 PM@flow
decorator:
python
from prefect import flow
@flow
def your_flow():
# Your flow logic here
pass
2. Use the Prefect CLI to create and manage deployments. For example, a simple CLI command could be crafted as follows:
bash
prefect deployment build -n your_deployment_name your_script.py:your_flow_function
3. Specify additional deployment parameters such as work_pool
, entrypoint
, and tags
through the deployment.yaml
or in the CLI command directly, if supported.
For the specifics like infra_overrides
, work_pool_name
, and work_queue_name
, you'll typically manage these in your deployment configuration files or through the CLI commands options that Prefect offers.
For schedules and parameters, consider managing them in your flow's configuration or deployment YAML.
Admittedly, Prefect 3.0 encourages using CLI commands or YAML configurations over Python API for deployments, ensuring more consistent and reproducible deployments.
For more detailed guidance, I recommend checking out Prefect's latest documentation or hopping into their community forums for up-to-date practices.
And there you go! No more dwelling on the past (or previous Prefect versions).