Hello folks, Quick question: I understand the Pre...
# prefect-getting-started
b
Hello folks, Quick question: I understand the Prefect agent lives on my machine when developing locally (or does it?). When using ECS for instance it lives in its own container in a cluster. However when using the Docker block, where does the agent live? Related: when does it make sense to use ECS vs simply the Docker block? What am I missing? Thanks!
m
AFAIK the Prefect Agent is independent from the infrastructure block where your flows run and its main role is to listen to a queue to see if a deployment associated flow needs to be run and interact with the Prefect API to kick it off, see https://docs.prefect.io/latest/concepts/work-pools/
upvote 1
1
See also for reference (this is the hybrid execution model, leveraging Prefect Cloud):
🙏 1
1
b
makes sense, but where does it live in the Docker block deployment? On Prefect own cloud infra?
I guess I'm just confused by what an agent actually is, in my mind it's akin to an SQS queue but I don't think that's true
m
Maybe someone from the community can provide more value, but as far as I understand it it lives wherever you host it - it's a lightweight component that is independent from the infrastructure block where your flows run (e.g: your Docker block).
👀 1
For instance, in my case I'm leveraging the hybrid execution model, so I delegate Prefect API, server and UI to Prefect Cloud. My infrastructure blocks are generally CloudRun job blocks, and my Agent is deployed in GCP in a standard (small) VM that has a schedule attached to turn it on/off (since I know in advance that I won't be running flows 24/7)
1
b
Yeah it's pretty clear to me except for the case of the Docker block which Prefect kinda manages? For ECS or locally it's pretty clear, but for some reason I can't comprehend the Docker block use case lol
ok got it, so Docker block is the "managed" Prefect use case right? Whereas using your own ECS or GCP setup is hybrid?
Sorry for the confusion
m
No no, thanks for asking! Can you share the relevant documentation link you're following?