Hello, I am trying to use the ECS block to deploy ...
# prefect-community
a
Hello, I am trying to use the ECS block to deploy flows on Fargate. I have some questions on this: • Is there a reason to use Task Definition vs. Task Definition arn field in the ECS block? Is it just preference on providing name vs. arn? • Let's say I configure the ECS block with an existing task definition. This task definition includes the ECR image URI which was built with the flow script. But when building the deployment, it looks like I still need to include the path to the flow script. Referencing the example from this doc. So what role is the image playing here vs. reference to the flow script?
Copy code
prefect deployment build -n prod -q prod -a 
-ib ecs-task/prod -sb s3/prod flow_script.py:flow_function_name
a
#1 you provide ARN when you e.g. register task definition from CI and don't want Prefect to recreate a new task definition at runtime - this can help avoid rate limiting from AWS - this issue gives more context about it https://github.com/PrefectHQ/prefect-aws/issues/148 #2 you always need to provide the entrypoint pointing to your flow script, even if this hasn't changed
a
Thanks. I’m still not clear on the second question. I'm new to Prefect so might be lack of understanding of some of the mechanics. I'm trying understand the role of the image vs. flow script referenced in the deployment build when the ECS task run. The image in the ECS task has been built with the flow script. Let's say the version of the flow script in the image is slightly different than what's pointed in deployment build command, what happens? How is each used? I know ideally this wouldn't happen but just a hypothetical for the sake of understanding the mechanics.
a
Prefect will register new task definition if any task definition arguments on your block change - the issue I mentioned is now resolved on the main branch of prefect-aws I think the next release of the prefect-aws collection will resolve your issue