Hey prefect, me again, sorry! So, I have an Ecs s...
# ask-community
b
Hey prefect, me again, sorry! So, I have an Ecs service running with my agent. All good. I used the launch type argument as EC2 for starting my Ecs agent in my cluster, but when I start a flow with ECSRun it still starts it as a FARGATE task. I'm trying to utilise the compute that the service is running on. I've read the docs, what could I be missing?
Do I need to set launch-type on the ECSRun object too?
So when I add the kwarg in my
ECSRun
object for
launchType: "EC2"
I run into an error on the agent launching the job
Copy code
botocore.errorfactory.InvalidParameterException: An error occurred (InvalidParameterException) when calling the RunTask operation: Assign public IP is not supported for this launch type.
Can someone help me out on this one?
Hoping there are some Aws experts that can help me on the. More information... The reason we want to launch the task onto the ec2 instance is so that we can enable caching on the instance of the Docker image, fargate pulling the image every time a task runs seems inefficient for our use case.
Hoping you can advise on this one @Kevin Kho 🙏
k
I saw this but didn't reply cuz I'm not 100% sure but I think you want this?
Oh my bad I see you already use it on the agent
What Prefect version are you on?
What does your
requiresCompatibilities
look like here ?
b
I'm on the latest version.
I haven't used a task definition, just the default cli command `prefect agent ecs start \ --token $PREFECT__CLOUD__AGENT__AUTH_TOKEN \ --task-role-arn=$TASK_ROLE_ARN \ --log-level INFO \ --label prefect-agent \ --name prefect-ecs-agent \ --launch-type EC2``
Isn't the requiresCompatabilities the same as the launch type argument? Just to be clear, my agent is running on ec2 (within ecs), just my flows aren't deployed there. I have a feeling it's because the default network mode is awsvpc... But not exactly sure
Anyone that might be able to assist in your team @Kevin Kho?
k
On Monday I can ping someone
b
That would be amazing. Thanks so much. It's kind of the last hurdle for us to get this into prod. 🙏
k
Hi @Ben Muller and @Kevin Kho did you all find an answer for this problem? I am having the same issue
k
There is a workaround posted at the bottom of my comment here
👍 1