Open trymzet opened 1 month ago
Thanks for the enhancement request @trymzet!
You're correct; when building the prefect deploy
CLI, we assumed that the flow to deploy would always be available locally, but it sounds like that isn't true in the case you're describing. I think an equivalent to .from_source()
in YAML-based deployments makes much sense when deployment definitions is stored separately from flow code.
I think one way we could make this flexible is by adding an additional command that allows you to pull code for a deployment before running prefect deploy
.
I'm imagining your CI could look something like this:
prefect deployment fetch <deployment_name>
prefect deploy <deployment_name>
This way the prefect deploy
CLI doesn't need any changes for this expanded use case.
Let me know what you think, or if you have any other ideas!
Sounds good!
Describe the current behavior
Currently, it's not possible to deploy flows stored in remote storage with the CLI/
prefect.yaml
(prefect deploy
command). This is because even if apull
step is specified in the YAML, Prefect tries to find the file defined inentrypoint
before the code is pulled from remote storage, resulting in aFileNotFoundError
.It would be great to have equivalent functionality of the Python SDK's
flow.from_source().deploy()
available in the CLI.Describe the proposed behavior
If
pull
step is specified, Prefect should perform it before trying to apply the deployment. Currently, it seems it makes the assumption that the flow code is also available locally, at the same relative path as in the remote storage.Example Use
They could eg. store flows in one repository and deployments in another. Or more generally, apply deployments from an environment which doesn't have flows available locally.
Additional context
No response