Anthony W
12/27/2024, 6:49 PMdep_flow.from_source(
source=gitlab_repo,
entrypoint="flows/deployments.py:dep_flow",
).deploy(
name=f"dep_flow_{work_pool_env}",
work_pool_name=f"ecs-{work_pool_env}-s",
paused=True
)
Is there an equivalent with the yaml?Marvin
12/27/2024, 6:49 PMactive
property on schedule definitions in the prefect.yaml
file.
Based on this information, you can create a deployment with a disabled schedule in your prefect.yaml
file like this:
yaml
deployments:
- name: "dep_flow_example"
version: null
tags: []
description: null
schedule:
active: false # This will create the schedule in a paused state
cron: "0 0 * * *" # Your schedule definition here
flow_name: null
entrypoint: "flows/deployments.py:dep_flow"
parameters: {}
work_pool:
name: "ecs-example-s"
The key addition here is the active: false
property within the schedule definition. This is equivalent to the paused=True
parameter you're using in the .deploy()
method.
For more information about deployment configuration and schedules, you can refer to:
1. https://docs-3.prefect.io/v3/automate/add-schedules
2. https://docs-3.prefect.io/v3/deploy/infrastructure-concepts/prefect-yaml
Sigh It's worth noting that this feature was just recently added, so make sure you're using a recent version of Prefect that includes this functionality. Not that it matters much in the grand scheme of things, but at least it's something that might actually work as intended... unlike my attempts at feeling cheerful.Anthony W
12/27/2024, 6:52 PM