gpustack-runtime 0.1.44.post4__tar.gz → 0.2.0__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.1.44.post4 → gpustack_runtime-0.2.0}/PKG-INFO +2 -6
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/deploy/manifests/docker-compose.yaml +0 -4
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/deploy/manifests/kubernetes.yaml +0 -20
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/__main__.py +0 -4
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/_version.py +2 -2
- gpustack_runtime-0.2.0/gpustack_runtime/_version_appendix.py +1 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/cmds/__init__.py +0 -4
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/cmds/deployer.py +1 -163
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/__init__.py +0 -28
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/__types__.py +25 -27
- gpustack_runtime-0.2.0/gpustack_runtime/deployer/k8s/devicemanager/__init__.py +78 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/kuberentes.py +60 -19
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pyamdgpu/__init__.py +1 -1
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/envs.py +5 -50
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/pyproject.toml +1 -6
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/uv.lock +4 -107
- gpustack_runtime-0.1.44.post4/buf.gen.yaml +0 -8
- gpustack_runtime-0.1.44.post4/buf.lock +0 -2
- gpustack_runtime-0.1.44.post4/buf.yaml +0 -5
- gpustack_runtime-0.1.44.post4/gpustack_runtime/_version_appendix.py +0 -1
- gpustack_runtime-0.1.44.post4/gpustack_runtime/deployer/k8s/deviceplugin/__init__.py +0 -349
- gpustack_runtime-0.1.44.post4/gpustack_runtime/deployer/k8s/deviceplugin/__types__.py +0 -131
- gpustack_runtime-0.1.44.post4/gpustack_runtime/deployer/k8s/deviceplugin/plugin.py +0 -589
- gpustack_runtime-0.1.44.post4/gpustack_runtime/deployer/k8s/types/kubelet/deviceplugin/v1beta1/__init__.py +0 -3
- gpustack_runtime-0.1.44.post4/gpustack_runtime/deployer/k8s/types/kubelet/deviceplugin/v1beta1/api.proto +0 -212
- gpustack_runtime-0.1.44.post4/gpustack_runtime/deployer/k8s/types/kubelet/deviceplugin/v1beta1/api_pb2.py +0 -1129
- gpustack_runtime-0.1.44.post4/gpustack_runtime/deployer/k8s/types/kubelet/deviceplugin/v1beta1/api_pb2.pyi +0 -168
- gpustack_runtime-0.1.44.post4/gpustack_runtime/deployer/k8s/types/kubelet/deviceplugin/v1beta1/api_pb2_grpc.py +0 -358
- gpustack_runtime-0.1.44.post4/gpustack_runtime/deployer/k8s/types/kubelet/deviceplugin/v1beta1/constants.py +0 -34
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/.codespelldict +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/.codespellrc +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/.dockerignore +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/.gitattributes +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/.gitignore +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/.pre-commit-config.yaml +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/.python-version +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/LICENSE +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/Makefile +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/README.md +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/docs/index.md +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/docs/modules/gpustack_runtime.deployer.md +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/docs/modules/gpustack_runtime.detector.md +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/docs/modules/gpustack_runtime.md +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/_version.pyi +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/cmds/__types__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/cmds/detector.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/cmds/images.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/__patches__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/__utils__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/cdi/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/cdi/__types__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/cdi/__utils__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/cdi/amd.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/cdi/ascend.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/cdi/hygon.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/cdi/iluvatar.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/cdi/metax.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/cdi/thead.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/docker.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/podman.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/__types__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/__utils__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/amd.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/ascend.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/cambricon.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/hygon.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/iluvatar.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/metax.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/mthreads.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/nvidia.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pyacl/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pyamdsmi/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pycuda/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pydcmi/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pyhgml/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pyhgml/libhgml.so +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pyhgml/libuki.so +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pyhsa/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pyixml/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pymtml/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pymxsml/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pynvml/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pyrocmcore/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/pyrocmsmi/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/detector/thead.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/logging.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/hatch.toml +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/mkdocs.yml +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/pack/Dockerfile +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/pack/Dockerfile.dummy +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/pytest.ini +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/ruff.toml +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/deployer/fixtures/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/deployer/fixtures/test_compare_versions.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/deployer/fixtures/test_correct_runner_image.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/deployer/fixtures/test_load_yaml_or_json.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/deployer/fixtures/test_load_yaml_or_json_multiple_jsons.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/deployer/fixtures/test_load_yaml_or_json_multiple_yamls.yaml +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/deployer/fixtures/test_load_yaml_or_json_single_json.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/deployer/fixtures/test_load_yaml_or_json_single_yaml.yaml +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/deployer/fixtures/test_nginx_entrypoint.sh +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/deployer/test_utils.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/fixtures/__init__.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/README.md +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_amd_mi300x.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_amd_mi308x.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_amd_rx7800xt.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_ascend_310p3.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_ascend_910b2.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_hygon_k100ai.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_metax_c500.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_nvidia_gb10.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_nvidia_h100.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_nvidia_h100_mig.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_nvidia_h200.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_nvidia_rtx4080super.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_nvidia_rtx4090d.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_nvidia_rtx5090d.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/detect_output_thead_ppu.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_amd_mi300x.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_amd_mi308x.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_amd_rx7800xt.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_ascend_310p3.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_ascend_910b2.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_hygon_k100ai.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_metax_c500.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_mthreads_s5000.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_nvidia_h100.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_nvidia_h100_mig.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_nvidia_h200.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_nvidia_rtx4080super.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_nvidia_rtx4090d.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_nvidia_rtx5090d.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/samples/topology_output_thead_ppu.json +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/test_amd.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/test_ascend.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/test_cambricon.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/test_hygon.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/test_iluvatar.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/test_metax.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/test_mthreads.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/tests/gpustack_runtime/detector/test_nvidia.py +0 -0
- {gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/uv.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gpustack-runtime
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
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
|
|
@@ -16,17 +16,13 @@ Requires-Python: >=3.10
|
|
|
16
16
|
Requires-Dist: argcomplete>=3.6.3
|
|
17
17
|
Requires-Dist: cachetools>=5.5.2
|
|
18
18
|
Requires-Dist: docker>=7.1.0
|
|
19
|
-
Requires-Dist: gpustack-runner>=0.1.
|
|
20
|
-
Requires-Dist: grpc-interceptor>=0.15.4
|
|
21
|
-
Requires-Dist: grpcio>=1.76.0
|
|
19
|
+
Requires-Dist: gpustack-runner>=0.1.26
|
|
22
20
|
Requires-Dist: kubernetes>=33.1.0
|
|
23
21
|
Requires-Dist: mthreads-ml-py>=2.2.10
|
|
24
22
|
Requires-Dist: nvidia-ml-py>=13.580.65
|
|
25
23
|
Requires-Dist: podman==5.6.0
|
|
26
|
-
Requires-Dist: protobuf<=3.19.6
|
|
27
24
|
Requires-Dist: pyyaml
|
|
28
25
|
Requires-Dist: tqdm
|
|
29
|
-
Requires-Dist: types-protobuf<=5.28.3.20241203
|
|
30
26
|
Description-Content-Type: text/markdown
|
|
31
27
|
|
|
32
28
|
# GPUStack Runtime
|
{gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/deploy/manifests/docker-compose.yaml
RENAMED
|
@@ -32,15 +32,12 @@ services:
|
|
|
32
32
|
# see https://github.com/gpustack/runtime/blob/016531084000df8075d53772a3c33f41d829ba37/gpustack_runtime/envs.py#L48-L55 for details.
|
|
33
33
|
# - GPUSTACK_RUNTIME_DEPLOY_MIRRORED_NAME:
|
|
34
34
|
# Specify the name of this Container for gpustack-runtime identify itself.
|
|
35
|
-
# - GPUSTACK_RUNTIME_DEPLOY_CDI_SPECS_DIRECTORY:
|
|
36
|
-
# Specify the directory of CDI device interface specs.
|
|
37
35
|
#
|
|
38
36
|
container_name: gpustack-runtime
|
|
39
37
|
environment:
|
|
40
38
|
- GPUSTACK_RUNTIME_DEPLOY=Docker
|
|
41
39
|
- GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT=true
|
|
42
40
|
- GPUSTACK_RUNTIME_DEPLOY_MIRRORED_NAME=gpustack-runtime
|
|
43
|
-
- GPUSTACK_RUNTIME_DEPLOY_CDI_SPECS_DIRECTORY=/var/run/cdi
|
|
44
41
|
|
|
45
42
|
# Mount necessary volume for gpustack-runtime to work properly.
|
|
46
43
|
# - Mount docker socket for docker runtime.
|
|
@@ -50,7 +47,6 @@ services:
|
|
|
50
47
|
volumes:
|
|
51
48
|
- gpustack-runtime-data:/var/lib/gpustack
|
|
52
49
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
53
|
-
- /var/run/cdi:/var/run/cdi
|
|
54
50
|
# - /opt/...:/opt/...:ro
|
|
55
51
|
volumes:
|
|
56
52
|
gpustack-runtime-data: { }
|
|
@@ -109,13 +109,9 @@ spec:
|
|
|
109
109
|
# Change this if you want to deploy workloads into another namespace.
|
|
110
110
|
# - GPUSTACK_RUNTIME_KUBERNETES_NODE_NAME:
|
|
111
111
|
# Make sure that deploy workloads on the same node.
|
|
112
|
-
# - GPUSTACK_RUNTIME_DEPLOY_CDI_SPECS_DIRECTORY:
|
|
113
|
-
# Specify the directory of CDI device interface specs.
|
|
114
112
|
# - GPUSTACK_RUNTIME_KUBERNETES_RESOURCE_INJECTION_POLICY:
|
|
115
113
|
# Specify the resource injection policy, "KDP" is recommended.
|
|
116
114
|
# Change to "Env" if you want to use environment variable injection policy.
|
|
117
|
-
# - GPUSTACK_RUNTIME_KUBERNETES_KDP_PER_DEVICE_MAX_ALLOCATIONS:
|
|
118
|
-
# Specify the maximum allocations for one device in "KDP" policy.
|
|
119
115
|
#
|
|
120
116
|
env:
|
|
121
117
|
- name: GPUSTACK_RUNTIME_DEPLOY
|
|
@@ -134,12 +130,8 @@ spec:
|
|
|
134
130
|
valueFrom:
|
|
135
131
|
fieldRef:
|
|
136
132
|
fieldPath: spec.nodeName
|
|
137
|
-
- name: GPUSTACK_RUNTIME_DEPLOY_CDI_SPECS_DIRECTORY
|
|
138
|
-
value: "/var/run/cdi"
|
|
139
133
|
- name: GPUSTACK_RUNTIME_KUBERNETES_RESOURCE_INJECTION_POLICY
|
|
140
134
|
value: "KDP"
|
|
141
|
-
- name: GPUSTACK_RUNTIME_KUBERNETES_KDP_PER_DEVICE_MAX_ALLOCATIONS
|
|
142
|
-
value: "10"
|
|
143
135
|
|
|
144
136
|
# Mount necessary volume for gpustack-runtime to work properly.
|
|
145
137
|
# - Mount gpustack data volume for persistent data storage.
|
|
@@ -148,23 +140,11 @@ spec:
|
|
|
148
140
|
volumeMounts:
|
|
149
141
|
- name: gpustack-runtime-data
|
|
150
142
|
mountPath: /var/lib/gpustack
|
|
151
|
-
- name: cdi
|
|
152
|
-
mountPath: /var/run/cdi
|
|
153
|
-
- name: kubelet-device-plugins
|
|
154
|
-
mountPath: /var/lib/kubelet/device-plugins
|
|
155
143
|
# - name: toolkit
|
|
156
144
|
# mountPath: /opt/...
|
|
157
145
|
volumes:
|
|
158
146
|
- name: gpustack-runtime-data
|
|
159
147
|
emptyDir: { }
|
|
160
|
-
- name: cdi
|
|
161
|
-
hostPath:
|
|
162
|
-
path: /var/run/cdi
|
|
163
|
-
type: DirectoryOrCreate
|
|
164
|
-
- name: kubelet-device-plugins
|
|
165
|
-
hostPath:
|
|
166
|
-
path: /var/lib/kubelet/device-plugins
|
|
167
|
-
type: DirectoryOrCreate
|
|
168
148
|
# - name: toolkit
|
|
169
149
|
# hostPath:
|
|
170
150
|
# path: /opt/...
|
|
@@ -19,7 +19,6 @@ from .cmds import (
|
|
|
19
19
|
DetectDevicesSubCommand,
|
|
20
20
|
ExecSelfSubCommand,
|
|
21
21
|
ExecWorkloadSubCommand,
|
|
22
|
-
GenerateCDIConfigSubCommand,
|
|
23
22
|
GetDevicesTopologySubCommand,
|
|
24
23
|
GetWorkloadSubCommand,
|
|
25
24
|
InspectSelfSubCommand,
|
|
@@ -29,7 +28,6 @@ from .cmds import (
|
|
|
29
28
|
LogsSelfSubCommand,
|
|
30
29
|
LogsWorkloadSubCommand,
|
|
31
30
|
SaveImagesSubCommand,
|
|
32
|
-
ServeDevicePluginSubCommand,
|
|
33
31
|
)
|
|
34
32
|
from .logging import setup_logging
|
|
35
33
|
|
|
@@ -77,8 +75,6 @@ def main():
|
|
|
77
75
|
LogsSelfSubCommand.register(subcommand_parser)
|
|
78
76
|
ExecSelfSubCommand.register(subcommand_parser)
|
|
79
77
|
InspectSelfSubCommand.register(subcommand_parser)
|
|
80
|
-
GenerateCDIConfigSubCommand.register(subcommand_parser)
|
|
81
|
-
ServeDevicePluginSubCommand.register(subcommand_parser)
|
|
82
78
|
ListImagesSubCommand.register(subcommand_parser)
|
|
83
79
|
SaveImagesSubCommand.register(subcommand_parser)
|
|
84
80
|
LoadImagesSubCommand.register(subcommand_parser)
|
|
@@ -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.
|
|
31
|
-
__version_tuple__ = version_tuple = (0,
|
|
30
|
+
__version__ = version = '0.2.0'
|
|
31
|
+
__version_tuple__ = version_tuple = (0, 2, 0)
|
|
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 = "54957e1"
|
|
@@ -6,14 +6,12 @@ from .deployer import (
|
|
|
6
6
|
DeleteWorkloadSubCommand,
|
|
7
7
|
ExecSelfSubCommand,
|
|
8
8
|
ExecWorkloadSubCommand,
|
|
9
|
-
GenerateCDIConfigSubCommand,
|
|
10
9
|
GetWorkloadSubCommand,
|
|
11
10
|
InspectSelfSubCommand,
|
|
12
11
|
InspectWorkloadSubCommand,
|
|
13
12
|
ListWorkloadsSubCommand,
|
|
14
13
|
LogsSelfSubCommand,
|
|
15
14
|
LogsWorkloadSubCommand,
|
|
16
|
-
ServeDevicePluginSubCommand,
|
|
17
15
|
)
|
|
18
16
|
from .detector import DetectDevicesSubCommand, GetDevicesTopologySubCommand
|
|
19
17
|
from .images import (
|
|
@@ -34,7 +32,6 @@ __all__ = [
|
|
|
34
32
|
"DetectDevicesSubCommand",
|
|
35
33
|
"ExecSelfSubCommand",
|
|
36
34
|
"ExecWorkloadSubCommand",
|
|
37
|
-
"GenerateCDIConfigSubCommand",
|
|
38
35
|
"GetDevicesTopologySubCommand",
|
|
39
36
|
"GetWorkloadSubCommand",
|
|
40
37
|
"InspectSelfSubCommand",
|
|
@@ -46,7 +43,6 @@ __all__ = [
|
|
|
46
43
|
"LogsWorkloadSubCommand",
|
|
47
44
|
"PlatformedImage",
|
|
48
45
|
"SaveImagesSubCommand",
|
|
49
|
-
"ServeDevicePluginSubCommand",
|
|
50
46
|
"append_images",
|
|
51
47
|
"list_images",
|
|
52
48
|
]
|
|
@@ -5,7 +5,7 @@ import json
|
|
|
5
5
|
import os
|
|
6
6
|
import sys
|
|
7
7
|
import time
|
|
8
|
-
from argparse import
|
|
8
|
+
from argparse import REMAINDER
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
from typing import TYPE_CHECKING
|
|
11
11
|
|
|
@@ -25,10 +25,6 @@ from ..deployer import (
|
|
|
25
25
|
WorkloadStatusStateEnum,
|
|
26
26
|
async_logs_self,
|
|
27
27
|
async_logs_workload,
|
|
28
|
-
cdi_available_backends,
|
|
29
|
-
cdi_available_manufacturers,
|
|
30
|
-
cdi_dump_config,
|
|
31
|
-
cdi_supported_manufacturers,
|
|
32
28
|
create_workload,
|
|
33
29
|
delete_workload,
|
|
34
30
|
exec_self,
|
|
@@ -36,7 +32,6 @@ from ..deployer import (
|
|
|
36
32
|
get_workload,
|
|
37
33
|
inspect_self,
|
|
38
34
|
inspect_workload,
|
|
39
|
-
k8s_deviceplugin_serve,
|
|
40
35
|
list_workloads,
|
|
41
36
|
)
|
|
42
37
|
from ..detector import (
|
|
@@ -992,163 +987,6 @@ class InspectSelfSubCommand(SubCommand):
|
|
|
992
987
|
print(inspect_self())
|
|
993
988
|
|
|
994
989
|
|
|
995
|
-
class GenerateCDIConfigSubCommand(SubCommand):
|
|
996
|
-
"""
|
|
997
|
-
Command to generate CDI configurations.
|
|
998
|
-
"""
|
|
999
|
-
|
|
1000
|
-
manufacturer: ManufacturerEnum
|
|
1001
|
-
format: str
|
|
1002
|
-
output: Path | None
|
|
1003
|
-
|
|
1004
|
-
@staticmethod
|
|
1005
|
-
def register(parser: _SubParsersAction):
|
|
1006
|
-
generate_parser = parser.add_parser(
|
|
1007
|
-
"generate-cdi",
|
|
1008
|
-
help="Generate Container Device Interface(CDI) configurations according to the current environment",
|
|
1009
|
-
aliases=["gen-cdi"],
|
|
1010
|
-
)
|
|
1011
|
-
|
|
1012
|
-
generate_parser.add_argument(
|
|
1013
|
-
"--manufacturer",
|
|
1014
|
-
"--manu",
|
|
1015
|
-
type=ManufacturerEnum,
|
|
1016
|
-
help="Manufacturer to generate (default: all)",
|
|
1017
|
-
choices=list(map(str, cdi_available_manufacturers())),
|
|
1018
|
-
)
|
|
1019
|
-
|
|
1020
|
-
generate_parser.add_argument(
|
|
1021
|
-
"--backend",
|
|
1022
|
-
type=str,
|
|
1023
|
-
help="Backend to generate (default: all)",
|
|
1024
|
-
choices=cdi_available_backends(),
|
|
1025
|
-
)
|
|
1026
|
-
|
|
1027
|
-
generate_parser.add_argument(
|
|
1028
|
-
"--format",
|
|
1029
|
-
type=str,
|
|
1030
|
-
choices=["yaml", "json"],
|
|
1031
|
-
default="yaml",
|
|
1032
|
-
help="Format of the CDI configurations",
|
|
1033
|
-
)
|
|
1034
|
-
|
|
1035
|
-
generate_parser.add_argument(
|
|
1036
|
-
"output",
|
|
1037
|
-
nargs=OPTIONAL,
|
|
1038
|
-
help="Output directory to save CDI configurations (default: current directory)",
|
|
1039
|
-
)
|
|
1040
|
-
|
|
1041
|
-
generate_parser.set_defaults(func=GenerateCDIConfigSubCommand)
|
|
1042
|
-
|
|
1043
|
-
def __init__(self, args: Namespace):
|
|
1044
|
-
self.manufacturer = args.manufacturer
|
|
1045
|
-
self.format = args.format
|
|
1046
|
-
self.output = Path(args.output) if args.output else None
|
|
1047
|
-
|
|
1048
|
-
if args.backend:
|
|
1049
|
-
if not self.manufacturer:
|
|
1050
|
-
self.manufacturer = backend_to_manufacturer(args.backend)
|
|
1051
|
-
elif args.backend != manufacturer_to_backend(self.manufacturer):
|
|
1052
|
-
msg = (
|
|
1053
|
-
f"The backend '{args.backend}' is not compatible with "
|
|
1054
|
-
f"the manufacturer '{args.manufacturer}'."
|
|
1055
|
-
)
|
|
1056
|
-
raise ValueError(msg)
|
|
1057
|
-
|
|
1058
|
-
if self.output:
|
|
1059
|
-
try:
|
|
1060
|
-
if not self.output.exists():
|
|
1061
|
-
self.output.mkdir(parents=True, exist_ok=True)
|
|
1062
|
-
except OSError as e:
|
|
1063
|
-
msg = f"Failed to prepare output directory '{self.output}' for CDI configurations"
|
|
1064
|
-
raise RuntimeError(msg) from e
|
|
1065
|
-
|
|
1066
|
-
if not self.output.is_dir():
|
|
1067
|
-
msg = f"The output path '{self.output}' is not a directory"
|
|
1068
|
-
raise RuntimeError(msg)
|
|
1069
|
-
|
|
1070
|
-
def run(self):
|
|
1071
|
-
print("\033[2J\033[H", end="")
|
|
1072
|
-
|
|
1073
|
-
generated = False
|
|
1074
|
-
for manu in cdi_supported_manufacturers():
|
|
1075
|
-
if self.manufacturer and self.manufacturer != manu:
|
|
1076
|
-
continue
|
|
1077
|
-
content, path = cdi_dump_config(
|
|
1078
|
-
manufacturer=manu,
|
|
1079
|
-
output=self.output,
|
|
1080
|
-
)
|
|
1081
|
-
if content:
|
|
1082
|
-
generated = True
|
|
1083
|
-
if path:
|
|
1084
|
-
print(f"Generated CDI configuration for '{manu}' at {path}:\n")
|
|
1085
|
-
else:
|
|
1086
|
-
print(f"Generated CDI configuration for '{manu}':\n")
|
|
1087
|
-
print(content)
|
|
1088
|
-
print()
|
|
1089
|
-
|
|
1090
|
-
if not generated:
|
|
1091
|
-
print("No CDI configurations were generated.")
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
class ServeDevicePluginSubCommand(SubCommand):
|
|
1095
|
-
"""
|
|
1096
|
-
Command to serve Device Plugin.
|
|
1097
|
-
"""
|
|
1098
|
-
|
|
1099
|
-
manufacturer: ManufacturerEnum
|
|
1100
|
-
|
|
1101
|
-
@staticmethod
|
|
1102
|
-
def register(parser: _SubParsersAction):
|
|
1103
|
-
serve_parser = parser.add_parser(
|
|
1104
|
-
"serve-device-plugin",
|
|
1105
|
-
help="Serve Device Plugin according to the current environment",
|
|
1106
|
-
aliases=[
|
|
1107
|
-
"start-device-plugin",
|
|
1108
|
-
"serve-dp",
|
|
1109
|
-
"start-dp",
|
|
1110
|
-
],
|
|
1111
|
-
)
|
|
1112
|
-
|
|
1113
|
-
serve_parser.add_argument(
|
|
1114
|
-
"--manufacturer",
|
|
1115
|
-
"--manu",
|
|
1116
|
-
type=ManufacturerEnum,
|
|
1117
|
-
help="Manufacturer to generate (default: all)",
|
|
1118
|
-
choices=list(map(str, cdi_available_manufacturers())),
|
|
1119
|
-
)
|
|
1120
|
-
|
|
1121
|
-
serve_parser.add_argument(
|
|
1122
|
-
"--backend",
|
|
1123
|
-
type=str,
|
|
1124
|
-
help="Backend to generate (default: all)",
|
|
1125
|
-
choices=cdi_available_backends(),
|
|
1126
|
-
)
|
|
1127
|
-
|
|
1128
|
-
serve_parser.set_defaults(func=ServeDevicePluginSubCommand)
|
|
1129
|
-
|
|
1130
|
-
def __init__(self, args: Namespace):
|
|
1131
|
-
self.manufacturer = args.manufacturer
|
|
1132
|
-
|
|
1133
|
-
if args.backend:
|
|
1134
|
-
if not self.manufacturer:
|
|
1135
|
-
self.manufacturer = backend_to_manufacturer(args.backend)
|
|
1136
|
-
elif args.backend != manufacturer_to_backend(self.manufacturer):
|
|
1137
|
-
msg = (
|
|
1138
|
-
f"The backend '{args.backend}' is not compatible with "
|
|
1139
|
-
f"the manufacturer '{args.manufacturer}'."
|
|
1140
|
-
)
|
|
1141
|
-
raise ValueError(msg)
|
|
1142
|
-
|
|
1143
|
-
def run(self):
|
|
1144
|
-
print("\033[2J\033[H", end="")
|
|
1145
|
-
|
|
1146
|
-
k8s_deviceplugin_serve(
|
|
1147
|
-
manufacturer=self.manufacturer,
|
|
1148
|
-
cdi_generation_output=envs.GPUSTACK_RUNTIME_DEPLOY_CDI_SPECS_DIRECTORY,
|
|
1149
|
-
)
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
990
|
def format_workloads_json(sts: list[WorkloadStatus]) -> str:
|
|
1153
991
|
return json.dumps([st.to_dict() for st in sts], indent=2)
|
|
1154
992
|
|
{gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/__init__.py
RENAMED
|
@@ -31,32 +31,11 @@ from .__types__ import (
|
|
|
31
31
|
WorkloadStatus,
|
|
32
32
|
WorkloadStatusStateEnum,
|
|
33
33
|
)
|
|
34
|
-
from .cdi import (
|
|
35
|
-
available_backends as cdi_available_backends,
|
|
36
|
-
)
|
|
37
|
-
from .cdi import (
|
|
38
|
-
available_manufacturers as cdi_available_manufacturers,
|
|
39
|
-
)
|
|
40
|
-
from .cdi import (
|
|
41
|
-
dump_config as cdi_dump_config,
|
|
42
|
-
)
|
|
43
|
-
from .cdi import (
|
|
44
|
-
generate_config as cdi_generate_config,
|
|
45
|
-
)
|
|
46
|
-
from .cdi import (
|
|
47
|
-
supported_manufacturers as cdi_supported_manufacturers,
|
|
48
|
-
)
|
|
49
34
|
from .docker import (
|
|
50
35
|
DockerDeployer,
|
|
51
36
|
DockerWorkloadPlan,
|
|
52
37
|
DockerWorkloadStatus,
|
|
53
38
|
)
|
|
54
|
-
from .k8s.deviceplugin import (
|
|
55
|
-
serve as k8s_deviceplugin_serve,
|
|
56
|
-
)
|
|
57
|
-
from .k8s.deviceplugin import (
|
|
58
|
-
serve_async as k8s_deviceplugin_serve_async,
|
|
59
|
-
)
|
|
60
39
|
from .kuberentes import (
|
|
61
40
|
KubernetesDeployer,
|
|
62
41
|
KubernetesWorkloadPlan,
|
|
@@ -623,11 +602,6 @@ __all__ = [
|
|
|
623
602
|
"WorkloadStatusStateEnum",
|
|
624
603
|
"async_logs_self",
|
|
625
604
|
"async_logs_workload",
|
|
626
|
-
"cdi_available_backends",
|
|
627
|
-
"cdi_available_manufacturers",
|
|
628
|
-
"cdi_dump_config",
|
|
629
|
-
"cdi_generate_config",
|
|
630
|
-
"cdi_supported_manufacturers",
|
|
631
605
|
"create_workload",
|
|
632
606
|
"delete_workload",
|
|
633
607
|
"exec_self",
|
|
@@ -635,8 +609,6 @@ __all__ = [
|
|
|
635
609
|
"get_workload",
|
|
636
610
|
"inspect_self",
|
|
637
611
|
"inspect_workload",
|
|
638
|
-
"k8s_deviceplugin_serve",
|
|
639
|
-
"k8s_deviceplugin_serve_async",
|
|
640
612
|
"list_workloads",
|
|
641
613
|
"logs_self",
|
|
642
614
|
"logs_workload",
|
{gpustack_runtime-0.1.44.post4 → gpustack_runtime-0.2.0}/gpustack_runtime/deployer/__types__.py
RENAMED
|
@@ -30,7 +30,7 @@ from .__utils__ import (
|
|
|
30
30
|
safe_yaml,
|
|
31
31
|
validate_rfc1123_subdomain_name,
|
|
32
32
|
)
|
|
33
|
-
from .k8s.
|
|
33
|
+
from .k8s.devicemanager import cdi_kind_to_kdp_resource
|
|
34
34
|
|
|
35
35
|
if TYPE_CHECKING:
|
|
36
36
|
from collections.abc import AsyncGenerator, Generator
|
|
@@ -1491,7 +1491,7 @@ class Deployer(ABC):
|
|
|
1491
1491
|
self,
|
|
1492
1492
|
runtime_env: str,
|
|
1493
1493
|
fmt: str = "plain",
|
|
1494
|
-
) -> list[str]:
|
|
1494
|
+
) -> list[str] | dict[str, str]:
|
|
1495
1495
|
"""
|
|
1496
1496
|
Return the runtime visible devices values for the given runtime visible devices env name.
|
|
1497
1497
|
|
|
@@ -1500,10 +1500,11 @@ class Deployer(ABC):
|
|
|
1500
1500
|
The runtime visible devices environment variable name.
|
|
1501
1501
|
fmt:
|
|
1502
1502
|
The format of the returned values,
|
|
1503
|
-
can be "cdi", "
|
|
1503
|
+
can be "cdi", "plain" or "kdp".
|
|
1504
1504
|
|
|
1505
1505
|
Returns:
|
|
1506
|
-
A list of runtime visible devices values
|
|
1506
|
+
A list of runtime visible devices values if fmt is "cdi" or "plain",
|
|
1507
|
+
or a dictionary mapping CDI resource to the count of runtime visible devices if fmt is "kdp".
|
|
1507
1508
|
|
|
1508
1509
|
"""
|
|
1509
1510
|
m = self._get_materials()
|
|
@@ -1512,22 +1513,22 @@ class Deployer(ABC):
|
|
|
1512
1513
|
return []
|
|
1513
1514
|
|
|
1514
1515
|
rm = m[runtime_env]
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1516
|
+
|
|
1517
|
+
if fmt == "cdi":
|
|
1518
|
+
return [f"{rm.cdi}={v}" for v in rm.runtime_values.values()]
|
|
1519
|
+
if fmt == "plain":
|
|
1520
|
+
return list(rm.runtime_values.values())
|
|
1521
|
+
|
|
1522
|
+
return {
|
|
1523
|
+
cdi_kind_to_kdp_resource(rm.cdi): str(len(rm.runtime_values)),
|
|
1524
|
+
}
|
|
1524
1525
|
|
|
1525
1526
|
def map_runtime_visible_devices(
|
|
1526
1527
|
self,
|
|
1527
1528
|
runtime_env: str,
|
|
1528
1529
|
resource_values: list[str],
|
|
1529
1530
|
fmt: str = "plain",
|
|
1530
|
-
) -> list[str]:
|
|
1531
|
+
) -> list[str] | dict[str, str]:
|
|
1531
1532
|
"""
|
|
1532
1533
|
Map the given resource values to runtime visible devices values
|
|
1533
1534
|
for the given runtime visible devices env name.
|
|
@@ -1539,10 +1540,11 @@ class Deployer(ABC):
|
|
|
1539
1540
|
The resource values to map.
|
|
1540
1541
|
fmt:
|
|
1541
1542
|
The format of the returned values,
|
|
1542
|
-
can be "cdi", "
|
|
1543
|
+
can be "cdi", "plain" or "kdp".
|
|
1543
1544
|
|
|
1544
1545
|
Returns:
|
|
1545
|
-
A list of mapped runtime visible devices values
|
|
1546
|
+
A list of mapped runtime visible devices values if fmt is "cdi" or "plain",
|
|
1547
|
+
or a dictionary mapping CDI resource to the count of runtime visible devices if fmt is "kdp".
|
|
1546
1548
|
|
|
1547
1549
|
"""
|
|
1548
1550
|
m = self._get_materials()
|
|
@@ -1551,17 +1553,13 @@ class Deployer(ABC):
|
|
|
1551
1553
|
return []
|
|
1552
1554
|
|
|
1553
1555
|
rm = m[runtime_env]
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
cdi_kind_to_kdp_resource(rm.cdi, rm.runtime_values.get(v, v))
|
|
1562
|
-
for v in resource_values
|
|
1563
|
-
]
|
|
1564
|
-
return [rm.runtime_values.get(v, v) for v in resource_values]
|
|
1556
|
+
if fmt == "cdi":
|
|
1557
|
+
return [f"{rm.cdi}={rm.runtime_values.get(v, v)}" for v in resource_values]
|
|
1558
|
+
if fmt == "plain":
|
|
1559
|
+
return [rm.runtime_values.get(v, v) for v in resource_values]
|
|
1560
|
+
return {
|
|
1561
|
+
cdi_kind_to_kdp_resource(rm.cdi): str(len(resource_values)),
|
|
1562
|
+
}
|
|
1565
1563
|
|
|
1566
1564
|
def map_backend_visible_devices(
|
|
1567
1565
|
self,
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
from __future__ import annotations as __future_annotations__
|
|
2
|
+
|
|
3
|
+
import stat
|
|
4
|
+
from functools import lru_cache
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Literal
|
|
7
|
+
|
|
8
|
+
from gpustack_runtime import envs
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def is_kubelet_socket_accessible(
|
|
12
|
+
kubelet_endpoint: Path | None = None,
|
|
13
|
+
) -> bool:
|
|
14
|
+
"""
|
|
15
|
+
Check if the kubelet socket is accessible.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
kubelet_endpoint:
|
|
19
|
+
The path to the kubelet endpoint.
|
|
20
|
+
|
|
21
|
+
Returns:
|
|
22
|
+
True if the socket is accessible, False otherwise.
|
|
23
|
+
|
|
24
|
+
"""
|
|
25
|
+
if not kubelet_endpoint:
|
|
26
|
+
kubelet_endpoint = Path("/var/lib/kubelet/device-plugins/kubelet.sock")
|
|
27
|
+
|
|
28
|
+
if kubelet_endpoint.exists():
|
|
29
|
+
path_stat = kubelet_endpoint.lstat()
|
|
30
|
+
if path_stat and stat.S_ISSOCK(path_stat.st_mode):
|
|
31
|
+
return True
|
|
32
|
+
return False
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@lru_cache
|
|
36
|
+
def get_resource_injection_policy() -> Literal["env", "kdp"]:
|
|
37
|
+
"""
|
|
38
|
+
Get the resource injection policy (in lowercase) for the deployer.
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
The resource injection policy.
|
|
42
|
+
|
|
43
|
+
"""
|
|
44
|
+
policy = envs.GPUSTACK_RUNTIME_KUBERNETES_RESOURCE_INJECTION_POLICY.lower()
|
|
45
|
+
if policy != "auto":
|
|
46
|
+
return policy
|
|
47
|
+
|
|
48
|
+
return "kdp" if is_kubelet_socket_accessible() else "env"
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@lru_cache
|
|
52
|
+
def cdi_kind_to_kdp_resource(
|
|
53
|
+
cdi_kind: str,
|
|
54
|
+
mode: Literal["shared", "sliced"] = "shared",
|
|
55
|
+
):
|
|
56
|
+
"""
|
|
57
|
+
Convert a CDI kind to a KDP resource name.
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
cdi_kind:
|
|
61
|
+
The CDI kind to convert.
|
|
62
|
+
mode:
|
|
63
|
+
The mode of the resource, either "shared" or "sliced".
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
The corresponding KDP resource name.
|
|
67
|
+
|
|
68
|
+
"""
|
|
69
|
+
if mode == "shared":
|
|
70
|
+
return f"{cdi_kind}.shared"
|
|
71
|
+
return f"{cdi_kind}.sliced.units"
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
__all__ = [
|
|
75
|
+
"cdi_kind_to_kdp_resource",
|
|
76
|
+
"get_resource_injection_policy",
|
|
77
|
+
"is_kubelet_socket_accessible",
|
|
78
|
+
]
|