From d763a0c4a806fb56e5e64d51b0035bb820b60931 Mon Sep 17 00:00:00 2001 From: rhallak Date: Wed, 7 Oct 2026 14:45:42 +0300 Subject: [PATCH 1/3] Defer CommandShell executable checks until a command runs. SlurmSystem can be constructed when /bin/bash is absent, and a missing shell is reported when a command is actually executed. Signed-off-by: rhallak --- src/cloudai/systems/slurm/slurm_system.py | 2 +- src/cloudai/util/command_shell.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/cloudai/systems/slurm/slurm_system.py b/src/cloudai/systems/slurm/slurm_system.py index 5edbed01a..c021fda75 100644 --- a/src/cloudai/systems/slurm/slurm_system.py +++ b/src/cloudai/systems/slurm/slurm_system.py @@ -106,7 +106,7 @@ class SlurmSystem(System): cache_docker_images_locally: bool = False scheduler: str = "slurm" monitor_interval: int = 60 - cmd_shell: CommandShell = Field(default=CommandShell(), exclude=True) + cmd_shell: CommandShell = Field(default_factory=CommandShell, exclude=True) extra_srun_args: Optional[str] = None extra_sbatch_args: list[str] = Field(default_factory=list) supports_gpu_directives_cache: Optional[bool] = Field(default=None, exclude=True) diff --git a/src/cloudai/util/command_shell.py b/src/cloudai/util/command_shell.py index 86358498b..39f6bcf44 100644 --- a/src/cloudai/util/command_shell.py +++ b/src/cloudai/util/command_shell.py @@ -32,12 +32,8 @@ def __init__(self, executable: Path = Path("/bin/bash")): Args: executable (Path): The shell executable path. Defaults to Path("/bin/bash"). - - Raises: - FileNotFoundError: If the specified executable does not exist. + Existence is checked when execute() is called, not at init. """ - if not executable.exists(): - raise FileNotFoundError(f"Executable '{executable}' not found.") self.executable = executable def execute(self, command: str) -> subprocess.Popen: @@ -51,8 +47,11 @@ def execute(self, command: str) -> subprocess.Popen: subprocess.Popen: The process object for the executed command. Raises: + FileNotFoundError: If the shell executable does not exist. subprocess.CalledProcessError: If command execution fails. """ + if not self.executable.exists(): + raise FileNotFoundError(f"Executable '{self.executable}' not found.") process = subprocess.Popen( command, shell=True, From c1e0d049bf60359f3905d7fd0b0d38155e2f2aaa Mon Sep 17 00:00:00 2001 From: rhallak Date: Wed, 7 Oct 2026 14:45:43 +0300 Subject: [PATCH 2/3] Load a custom stylesheet in the Sphinx documentation build. Signed-off-by: rhallak --- doc/conf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index 96fed0e0b..6e119fe24 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -112,3 +112,6 @@ def setup(app): root_doc = "index" source_suffix = [".rst"] + +html_static_path = ["_static"] +html_css_files = ["custom.css"] From 0bdc9b9da994dd7d089601005499fb4db02f6230 Mon Sep 17 00:00:00 2001 From: rhallak Date: Wed, 7 Oct 2026 15:07:08 +0300 Subject: [PATCH 3/3] Move the Sphinx stylesheet setting to the documentation pull request. The custom stylesheet registration now lives on docs/v180-updates for NVIDIA/cloudai#1089. Signed-off-by: rhallak --- doc/conf.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 6e119fe24..96fed0e0b 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -112,6 +112,3 @@ def setup(app): root_doc = "index" source_suffix = [".rst"] - -html_static_path = ["_static"] -html_css_files = ["custom.css"]