From 910838e2a43d4a8fc3caae6b184b7aaa97e67890 Mon Sep 17 00:00:00 2001 From: Daniel Gafni Date: Wed, 18 Dec 2024 18:38:39 +0200 Subject: [PATCH] [dagster-aws] revert ECSRunLauncher.get_image_for_run staticmethod change (#26567) ## Summary & Motivation Should fix https://app.graphite.dev/github/pr/dagster-io/internal/13096/fix-serverless-run-launcher --- .../libraries/dagster-aws/dagster_aws/ecs/launcher.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python_modules/libraries/dagster-aws/dagster_aws/ecs/launcher.py b/python_modules/libraries/dagster-aws/dagster_aws/ecs/launcher.py index a5b8efb868e23..4d60f6c771848 100644 --- a/python_modules/libraries/dagster-aws/dagster_aws/ecs/launcher.py +++ b/python_modules/libraries/dagster-aws/dagster_aws/ecs/launcher.py @@ -432,8 +432,9 @@ def _get_run_tags(self, run_id: str) -> Tags: def _get_command_args(self, run_args: ExecuteRunArgs, context: LaunchRunContext): return run_args.get_command_args() - @staticmethod - def get_image_for_run(run: DagsterRun) -> Optional[str]: + def get_image_for_run(self, context: LaunchRunContext) -> Optional[str]: + """Child classes can override this method to determine the image to use for a run. This is considered a public API.""" + run = context.dagster_run return ( run.job_code_origin.repository_origin.container_image if run.job_code_origin is not None @@ -467,7 +468,7 @@ def launch_run(self, context: LaunchRunContext) -> None: instance_ref=self._instance.get_ref(), ) command = self._get_command_args(args, context) - image = self.get_image_for_run(run) + image = self.get_image_for_run(context) run_task_kwargs = self._run_task_kwargs(run, image, container_context)