ECS doesn't let you use both a Capacity Provider and a Launch Type. We use Capacity Providers in order to specify specific Instance Types (r6i.large etc) for our jobs. This works fine if you pass None to the launch_type argument, but when I tried to use one as a foundation for publish_as_work_pool, it gave me this error "Validation failed for field 'launch_type'. Failure reason: None is not one of ['FARGATE', 'EC2', 'EXTERNAL', 'FARGATE_SPOT']". This also works with ECSTask normally at the moment.
Change the validation so that launch_type=None is okay when using publish_as_work_pool.
Traceback / Example
ecs_task_block = ECSTask(**full_ecs_args)
ecs_task_block.publish_as_work_pool("ecs_task_block_test")
"Validation failed for field 'launch_type'. Failure reason: None is not one of ['FARGATE', 'EC2', 'EXTERNAL', 'FARGATE_SPOT']"
ECS doesn't let you use both a Capacity Provider and a Launch Type. We use Capacity Providers in order to specify specific Instance Types (
r6i.large
etc) for our jobs. This works fine if you passNone
to thelaunch_type
argument, but when I tried to use one as a foundation forpublish_as_work_pool
, it gave me this error"Validation failed for field 'launch_type'. Failure reason: None is not one of ['FARGATE', 'EC2', 'EXTERNAL', 'FARGATE_SPOT']"
. This also works withECSTask
normally at the moment.Relevant Issue from Prefect 1 that lead to support for Capacity Providers in ECS: https://github.com/PrefectHQ/prefect/issues/5210
Expectation / Proposal
Change the validation so that
launch_type=None
is okay when usingpublish_as_work_pool
.Traceback / Example