Page MenuHomeElementl

Infer cluster from tags
ClosedPublic

Authored by jordansanders on Jul 20 2021, 9:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 10, 2:44 AM
Unknown Object (File)
Tue, May 9, 7:56 AM
Unknown Object (File)
Apr 26 2023, 1:18 AM
Unknown Object (File)
Apr 8 2023, 2:58 AM
Unknown Object (File)
Apr 6 2023, 3:44 AM
Unknown Object (File)
Mar 26 2023, 10:11 AM
Unknown Object (File)
Mar 26 2023, 9:13 AM
Unknown Object (File)
Mar 26 2023, 8:50 AM
Subscribers
None

Details

Summary

In addition to the credentials error exposed in
https://dagster.phacility.com/D8977, I noticed that we don't actually
need to query self._task_metadata to get the cluster name when
terminating. This is because we tag ECS launched pipeline runs with both
the ARN and the cluster. If it's lacking either, we can't terminate it
regardless of what self._task_metadata says.

Test Plan

unit

Diff Detail

Repository
R1 dagster
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dgibson added inline comments.
python_modules/libraries/dagster-aws/dagster_aws/ecs/launcher.py
140

should we check that ["tasks"] is non-empty too to avoid an index error

This revision is now accepted and ready to land.Jul 21 2021, 7:56 PM
python_modules/libraries/dagster-aws/dagster_aws/ecs/launcher.py
140

I haven't been able to reproduce a case where the arn and cluster tags both exist, the request succeeds, but the tasks key is empty. I'm not entirely sure what we'd do in that case - we could retry (but for how long?) or we could return False (but that might not actually be accurate). I think for now, I'd prefer to keep it as is and if we start to see this bubble up, we can reconsider.

python_modules/libraries/dagster-aws/dagster_aws/ecs/launcher.py
140

Actually, maybe I'll just return False.

Return false if can_terminate can't look up any tasks

This revision was automatically updated to reflect the committed changes.