-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unless you provide your own task definition in dagster.yaml, every run that the EcsRunLauncher launches registers a new task definition. For most runs, this is redundant - the new task definition it creates is identical to the last one it created. Consequently: - Users' AWS accounts are slowly filling up with redundant ECS Task Definitions - There's a hard limit of one million revisions per task definition family so the first user to hit a million runs on the EcsRunLauncher has a nasty ticking time bomb waiting for them This change aims to alter that behavior by treating the task definition as a more generic canvas and leaning into Task Overides and Continer Overrides to vary actual behavior. As long as we have a minimum sufficient task definition, we should be able to reuse it and customize it via overrides: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TaskOverride.html https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerOverride.html
- Loading branch information
Showing
8 changed files
with
163 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
python_modules/libraries/dagster-aws/dagster_aws/ecs/utils.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import re | ||
|
||
|
||
def sanitize_family(family): | ||
# Trim the location name and remove special characters | ||
return re.sub(r"[^\w^\-]", "", family)[:255] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...on_modules/libraries/dagster-aws/dagster_aws_tests/ecs_tests/launcher_tests/test_utils.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from dagster_aws.ecs.utils import sanitize_family | ||
|
||
|
||
def test_sanitize_family(): | ||
assert sanitize_family("abc") == "abc" | ||
assert sanitize_family("abc123") == "abc123" | ||
assert sanitize_family("abc-123") == "abc-123" | ||
assert sanitize_family("abc_123") == "abc_123" | ||
assert sanitize_family("abc 123") == "abc123" | ||
assert sanitize_family("abc~123") == "abc123" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters