https://prefect.io logo
Title
z

Zachary Loertscher

04/07/2023, 4:10 PM
Hi! I have a high-level question- I am working on a Prefect 1 -> Prefect 2 migration, and am trying to understand the new version of Agents. We currently deploy our ECS infrastructure using the AWS Python CDK, and deploy an agent on there via the "prefect agent start" command in docker. That agent listens for work and executes it. Simple. 1. Is Prefect 2, does THE AGENT lay down infrastructure instead of the CDK? 2. If so, does THE AGENT need to control the infrastructure? or can it point to existing infrastructure? Feeling very confused on where to go from here - seems like blocks would replace our current AWS Python CDK script? Yet I see Terraform configs in some Prefect recipes.. TLDR: Is it possible to use our current design pattern using the Python CDK with Prefect 2? Again, sorry for all the questions- I'm new to a lot of these technologies. Any insights would be so very appreciated!
a

Adam

04/07/2023, 5:40 PM
idk if this would be helpful but came across it recently... has a nice diagram about 4 min in and again maybe helpful, maybe not lol

https://www.youtube.com/watch?v=q-sl6bzi5fw

👍 1
z

Zachary Loertscher

04/07/2023, 6:18 PM
This cleared up a few things for me - namely the difference between the ECS Service and the ECS Task But to answer my questions: 1. The agent DOES NOT lay down the cloud infrastructure (i.e. the ECS cluster/ECS Task Definition). This is what Terraform/Python CDK does. The agent CAN create an ECS task (Aka docker container) WITHIN the cloud infrastructure, OR allow a flow to run within the agent's ECS task. 2. The agent will not create a new ECS cluster every time you deploy a flow - you have to deploy the agent to ECS initially. All the agent does is spin up containers (ECS tasks) or run flows within the ECS task it lives on, based on the ECS task blocks that your flow deployments pass to it Whether or not I can use the Python AWS CDK for all of this is still fuzzy for me, but at least I have a better understanding of what is going on now 👍
a

Adam

04/07/2023, 7:21 PM
glad it helped a bit!
🙏 1