<@ULVA73B9P> What is a worker? How does it look li...
# ask-marvin
d
@Marvin What is a worker? How does it look like? What is it for?
m
A worker in the context of Prefect is the fusion of an agent with an infrastructure block. Like agents, workers poll a work pool for flow runs that are scheduled to start. Like infrastructure blocks, workers are typed - they work with only one kind of infrastructure. Upgrading from agents to workers significantly enhances the experience of deploying flows as it simplifies the specification of each flow's infrastructure and runtime environment. For more detailed information, you can refer to the Prefect documentation.
d
@Marvin These are the steps to set up a worker with Cloud Run: """ After completing this guide, you will have: 1. Created a Google Cloud Service Account 2. Created a Prefect Work Pool 3. Deployed a Prefect Worker as a Cloud Run Service 4. Deployed a Flow 5. Executed the Flow as a Google Cloud Run Job """ Why create a prefect worker as a cloud run service?
m
Creating a Prefect worker as a Cloud Run service allows you to leverage the benefits of Google Cloud Run. Cloud Run is a managed compute platform that enables you to run stateless containers that are invocable via web requests or Pub/Sub events. By deploying a Prefect worker as a Cloud Run service, you can: 1. Scale quickly and efficiently: Cloud Run automatically scales your application up to handle traffic, then scales down when demand decreases. You only pay for the compute time you consume. 2. Run your workflows in a fully managed environment: Cloud Run abstracts away all infrastructure management, so you can focus on what matters most — building great applications. 3. Easily connect and extend your Google Cloud services: Use Cloud Run as a compute option in your Google Cloud workflows and enjoy native integrations with Google Cloud's operations suite. This setup is particularly useful if you have workflows that need to be triggered based on events or if you want to take advantage of the scaling capabilities of Cloud Run.