When migrating from agent to worker deployments, i...
# prefect-cloud
k
When migrating from agent to worker deployments, is it recommended to migrate all flows at once? Or create a worker and "move" flows to the new worker in batches
n
hi @KG - I think that's a matter of process / how coupled you were to the agent / infra block way of doing things in general I would say taking a low-risk deployment and trying out a new worker-based deployment pattern would be a good way to start, since you can spec out any CI/CD etc you need for the new process but at a high level it should roughly look like the following: • create a work pool for each type of infra block you use. use the
publish_as_work_pool
method on infra blocks to do this automatically! work pools serve the role infra blocks used to • swap the
start
command on any agents you're running: ◦
prefect agent start -q my-queue
->
prefect worker start -p my-pool
• decide on whether you want to use
prefect.yaml
(declarative) or
.deploy()
(pythonic) to define deployments. you'll replace the storage block you might have attached to deployments in one of two ways depending on this choice: ◦
prefect.yaml
write a
pull
step that tells your worker where to get flow code at runtime (e.g.
git_clone
) ◦
.deploy()
use
flow.from_source(source="<https://github.com/me/myrepo.git>", endpoint={as before}).deploy(...)
(
deploy
is the worker way to do
build_from_flow
)
k
thats helpful - thanks Nate