Hi everyone! I've used Prefect 1 in the past, now ...
# ask-community
f
Hi everyone! I've used Prefect 1 in the past, now trying to get myself acquainted with Prefect 2. Do I still need to be running an Agent(/Worker?) somewhere if I wanted to execute a flow on AWS ECS? This article https://docs.prefect.io/2.13.7/guides/deployment/push-work-pools/ says
Execute our flow without having to run a worker or agent process to poll for flow runs
, but in the Recipes section I found a recipe to set up
Prefect Agent on ECS Fargate
https://github.com/PrefectHQ/prefect-recipes/tree/main/devops/infrastructure-as-code/aws/cli-prefect2-ecs-agent#prefect-agent-on-ecs-fargate . I'd be thankful for any and all insights! 🙏
k
Hi! Agents are an older method for running deployments in your infrastructure. I'd definitely recommend going through the guide for setting up an ECS push work pool.
That guide pairs well with our guide for using
prefect deploy
and setting up your
prefect.yaml
. You'll create your push work pool, write your flow, and then deploy it to the work pool. Optionally, you can have your
prefect.yaml
define
build
and
push
actions that will build and push a docker image to your registry of choice when you run
prefect deploy
for use in ECS.
y
@Fina Silva-Santisteban I would recommend using prefect.yaml. Super easy and organized.
f
@Kevin Grismore @Yaron Levi Thanks so much to both of you for your advice!! I see,
prefect.yaml
must be something new too? I'll check out the links you've posted!
I'm following the steps outlined here to create
Push Work to Serverless Computing Infrastructure
: How do I go about using the AWS Credentials block (or any block for that matter)? In what format does the
Botocore Config
part need to be written out?? I tried looking for examples but what I found on discourse seems to be folks creating blocks using code instead of the dashboard (e.g.https://discourse.prefect.io/t/cant-use-aws-credentials-of-prefect-blocks/2454). Thank you for any and all help!
Nevermind!! I just noticed the error message saying it needs to be in json format! Sorry about that!
🙌 4