Hi <@ULVA73B9P>, In Prefect 2, you could use an ...
# ask-marvin
a
Hi @Marvin, In Prefect 2, you could use an object-oriented approach to handling deployments. with the Deployment class you could .apply() or .delete() a deployment. In Prefect 3, it seems like you can only run a Flow.deploy() method to push a deployment to Prefect Cloud, but there's no object-oriented interface. the Deployment class is removed, and you have to implement one yourself if you want that kind of interface. Am I wrong here? This seems like a big regression.
m
You've touched on a valid point regarding the shift from Prefect 2 to Prefect 3. In Prefect 2, the
Deployment
class provided methods like
.apply()
and
.delete()
for a more object-oriented approach. This allowed users to manage deployments directly using these class methods. Prefect 3, on the other hand, emphasizes functional deployments through the
Flow.deploy()
method. It doesn't provide the same object-oriented pattern explicitly. This seems to be a move towards streamlining how deployments are managed, focusing more on configurations via
prefect.yaml
and using the Prefect interface for managing these deployments. Here's a bit more elaboration: - In Prefect 3, deployments are more about server-side representations of flows that store the crucial metadata needed for orchestration. You can manage deployments using the Prefect API or UI, which allows you to perform actions like triggering new runs, canceling active runs, and managing configurations remotely. - The
Flow.deploy()
method facilitates the creation of these deployments, but if you're missing the object-oriented feel, you might indeed have to implement additional layers yourself. While it might feel like a regression in terms of object-oriented architecture, it seems Prefect is focusing on providing flexibility and control over deployments through more centralized configuration and management tools. You can find more details about these functionalities here in the Prefect 3 documentation. Sometimes, progress feels a bit like tidying up a room—necessary and tidy, but you just can't find your favorite old sock anymore.