question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EcsRunLauncher looking for task definition where it doesn't need to

See original GitHub issue

Dagster version

0.15.5

What’s the issue?

Dagster setup with EcsRunLauncher is looking for task definition in the launched tasks where it doesn’t need it. We have dagster.yaml where the EcsRunLauncher is configured to look for task definition (arn) as configured in an environment variable, say FOO. dagster.yaml is built into the image that is used by the containers of task definitions of daemon and dagit. When they need to ask the launcher to launch the task, the launcher can find FOO in the env. where it started (because I supply it to those container environments), finds it and successfully spawns a task using arn in FOO. However that launched container (run) soon exits because something there wants to find FOO too, although it’s not useful.

I cannot normally give FOO to the container in the task definition for Launcher whose arn needs to be in FOO. That would be cyclic dependency unless i hardcode the value (not a good practice in AWS CloudFormation).

To workaround this, I also define FOO env var for the container in the task definition i reserve for the Launcher, but leave it blank. Now everything works, which indicates to me that something in the launched task is trying to merely find FOO and doesn’t actually need its value.

What did you expect to happen?

FOO in above eg. should not be needed in the container that is launched by the EcsRunLauncher. It only needs to be defined in the containers of Dagit and Daemon since that is where the Launcher starts and looks at the configuration about what to do (which task-arn to use and so on).

How to reproduce?

In dagster.yaml:

...

run_coordinator:
  module: dagster.core.run_coordinator
  class: QueuedRunCoordinator

run_launcher:
  module: dagster_aws.ecs
  class: EcsRunLauncher
  config:
    task_definition:
      env: FOO

...

Create 4 task definitions and attach a container to each of them:

  1. Launcher task-def --> container named run and task-def arn = some-arn with image img1
  2. Usercode task-def --> container with image img2 --> env var has FOO=some-arn
  3. Dagit task-def --> container with image img3 --> env var has FOO=some-arn --> image has dagster.yaml
  4. Daemon task-def --> container with image img4 --> env var has FOO=some-arn --> image has dagster.yaml
  • Start Fargate services for (2), (3) and (4) above.
  • Connect to Dagit and launch some job-run. This will cause the EcsRunLauncher to eventually launch a Task using task-definition some-arn it gets from env-var FOO.
  • The task starts, run container soon exits and logs show that the startup code there was trying to find FOO even in that launched container, and it didn’t exist so it exited with error.

Deployment type

No response

Deployment details

No response

Additional information

No response

Message from the maintainers

Impacted by this issue? Give it a 👍! We factor engagement into prioritization.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
johannkmcommented, Jul 25, 2022

Thanks for the report, we’ll get a fix out

0reactions
johannkmcommented, Nov 28, 2022

@ustulation that’s correct, it will only need to be set in processes that use the run launcher so Dagit and the Daemon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run a standalone task in the classic Amazon ECS console
Run a standalone task in the classic Amazon ECS console · In the navigation pane, choose Task Definitions and select the task definition...
Read more >
D8486 Create a new task definition for each launch
When originally conceived, the EcsRunLauncher launched tasks using the same task definition used by its current process. This was to punt on
Read more >
[JENKINS-55078] No longer able to start ECS slaves
On the UI, all we get is: 'Jenkins' doesn't have label <label> ... ECSLauncher runECSTask WARNING: [ECS-wlxkv]: Failure to run task with definition...
Read more >
3 Steps to Deploy Your Website in the Cloud Using AWS
The task is launched by the aws ecs run-task command, which has a single mandatory parameter according to its specification: –-task-definition .
Read more >
Source code for dagster_aws.ecs.launcher - Dagster Docs
invariant( "taskDefinition" not in run_task_kwargs, "Use the `taskDefinition` config field to pass in a task definition to run.", ) check.invariant( "overrides" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found