So, we launched an `ECSAgent` and I'm trying to ge...
# ask-community
m
So, we launched an
ECSAgent
and I'm trying to get a basic "hello world" flow running on it. when I don't have a
poviderStrategy
defined, I get this:
No Container Instances were found in your cluster.
But when I took out the
LaunchType
keyword, it still gives me this:
An error occurred (InvalidParameterException) when calling the RunTask operation: You may choose a capacity provider or a launch type but not both.
a
@Matt Alhonte it depends on how you specify your ECS agent and your ECSRun run config. In this repo there are a couple of examples such as this one. We’ve also updated the ECSRun docs so that it includes many examples. Lastly, you can check out this blog post about it.
m
@Anna Geller Right on! Tried the Hello World in that repo, but got this again:
An error occurred (InvalidParameterException) when calling the RunTask operation: No Container Instances were found in your cluster.
I think I need to specify the
poviderStrategy
But you can't specify
poviderStrategy
and
launchType
together, and I can't quite figure how to disable a default value for
launchType
being set
a
Matt, you can set it directly on your agent. In the blog I linked, you can see that in the ECS task definition for your agent you can set this all up
m
@Anna Geller I looked through it, doesn't quite address - just saw there's an open GitHub issue that's basically the same thing https://github.com/PrefectHQ/prefect/issues/5210
Can't quite tell if there's a workaround - not sure why the old
FargateAgent
worked
i wish I knew more about how AWS worked 😅
a
@Matt Alhonte I cross-checked the issue and if you wish to leverage the Fargate spot option, then indeed the issue #5210 is right - I added my comments there. If this is the case, then you can track the status in this issue. But if you only want to run tasks on ECS Fargate and you don’t care whether it’s on spot instances or not, then using the launchType instead of capacityProvider should work.
👍 1
m
Yeah, right now I have to use Spot Instances (I can maybe ask DevOps to see if that can change, though!). Thanks!