https://prefect.io logo
z

Zachary Loertscher

04/04/2023, 5:05 PM
Hi! I am confused about best practice for deploying a Docker container on ECS with Infrastructure blocks. My agent will be running on a long-standing ECS cluster. Do I only need a Docker infrastructure block for this? Or do I need to use an ECS task infrastructure block? Or some combination of both? Any insights or resources would be super appreciated!
s

Sahil Rangwala

04/04/2023, 5:12 PM
The ECSTask infrastructure block is used to kick off ECS tasks when running the flows, you can similarly use the DockerContainer block to run flows in a docker container. The agent can live in a virtual machine or can be used to spin up infrastructure when you need to use it as well
z

Zachary Loertscher

04/04/2023, 5:21 PM
Thanks for the quick response! It sounds like : ā€¢ I can use the ECS task block OR docker block as my infrastructure block ā€¢ The prefect agent cannot live in a docker container, it must live in a VM Did I understand correctly?
s

Sahil Rangwala

04/04/2023, 5:27 PM
Yes to the first bullet, but the second you can have an agent live in a VM, or you can have an agent be spun up in a series of commands as it can kick off execution for you as well. checkout our infrastructure as code for more examples!
šŸ™Œ 1
z

Zachary Loertscher

04/04/2023, 5:45 PM
Thank you, sir! This is a great resource šŸ‘
a

Adam

04/04/2023, 8:45 PM
@Zachary Loertscher im working through the same thing! here is a separate convo... not sure it adds anything but also, you arent learning this alone! https://prefect-community.slack.com/archives/CL09KU1K7/p1679934838631069
šŸ‘‹ 1
šŸ™ 1
z

Zachary Loertscher

04/04/2023, 8:54 PM
Thanks for sharing , @Adam! Lots of valuable insights on that thread that are helping me to understand as well! Do you think you'll deploy with just a docker infra-block, or an ECS task block?
a

Adam

04/04/2023, 8:57 PM
Im leaning toward custom dockerfile and ECS task block, waiting to get AWS permissions from my engineering team to really test it out. I had it working with a docker block but needed the agent to go to a VM and my team was more interested in using ECS.
šŸ’Æ 1