gpustack-runtime 0.2.2.post6__tar.gz → 0.2.2.post7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/PKG-INFO +1 -1
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/_version.py +2 -2
- gpustack_runtime-0.2.2.post7/gpustack_runtime/_version_appendix.py +1 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/kuberentes.py +56 -1
- gpustack_runtime-0.2.2.post7/tests/gpustack_runtime/deployer/test_privileged.py +137 -0
- gpustack_runtime-0.2.2.post6/gpustack_runtime/_version_appendix.py +0 -1
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/.codespelldict +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/.codespellrc +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/.dockerignore +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/.gitattributes +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/.gitignore +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/.pre-commit-config.yaml +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/.python-version +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/LICENSE +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/Makefile +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/README.md +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/deploy/manifests/docker-compose.yaml +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/deploy/manifests/kubernetes.yaml +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/docs/index.md +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/docs/modules/gpustack_runtime.deployer.md +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/docs/modules/gpustack_runtime.detector.md +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/docs/modules/gpustack_runtime.md +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/__main__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/_version.pyi +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/cmds/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/cmds/__types__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/cmds/deployer.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/cmds/detector.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/cmds/images.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/__patches__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/__types__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/__utils__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/cdi/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/cdi/__types__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/cdi/__utils__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/cdi/amd.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/cdi/ascend.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/cdi/hygon.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/cdi/iluvatar.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/cdi/metax.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/cdi/thead.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/docker.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/k8s/devicemanager/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/podman.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/__types__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/__utils__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/amd.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/ascend.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/cambricon.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/hygon.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/iluvatar.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/metax.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/mthreads.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/nvidia.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/pyamdgpu/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/pyamdsmi/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/pydcmi/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/pyhgml/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/pyhgml/libhgml.so +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/pyhgml/libuki.so +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/pyhsa/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/pyixml/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/pymtml/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/pymxsml/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/pynvml/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/pyrocmsmi/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/thead.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/envs.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/logging.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/hatch.toml +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/mkdocs.yml +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/pack/Dockerfile +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/pack/Dockerfile.dummy +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/pyproject.toml +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/pytest.ini +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/ruff.toml +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/deployer/fixtures/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/deployer/fixtures/test_compare_versions.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/deployer/fixtures/test_correct_runner_image.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/deployer/fixtures/test_load_yaml_or_json.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/deployer/fixtures/test_load_yaml_or_json_multiple_jsons.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/deployer/fixtures/test_load_yaml_or_json_multiple_yamls.yaml +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/deployer/fixtures/test_load_yaml_or_json_single_json.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/deployer/fixtures/test_load_yaml_or_json_single_yaml.yaml +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/deployer/fixtures/test_nginx_entrypoint.sh +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/deployer/test_utils.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/deployer/test_workload_status.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/fixtures/__init__.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/README.md +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_amd_mi300x.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_amd_mi308x.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_amd_rx7800xt.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_ascend_310p3.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_ascend_910b2.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_hygon_k100ai.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_metax_c500.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_nvidia_gb10.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_nvidia_h100.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_nvidia_h100_mig.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_nvidia_h200.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_nvidia_rtx4080super.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_nvidia_rtx4090d.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_nvidia_rtx5090d.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/detect_output_thead_ppu.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_amd_mi300x.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_amd_mi308x.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_amd_rx7800xt.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_ascend_310p3.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_ascend_910b2.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_hygon_k100ai.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_metax_c500.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_mthreads_s5000.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_nvidia_h100.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_nvidia_h100_mig.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_nvidia_h200.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_nvidia_rtx4080super.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_nvidia_rtx4090d.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_nvidia_rtx5090d.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/samples/topology_output_thead_ppu.json +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/test_amd.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/test_ascend.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/test_cambricon.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/test_detector_utils.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/test_hygon.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/test_iluvatar.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/test_metax.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/test_mig_devices.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/test_mthreads.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/tests/gpustack_runtime/detector/test_nvidia.py +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/uv.lock +0 -0
- {gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/uv.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gpustack-runtime
|
|
3
|
-
Version: 0.2.2.
|
|
3
|
+
Version: 0.2.2.post7
|
|
4
4
|
Summary: GPUStack Runtime is library for detecting GPU resources and launching GPU workloads.
|
|
5
5
|
Project-URL: Homepage, https://github.com/gpustack/runtime
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/gpustack/gpustack/issues
|
|
@@ -27,8 +27,8 @@ version_tuple: VERSION_TUPLE
|
|
|
27
27
|
__commit_id__: COMMIT_ID
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
|
|
30
|
-
__version__ = version = '0.2.2.
|
|
31
|
-
__version_tuple__ = version_tuple = (0, 2, 2, '
|
|
30
|
+
__version__ = version = '0.2.2.post7'
|
|
31
|
+
__version_tuple__ = version_tuple = (0, 2, 2, 'post7')
|
|
32
32
|
try:
|
|
33
33
|
from ._version_appendix import git_commit
|
|
34
34
|
__commit_id__ = commit_id = git_commit
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
git_commit = "9147850"
|
|
@@ -325,6 +325,61 @@ def _pin_pod_for_kueue(
|
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
|
|
328
|
+
def _is_device_plugin_resource(resource_key: str) -> bool:
|
|
329
|
+
"""
|
|
330
|
+
Report whether a resource key belongs to a device plugin resource family,
|
|
331
|
+
which is either a CDI kind ("nvidia.com/gpu") or one of its suffixed
|
|
332
|
+
variants ("nvidia.com/gpu.shared", "nvidia.com/gpu.sliced.units",
|
|
333
|
+
"nvidia.com/gpu.partitioned.mig-1g.20gb").
|
|
334
|
+
"""
|
|
335
|
+
return any(
|
|
336
|
+
resource_key == cdi or resource_key.startswith(f"{cdi}.")
|
|
337
|
+
for cdi in envs.GPUSTACK_RUNTIME_DEPLOY_RESOURCE_KEY_MAP_CDI.values()
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
def _resolve_privileged(container: Container) -> bool:
|
|
342
|
+
"""
|
|
343
|
+
Resolve whether a container runs privileged.
|
|
344
|
+
|
|
345
|
+
Privilege is dropped when the container's devices are handed out by a
|
|
346
|
+
device plugin, which is the case for every device plugin resource family
|
|
347
|
+
and, under the KDP injection policy, for every mapped device request.
|
|
348
|
+
|
|
349
|
+
A privileged container receives all device nodes of the host, so it
|
|
350
|
+
enumerates -- and can use -- every accelerator on the node, no matter
|
|
351
|
+
which one the device plugin allocated to it. That silently undoes
|
|
352
|
+
slicing: a workload holding a single MIG device or a single memory slice
|
|
353
|
+
still sees the untouched cards next to it, and a soft-slicing limit
|
|
354
|
+
lands on whichever device comes first instead of the allocated one.
|
|
355
|
+
"""
|
|
356
|
+
if not container.execution or not container.execution.privileged:
|
|
357
|
+
return False
|
|
358
|
+
if not container.resources:
|
|
359
|
+
return True
|
|
360
|
+
|
|
361
|
+
kdp = get_resource_injection_policy() == "kdp"
|
|
362
|
+
for r_k in container.resources:
|
|
363
|
+
if r_k in ("cpu", "memory"):
|
|
364
|
+
continue
|
|
365
|
+
if _is_device_plugin_resource(r_k) or (
|
|
366
|
+
kdp
|
|
367
|
+
and (
|
|
368
|
+
r_k
|
|
369
|
+
in envs.GPUSTACK_RUNTIME_DEPLOY_RESOURCE_KEY_MAP_RUNTIME_VISIBLE_DEVICES
|
|
370
|
+
or r_k == envs.GPUSTACK_RUNTIME_DEPLOY_AUTOMAP_RESOURCE_KEY
|
|
371
|
+
)
|
|
372
|
+
):
|
|
373
|
+
clogger.info(
|
|
374
|
+
"Dropping privilege of container '%s', "
|
|
375
|
+
"as its device request '%s' is allocated by a device plugin",
|
|
376
|
+
container.name,
|
|
377
|
+
r_k,
|
|
378
|
+
)
|
|
379
|
+
return False
|
|
380
|
+
return True
|
|
381
|
+
|
|
382
|
+
|
|
328
383
|
class KubernetesDeployer(EndoscopicDeployer):
|
|
329
384
|
"""
|
|
330
385
|
Deployer implementation for Kubernetes.
|
|
@@ -1048,7 +1103,7 @@ class KubernetesDeployer(EndoscopicDeployer):
|
|
|
1048
1103
|
run_as_user=c.execution.run_as_user,
|
|
1049
1104
|
run_as_group=c.execution.run_as_group,
|
|
1050
1105
|
read_only_root_filesystem=c.execution.readonly_rootfs,
|
|
1051
|
-
privileged=c
|
|
1106
|
+
privileged=_resolve_privileged(c),
|
|
1052
1107
|
capabilities=(
|
|
1053
1108
|
kubernetes.client.V1Capabilities(
|
|
1054
1109
|
add=c.execution.capabilities.add,
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
from gpustack_runtime.deployer.__types__ import (
|
|
4
|
+
Container,
|
|
5
|
+
ContainerExecution,
|
|
6
|
+
ContainerResources,
|
|
7
|
+
)
|
|
8
|
+
from gpustack_runtime.deployer.kuberentes import _resolve_privileged
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _container(privileged: bool | None, resources: dict | None = None) -> Container:
|
|
12
|
+
container_resources = None
|
|
13
|
+
if resources is not None:
|
|
14
|
+
container_resources = ContainerResources()
|
|
15
|
+
container_resources.update(resources)
|
|
16
|
+
return Container(
|
|
17
|
+
name="default",
|
|
18
|
+
image="gpustack/runner:latest",
|
|
19
|
+
execution=(
|
|
20
|
+
ContainerExecution(privileged=privileged)
|
|
21
|
+
if privileged is not None
|
|
22
|
+
else None
|
|
23
|
+
),
|
|
24
|
+
resources=container_resources,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@pytest.mark.parametrize(
|
|
29
|
+
"name, privileged, resources, policy, expected",
|
|
30
|
+
[
|
|
31
|
+
(
|
|
32
|
+
"no execution",
|
|
33
|
+
None,
|
|
34
|
+
None,
|
|
35
|
+
"env",
|
|
36
|
+
False,
|
|
37
|
+
),
|
|
38
|
+
(
|
|
39
|
+
"not requested",
|
|
40
|
+
False,
|
|
41
|
+
{"nvidia.com/devices": "0"},
|
|
42
|
+
"env",
|
|
43
|
+
False,
|
|
44
|
+
),
|
|
45
|
+
(
|
|
46
|
+
"no resources",
|
|
47
|
+
True,
|
|
48
|
+
None,
|
|
49
|
+
"env",
|
|
50
|
+
True,
|
|
51
|
+
),
|
|
52
|
+
(
|
|
53
|
+
"non-device resources only",
|
|
54
|
+
True,
|
|
55
|
+
{"cpu": "2", "memory": "4Gi"},
|
|
56
|
+
"env",
|
|
57
|
+
True,
|
|
58
|
+
),
|
|
59
|
+
(
|
|
60
|
+
"specific whole cards, env injection",
|
|
61
|
+
True,
|
|
62
|
+
{"cpu": "2", "nvidia.com/devices": "0,1"},
|
|
63
|
+
"env",
|
|
64
|
+
True,
|
|
65
|
+
),
|
|
66
|
+
(
|
|
67
|
+
"all devices, env injection",
|
|
68
|
+
True,
|
|
69
|
+
{"nvidia.com/devices": "all"},
|
|
70
|
+
"env",
|
|
71
|
+
True,
|
|
72
|
+
),
|
|
73
|
+
(
|
|
74
|
+
"specific whole cards, kdp injection",
|
|
75
|
+
True,
|
|
76
|
+
{"nvidia.com/devices": "0,1"},
|
|
77
|
+
"kdp",
|
|
78
|
+
False,
|
|
79
|
+
),
|
|
80
|
+
(
|
|
81
|
+
"auto-mapped devices, kdp injection",
|
|
82
|
+
True,
|
|
83
|
+
{"gpustack.ai/devices": "0"},
|
|
84
|
+
"kdp",
|
|
85
|
+
False,
|
|
86
|
+
),
|
|
87
|
+
(
|
|
88
|
+
"exclusive whole card",
|
|
89
|
+
True,
|
|
90
|
+
{"nvidia.com/gpu": "1"},
|
|
91
|
+
"env",
|
|
92
|
+
False,
|
|
93
|
+
),
|
|
94
|
+
(
|
|
95
|
+
"soft slice",
|
|
96
|
+
True,
|
|
97
|
+
{
|
|
98
|
+
"nvidia.com/gpu.sliced": "1",
|
|
99
|
+
"nvidia.com/gpu.sliced.memory-percentage": "50",
|
|
100
|
+
"nvidia.com/gpu.sliced.cores-percentage": "50",
|
|
101
|
+
},
|
|
102
|
+
"env",
|
|
103
|
+
False,
|
|
104
|
+
),
|
|
105
|
+
(
|
|
106
|
+
"hard partition",
|
|
107
|
+
True,
|
|
108
|
+
{
|
|
109
|
+
"nvidia.com/gpu.partitioned": "1",
|
|
110
|
+
"nvidia.com/gpu.partitioned.mig-1g.20gb": "1",
|
|
111
|
+
},
|
|
112
|
+
"env",
|
|
113
|
+
False,
|
|
114
|
+
),
|
|
115
|
+
(
|
|
116
|
+
"non-NVIDIA soft slice",
|
|
117
|
+
True,
|
|
118
|
+
{"amd.com/gpu.sliced": "1"},
|
|
119
|
+
"env",
|
|
120
|
+
False,
|
|
121
|
+
),
|
|
122
|
+
(
|
|
123
|
+
"resource key merely prefixed by a CDI kind",
|
|
124
|
+
True,
|
|
125
|
+
{"nvidia.com/gpu-alike": "1"},
|
|
126
|
+
"env",
|
|
127
|
+
True,
|
|
128
|
+
),
|
|
129
|
+
],
|
|
130
|
+
)
|
|
131
|
+
def test_resolve_privileged(name, privileged, resources, policy, expected, monkeypatch):
|
|
132
|
+
monkeypatch.setattr(
|
|
133
|
+
"gpustack_runtime.deployer.kuberentes.get_resource_injection_policy",
|
|
134
|
+
lambda: policy,
|
|
135
|
+
)
|
|
136
|
+
actual = _resolve_privileged(_container(privileged, resources))
|
|
137
|
+
assert actual == expected, f"case {name} expected {expected}, but got {actual}"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
git_commit = "79ee112"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/deploy/manifests/docker-compose.yaml
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/deploy/manifests/kubernetes.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/docs/modules/gpustack_runtime.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/cmds/__init__.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/cmds/__types__.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/cmds/deployer.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/cmds/detector.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/cmds/images.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/__types__.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/__utils__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/cdi/amd.py
RENAMED
|
File without changes
|
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/cdi/hygon.py
RENAMED
|
File without changes
|
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/cdi/metax.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/cdi/thead.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/docker.py
RENAMED
|
File without changes
|
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/deployer/podman.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/__init__.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/__types__.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/__utils__.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/amd.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/ascend.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/cambricon.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/hygon.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/iluvatar.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/metax.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/mthreads.py
RENAMED
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/nvidia.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gpustack_runtime-0.2.2.post6 → gpustack_runtime-0.2.2.post7}/gpustack_runtime/detector/thead.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|