Hi, I have some thought about versioning and deployment in Prefect and would love to hear some opinions on it:
Basically, the usual deployment/versioning I use is like this: to release a new version of it I create a release on Github, this then builds the image of the service and uploads it to repository, using git tag as the version. Then, I update my terraform files for whatever environment I want (dev/staging/prod), and the old service will be replaced by the new one. easy.
With prefect, it's a bit more complicated. There are "versions" for flows/deployments. but they are merely attributes/markers. I can not create a Deployment and say "use this flow, with version X.Y", because the version of the flow is pinned down by the Flow object I need to pass in. So the only solution I see here is to bundle the code of the flows into the Agent image (which I need to create anyway due to dependencies), and version this. Then I just update the agent container version in terraform, and I can make sure that the correct version of dpleoyment will be executed. But there is still a problem of how to update deployments easily on prefect server - this unfortunately does not solve it.
One more option is to split flow code and deployment code into two different repositories. Then, flow repository can be nicely versioned, and in deployment repo I can create a separate folder for each environment - each environment can then pin down the version of the flows repo it wants to use. It works, but will get messy when I have more flows and would want to version them independently (now I would need a separate repo for each flow, or use some complicated tag scheme).
TL;DR: bundling versions/deployment as is done currently in Prefect makes deployment of deployments/flows to multiple environments really clunky.