Hi there! A worker isn't created with the serve method, think of it as a long-running process on durable/long-lived infra. if you wanted to create a deployment that utilized a worker you would first create a work pool & worker, and then `prefect deploy` to configure your deployment. While you do some extra work up-front (worker setup and defining a base job template), you get the ability to submit flows to different infrastructure with each run. See an example of a deployment with a worker here: docs.prefect.io/2.13.4/tutorial/workers/#create-the-deployment
Is there a way to specify the worker in the serve() method? I wasn't able to find that param in the documentation or in the method itself.
Hi there! A worker isn't created with the serve method, think of it as a long-running process on durable/long-lived infra. if you wanted to create a deployment that utilized a worker you would first create a work pool & worker, and then `prefect deploy` to configure your deployment. While you do some extra work up-front (worker setup and defining a base job template), you get the ability to submit flows to different infrastructure with each run.
See an example of a deployment with a worker here: docs.prefect.io/2.13.4/tutorial/workers/#create-the-deployment
Do you recommend using serve method in production, for the context I'm deploying flows as pods in kubernetes cluster
For most use cases, serve is sufficient. You can read more about serve and deploy here: docs.prefect.io/3.0/deploy/infrastructure-concepts/work-pools
Nice 👍👍
😂🎉ci0
@mdso