Page MenuHomeElementl

Infer cluster from tags
ClosedPublic

Authored by jordansanders on Jul 20 2021, 9:50 PM.

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
Branch
jordan-fixup-ecs-permissions (branched from master)
Lint
Lint Passed
Unit
No Test Coverage

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.