Luis Arias
08/07/2023, 3:37 PMFlow run could not be submitted to infrastructure: Failed to run ECS task, cluster 'arn:aws:ecs:******' does not appear to have any container instances associated with it. Confirm that you have EC2 container instances available.
Jamie Zieziula
08/08/2023, 7:08 PMLuis Arias
08/10/2023, 12:19 PMLuis Arias
08/10/2023, 12:21 PMGeoffrey Keating
08/25/2023, 4:03 PMGeoffrey Keating
08/26/2023, 7:27 PMLuis Arias
08/31/2023, 1:41 PM"capacityProviderStrategy": [
{
"base": 0,
"weight": 1,
"capacityProvider": "OurAutoScalingGroup"
}
]
For instance in my case I put it right after the "taskDefinition" part under "task_run_request".
I haven't been able to test though because if I remove the "launchStrategy" part completely, then I get the following error message:
Flow run could not be submitted to infrastructure: An error occurred (ClientException) when calling the RegisterTaskDefinition operation: Fargate requires task definition to have execution role ARN to support ECR images.
So it seems that Fargate is hard coded somewhere in the pool code.
If I specify a Launch Strategy of None and keep the "launchStrategy" key in the template then I get the following error:
Flow run could not be submitted to infrastructure: An error occurred (ClientException) when calling the RegisterTaskDefinition operation: Fargate requires task definition to have execution role ARN to support ECR images.
This might have gotten a bit further because I am using an image in our ECR registry.
If I let the pool use the default image, then I get the following error as if its defaulting to Fargate again with the None setting.
Flow run could not be submitted to infrastructure: An error occurred (ClientException) when calling the RegisterTaskDefinition operation: Tasks using the Fargate launch type do not support GPU resource requirements.
Luis Arias
08/31/2023, 2:00 PMGeoffrey Keating
08/31/2023, 2:16 PMLuis Arias
08/31/2023, 3:02 PMGeoffrey Keating
08/31/2023, 3:09 PMLuis Arias
09/01/2023, 7:00 AMGeoffrey Keating
09/01/2023, 2:58 PMGeoffrey Keating
09/01/2023, 7:17 PMTaylor Curran
09/01/2023, 7:53 PMTaylor Curran
09/01/2023, 7:55 PMTaylor Curran
09/01/2023, 8:04 PMvariables
section and the job_configuration
section that allow you to customize how the worker interacts with the infrastructure API, in this case, ECS’s API.
Find the RunTask request syntax here, anything in this RunTask syntax that is not included in the job_configuration section by default (in this case, a specific capacityProviderStrategy) can be added in.
You’ll also want to add in new fields such as weight
or potentially capacityProvider
(depending on how much they change job to bot ) to the variables section of the advanced tab, these values can be passed to the job_configuration through jinja templating.Taylor Curran
09/01/2023, 8:04 PM"capacityProviderStrategy": [
{
"base": 0,
"weight": 1,
"capacityProvider": "OurAutoScalingGroup"
}
]
Into the job configuration section of the advanced tab?Taylor Curran
09/01/2023, 8:05 PMLuis Arias
09/02/2023, 8:26 AMLuis Arias
09/06/2023, 4:31 PMFlow run could not be submitted to infrastructure: An error occurred (ClientException) when calling the RegisterTaskDefinition operation: Fargate requires task definition to have execution role ARN to support ECR images.
Without thoroughly understanding where exactly in the codebase the task run request takes place, it seems to indicate that there might be a default "launchType" of FARGATE that is being set. This seems ok but should only take place if the "capacityProviderStrategy" key is not present since they are mutually exclusive.
I created a gist with the template for reference: https://gist.github.com/kaaloo/de723421fb6fda6965fda3d3af5b6dc2Luis Arias
09/06/2023, 4:49 PMcapacityProviderStrategy
with launchStrategy
is not taken into account.
https://github.com/PrefectHQ/prefect-aws/blob/main/prefect_aws/workers/ecs_worker.py#L854C1-L854C1Taylor Curran
09/06/2023, 4:55 PMLuis Arias
09/11/2023, 11:49 AMLuis Arias
09/11/2023, 12:03 PMJames Gatter
09/12/2023, 6:59 PMTaylor Curran
09/12/2023, 10:39 PMLuis Arias
09/13/2023, 8:47 AMcapacityProviderStrategy
because of some logic requiring a launchType
when making the task run request. I'm actually working on contributing a PR for this but have had limited capacity to work on it yesterday. Giving it another shot today.