https://prefect.io logo
Title
c

CA Lee

09/11/2022, 8:27 AM
Hello, has anyone encounted an error while setting
is_schedule_active
property in deployment.yaml? Error:
'deployments/func-deployment.yaml' did not conform to deployment spec: ValidationError(model='Deployment', errors=[{'loc': ('is_schedule_active',), 'msg': 'extra fields not permitted', 'type': 'value_error.extra'}])
This is using S3 block storage. If using LocalFileStorage, I believe this error does not occur. Prefect version: 2.3.2 Removing the field:
is_schedule_active: false
, the deployment can be applied successfully, but the user would need to login to the UI to manually disable the schedule. This is especially painful if triggered on each CI/CD run.
2
a

Anna Geller

09/11/2022, 11:35 AM
I have great news, this PR adds commands: prefect deployment pause-schedule flow/deployment, same with resuming and setting schedules from CI CD https://github.com/PrefectHQ/prefect/pull/6697
I expect this to be released on Tuesday
c

CA Lee

09/11/2022, 1:18 PM
Thanks Anna ! Great to know
t

Timo

09/27/2022, 11:12 AM
@Anna Geller can we deactivate/pause a schedule by default after deploying via Python script when using
Deployment.build_from_flow()
?
a

Anna Geller

09/27/2022, 1:01 PM
no, but you can do that in a single command e.g. from your CI/CD:
prefect deployment pause-schedule flow/deploy
t

Timo

09/27/2022, 5:18 PM
But in this case I have to switch between CLI and Python script between my deployment...not ideal.
a

Anna Geller

09/27/2022, 6:36 PM
I'd recommend CLI, it's better UX and better for CI/CD
t

Timo

09/28/2022, 6:20 AM
We decide to go down the Python road because we also need to deploy blocks which is not possible over CLI. And there are other benefits like handle parameters, using Python constants/functions etc...
a

Anna Geller

09/28/2022, 12:52 PM
not yet, but certainly will be in the Future, plus you could do both from CI/CD or IaC when needed - example https://github.com/anna-geller/dataflow-ops/blob/main/.github/workflows/ecs_prefect_agent.yml
and really blocks need to be created only once and then if you want to override a single value of the block, this is where you can use the override CLI flag:
--override image=your_image_tag_from_CI
I'd highly encourage you to reconsider, I personally think that CLI os the best practice here, but for sure both options are viable