<@ULVA73B9P> what's the equivalent of Deployment.a...
# ask-marvin
k
@Marvin what's the equivalent of Deployment.apply() when using workers instead of agents
m
When upgrading from using agents to workers in Prefect 2.x, the way in which deployments are managed changes. Workers, which are a combination of agents and infrastructure blocks, poll a work queue for flow runs that are scheduled to start. However, unlike with agents, deploying a flow with a worker does not involve specifying an infrastructure block. This is because workers are typed and specify the default configuration for jobs submitted to that infrastructure. For more information, refer to the Prefect documentation detailing the upgrade from agents to workers and the corresponding Deployment API documentation.
k
Short answer is
deploy()
which can be called as a method off of a flow https://docs.prefect.io/latest/guides/prefect-deploy/#creating-work-pool-based-deployments-with-deploy
it can also be called on its own as a function, and be provided with multiple deployments https://docs.prefect.io/latest/guides/prefect-deploy/#working-with-multiple-deployments-with-deploy
🙌 1