Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/cloudai/systems/kubernetes/kubernetes_installer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -118,6 +118,10 @@ def is_installed_one(self, item: Installable) -> InstallStatusResult:
return InstallStatusResult(False, f"Git repository {item.url} not cloned")
elif isinstance(item, PythonExecutable):
return self._is_python_executable_installed(item)
elif isinstance(item, File):
if item.installed_path.exists():
return InstallStatusResult(True)
return InstallStatusResult(False, f"File {item.installed_path} does not exist.")
elif isinstance(item, HFModel):
return self.hf_model_manager.is_model_downloaded(item)
return InstallStatusResult(False, f"Unsupported item type: {type(item)}")
Expand All @@ -132,6 +136,9 @@ def mark_as_installed_one(self, item: Installable) -> InstallStatusResult:
item.git_repo.installed_path = self.system.install_path / item.git_repo.repo_name
item.venv_path = self.system.install_path / item.venv_name
return InstallStatusResult(True)
elif isinstance(item, File):
item.installed_path = self.system.install_path / item.src.name
return InstallStatusResult(True)
elif isinstance(item, HFModel):
item.installed_path = self.system.hf_home_path # fake path is OK here as the whole HF home will be mounted
return InstallStatusResult(True)
Expand Down
6 changes: 2 additions & 4 deletions tests/test_base_installer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -331,9 +331,7 @@ def test_check_supported(installer: KubernetesInstaller | SlurmInstaller):
installer.hf_model_manager = Mock()

git = GitRepo(url="./git_url", commit="commit_hash")
items = [DockerImage("fake_url/img"), PythonExecutable(git), HFModel("model_name")]
if isinstance(installer, SlurmInstaller):
items.append(File(Path(__file__)))
items = [DockerImage("fake_url/img"), PythonExecutable(git), HFModel("model_name"), File(Path(__file__))]
for item in items:
res = installer.install_one(item)
assert res.success, f"Failed to install {item} for {installer.__class__.__name__=} {res.message=}"
Expand Down