-
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.
First, we changed the EcsRunLauncher to only carry forward a single container definition: #6850 But this change didn't account for container definitions that defined sidecars with `dependsOn`. When using the docker compose CLI to deploy ECS, this introduced a breaking change because docker compose runs each of its ECS tasks with a dependent sidecar container. We fixed this with: #6929 But it was only a partial fix; it removed the ability to intentionally provide sidecars while still relying on Dagster to generate an ECS task definition for you. This change gives users the option to continue to create sidecars by setting `use_sidecars` to `True` in their dagster.yaml. Perhaps in the future, we'll change this config to optionally allow a list of specific sidecars to enable (for example, if you have a monitoring sidecar that you don't want the run task to inherit but a secrets sidecar that you do want it to inherit). But for now, this should allow users to configure their deployments to continue to behave the way things behaved before 6850.
- Loading branch information
Showing
6 changed files
with
80 additions
and
26 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
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
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
33 changes: 33 additions & 0 deletions
33
...modules/libraries/dagster-aws/dagster_aws_tests/ecs_tests/launcher_tests/test_sidecars.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,33 @@ | ||
def test_default(ecs, instance, launch_run): | ||
initial_task_definitions = ecs.list_task_definitions()["taskDefinitionArns"] | ||
|
||
launch_run(instance) | ||
|
||
# A new task definition is created | ||
task_definitions = ecs.list_task_definitions()["taskDefinitionArns"] | ||
assert len(task_definitions) == len(initial_task_definitions) + 1 | ||
task_definition_arn = list(set(task_definitions).difference(initial_task_definitions))[0] | ||
task_definition = ecs.describe_task_definition(taskDefinition=task_definition_arn) | ||
container_definitions = task_definition["taskDefinition"]["containerDefinitions"] | ||
|
||
assert len(container_definitions) == 1 | ||
assert not container_definitions[0].get("dependsOn") | ||
|
||
|
||
def test_include_sidecars_with_depends_on(ecs, instance_cm, launch_run, task_definition): | ||
with instance_cm({"include_sidecars": True}) as instance: | ||
initial_task_definitions = ecs.list_task_definitions()["taskDefinitionArns"] | ||
|
||
launch_run(instance) | ||
|
||
# A new task definition is created | ||
task_definitions = ecs.list_task_definitions()["taskDefinitionArns"] | ||
assert len(task_definitions) == len(initial_task_definitions) + 1 | ||
task_definition_arn = list(set(task_definitions).difference(initial_task_definitions))[0] | ||
task_definition = ecs.describe_task_definition(taskDefinition=task_definition_arn) | ||
container_definitions = task_definition["taskDefinition"]["containerDefinitions"] | ||
|
||
assert len(container_definitions) == 2 | ||
for container_definition in container_definitions: | ||
if container_definition.get("name") == "run": | ||
assert container_definition.get("dependsOn") |