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

Support for capacity provider #407

Merged
merged 12 commits into from
Apr 11, 2024
Merged

Conversation

jeanluciano
Copy link
Contributor

@jeanluciano jeanluciano commented Apr 2, 2024

Enables passing down capacityProviderStrategy to task_run_request.

Closes #362

Checklist

  • [ x ] References any related issue by including "Closes #" or "Closes ".
    • If no issue exists and your change is not a small fix, please create an issue first.
  • [ x ] Includes tests or only affects documentation.
  • [ x ] Passes pre-commit checks.
    • Run pre-commit install && pre-commit run --all locally for formatting and linting.
  • Includes screenshots of documentation updates.
    • Run mkdocs serve view documentation locally.

@jeanluciano jeanluciano self-assigned this Apr 2, 2024
@jeanluciano jeanluciano marked this pull request as ready for review April 4, 2024 14:01
@jeanluciano jeanluciano requested a review from a team as a code owner April 4, 2024 14:01
tests/workers/test_ecs_worker.py Outdated Show resolved Hide resolved
prefect_aws/workers/ecs_worker.py Outdated Show resolved Hide resolved
@@ -267,6 +278,7 @@ class ECSJobConfiguration(BaseJobConfiguration):
auto_deregister_task_definition: bool = Field(default=False)
vpc_id: Optional[str] = Field(default=None)
container_name: Optional[str] = Field(default=None)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line

default_factory=list,
description=(
"The capacity provider strategy to use when running the task. This is only"
"If a capacityProviderStrategy is specified, we will omit the launchType"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The capacity provider strategy to use when running the task. "
"If a capacity provider strategy is specified, the selected launch type will be ignored."

# Should not be provided at all if capacityProviderStrategy is set, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html#ECS-RunTask-request-capacityProviderStrategy # noqa
self._logger.warning(
"Removing launchType from task run request. Due to finding"
" capacityProviderStrategy in the request."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Found capacityProviderStrategy. "
"Removing launchType from task run request."

@jeanluciano jeanluciano merged commit 1e21cd5 into main Apr 11, 2024
7 checks passed
@jeanluciano jeanluciano deleted the improvement/add-capacity-provider branch April 11, 2024 16:34
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 this pull request may close these issues.

Accept None as an argument to Launch Type for ECSTask with publish_as_work_pool
3 participants