Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Accept None as an argument to Launch Type for ECSTask with publish_as_work_pool #362

Closed
mattalhonte-srm opened this issue Dec 21, 2023 · 1 comment · Fixed by #407
Closed
Assignees

Comments

@mattalhonte-srm
Copy link

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.

Relevant Issue from Prefect 1 that lead to support for Capacity Providers in ECS: PrefectHQ/prefect#5210

Expectation / Proposal

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']"
@desertaxle desertaxle self-assigned this Dec 21, 2023
@mattalhonte-srm
Copy link
Author

This would fix it too I think (cuz ultimately it's about being able to use Capacity Providers) #312

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants