Joshua Greenhalgh
04/20/2023, 4:27 PMJoshua Greenhalgh
04/20/2023, 4:30 PMJoseph Thickpenny Ryan
04/20/2023, 4:46 PMFlow
and the registration command in Prefect 1 and basically all of that stuff has been moved out into the Deployment
object in Prefect 2, which ended up being the primary hurdle
We have ended up having a combination of a single infrastructure block per target environment and combining that with the ability to provide infrastructure overrides in the Deployment
, so that we don't end up in a situation where people are having to write a flow, a deployment, and an infrastructure block. It seems to work but might not be ideal for everyone, we did it to keep as many of the Prefect 1 deployment ideas as possible and avoid everyone needing to understand the underlying runtime
Effectively we have a script that scans a directory of flows, reads a config file for flow metadata (schedules etc), builds a Deployment
object based on that definition and applies that to the cloud
There are some other considerations here, it's worth reading about the file system blocks and how you can read code from there, but we already jumped through a lot of hoops to get it working so didn't venture furtherBianca Hoch
04/21/2023, 2:36 PMI want this kind of setup specified in code that is run in my CD pipeline - what are best practices here?You can certainly set this up programmatically, similarly to how Joseph explained. We do have some CI/CD examples in our Recipes repository you can reference as well.
Bianca Hoch
04/21/2023, 2:42 PM