<#6157 [BUG] No default image is assigned to an ag...
# flyte-github
c
#6157 [BUG] No default image is assigned to an agent running a containerized task Issue created by JiangJiaWei1103 ### Describe the bug When developing and testing a new agent locally following this guide, we found that there exists a case in which no default image is assigned: [Screenshot 2025-01-10 at 9 35 47 PM](https://private-user-images.githubusercontent.com/36886416/402022814-105bac57-4337-403a-ad7d-fca17ca35b0d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDg2NTA0NzUsIm5iZiI6MTc0ODY1MDE3NSwicGF0aCI6Ii8zNjg4NjQxNi80MDIwMjI4MTQtMTA1YmFjNTctNDMzNy00MDNhLWFkN2QtZmNhMTdjYTM1YjBkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTMxVDAwMDkzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTExZDk0MWM4M2ZkNTEzMjUyZjg4NzNmNDk0NWNiMGM0MWQ4MzU5ODM1NDhmNGViNWM3NjI2ODU1YTA0NDZiODkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.8N4GO3fsKgiohm4PNk1jatnJgKFvjtMlCWpeMD0YYGs) #### Possible Patch In
execute
method of
AsyncAgentExecutorMixin
, `SerializationSettings`'s
image_config
field isn't well initialized, as shown here. Hence, the error is raised when: 1.
container_image
isn't specified in the corresponding task and 2.
ctx.serialization_settings
is
None
SyncAgentExecutorMixin
may have the same issue. ### Expected behavior The local test should pass even if an user doesn't explicitly specify
container_image
parameter in the corresponding task. ### Additional context to reproduce Test Slurm agent locally with the following example, import os from flytekit import workflow from flytekitplugins.slurm import Slurm, SlurmTask echo_job = SlurmTask( name="echo-job-name", task_config=Slurm( slurm_host="slurm", # Specify a remote Slurm batch script batch_script_path="/home/abaowei/echo.slurm", batch_script_args=["--debug"], sbatch_conf={ "partition": "debug", "job-name": "tiny-slurm", } ) # No container_image is specified here ) @workflow def wf() -> None: echo_job() if name == "__main__": from flytekit.clis.sdk_in_container import pyflyte from click.testing import CliRunner runner = CliRunner() path = os.path.realpath(file) # Local run print(f">>> LOCAL EXEC <<<") result = runner.invoke(pyflyte.main, ["run", path, "wf"]) print(result.output) ### Screenshots No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte