gpustack-runtime 0.1.41.post2__py3-none-any.whl → 0.1.41.post3__py3-none-any.whl

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.
@@ -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.1.41.post2'
31
- __version_tuple__ = version_tuple = (0, 1, 41, 'post2')
30
+ __version__ = version = '0.1.41.post3'
31
+ __version_tuple__ = version_tuple = (0, 1, 41, 'post3')
32
32
  try:
33
33
  from ._version_appendix import git_commit
34
34
  __commit_id__ = commit_id = git_commit
@@ -1 +1 @@
1
- git_commit = "ed331dc"
1
+ git_commit = "3840255"
@@ -65,7 +65,7 @@ async def serve_async(
65
65
  if not devices:
66
66
  continue
67
67
 
68
- allocation_policy = _get_device_allocation_policy(manu)
68
+ allocation_policy = get_device_allocation_policy(manu)
69
69
  logger.info(
70
70
  "Using device allocation policy '%s' for manufacturer '%s'",
71
71
  allocation_policy,
@@ -277,7 +277,23 @@ def is_kubelet_socket_accessible(
277
277
 
278
278
 
279
279
  @lru_cache
280
- def _get_device_allocation_policy(
280
+ def get_resource_injection_policy() -> Literal["env", "kdp"]:
281
+ """
282
+ Get the resource injection policy (in lowercase) for the deployer.
283
+
284
+ Returns:
285
+ The resource injection policy.
286
+
287
+ """
288
+ policy = envs.GPUSTACK_RUNTIME_KUBERNETES_RESOURCE_INJECTION_POLICY.lower()
289
+ if policy != "auto":
290
+ return policy
291
+
292
+ return "kdp" if is_kubelet_socket_accessible() else "env"
293
+
294
+
295
+ @lru_cache
296
+ def get_device_allocation_policy(
281
297
  manufacturer: ManufacturerEnum,
282
298
  ) -> Literal["env", "cdi", "opaque"]:
283
299
  """
@@ -320,6 +336,8 @@ def _get_device_allocation_policy(
320
336
 
321
337
  __all__ = [
322
338
  "cdi_kind_to_kdp_resource",
339
+ "get_device_allocation_policy",
340
+ "get_resource_injection_policy",
323
341
  "is_kubelet_socket_accessible",
324
342
  "serve",
325
343
  "serve_async",
@@ -7,9 +7,9 @@ import operator
7
7
  import os
8
8
  from dataclasses import dataclass, field
9
9
  from enum import Enum
10
- from functools import lru_cache, reduce
10
+ from functools import reduce
11
11
  from pathlib import Path
12
- from typing import TYPE_CHECKING, Literal
12
+ from typing import TYPE_CHECKING
13
13
 
14
14
  import kubernetes
15
15
  import kubernetes.stream.ws_client
@@ -43,7 +43,7 @@ from .__utils__ import (
43
43
  sensitive_env_var,
44
44
  validate_rfc1123_domain_name,
45
45
  )
46
- from .k8s.deviceplugin import cdi_kind_to_kdp_resource, is_kubelet_socket_accessible
46
+ from .k8s.deviceplugin import cdi_kind_to_kdp_resource, get_resource_injection_policy
47
47
 
48
48
  if TYPE_CHECKING:
49
49
  from collections.abc import Callable, Generator
@@ -381,22 +381,6 @@ class KubernetesDeployer(EndoscopicDeployer):
381
381
 
382
382
  return wrapper
383
383
 
384
- @staticmethod
385
- @lru_cache
386
- def _get_resource_injection_policy() -> Literal["env", "kdp"]:
387
- """
388
- Get the resource injection policy (in lowercase) for the deployer.
389
-
390
- Returns:
391
- The resource injection policy.
392
-
393
- """
394
- policy = envs.GPUSTACK_RUNTIME_KUBERNETES_RESOURCE_INJECTION_POLICY.lower()
395
- if policy != "auto":
396
- return policy
397
-
398
- return "kdp" if is_kubelet_socket_accessible() else "env"
399
-
400
384
  def _create_ephemeral_configmaps(
401
385
  self,
402
386
  workload: KubernetesWorkloadPlan,
@@ -1008,7 +992,7 @@ class KubernetesDeployer(EndoscopicDeployer):
1008
992
 
1009
993
  # Parameterize resources
1010
994
  if c.resources:
1011
- kdp = self._get_resource_injection_policy() == "kdp"
995
+ kdp = get_resource_injection_policy() == "kdp"
1012
996
 
1013
997
  resources: dict[str, str] = {}
1014
998
  r_k_runtime_env = workload.resource_key_runtime_env_mapping or {}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gpustack-runtime
3
- Version: 0.1.41.post2
3
+ Version: 0.1.41.post3
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
@@ -1,6 +1,6 @@
1
1
  gpustack_runtime/__init__.py,sha256=Xw_PVWneitx-8QmW6sJQeymj6zVbEgEndGhIB_km6TI,186
2
2
  gpustack_runtime/__main__.py,sha256=O9yJKcN7vg0Ppgc13qesxHwST2wkH3ccOkTQXPWHnNA,3939
3
- gpustack_runtime/_version.py,sha256=fURzjTdczs5t1qsDdLl8wAzcF1VVhLtnm_S0ghrUvIE,792
3
+ gpustack_runtime/_version.py,sha256=avOg2k2wJyqvBs2osdxAhmsDLf9lzQxB4hFsfDnq90s,792
4
4
  gpustack_runtime/_version.pyi,sha256=A42NoSgcqEXVy2OeNm4LXC9CbyonbooYrSUBlPm2lGY,156
5
5
  gpustack_runtime/envs.py,sha256=Q8vK42OpkY4T72zN6pOz_eCS_hnQElhAmxZ1wdks0xQ,38794
6
6
  gpustack_runtime/logging.py,sha256=wMPriPpOuVsuClsjMh0qwEPQKyJiJa89ggdDjqkk7i0,6934
@@ -14,7 +14,7 @@ gpustack_runtime/deployer/__patches__.py,sha256=cTBge8BT6IsY5MzETKY3kN28k3igYfNj
14
14
  gpustack_runtime/deployer/__types__.py,sha256=PgIWogHOvHKsHoeBjmKFEEM3JrKck89Mmnwlfx01BbE,72248
15
15
  gpustack_runtime/deployer/__utils__.py,sha256=paQu2M1UeoSfQPsiskmAqJSiln-8qwibTssEoWFMLec,21109
16
16
  gpustack_runtime/deployer/docker.py,sha256=bOaXbTnaalbO42FlyWR1Ha26Y30LGWPzWKPV5Q-Nk7g,85039
17
- gpustack_runtime/deployer/kuberentes.py,sha256=VkaAvuQJ5rRiNVD6OfM2pE3rmyT_a6oEvp-G8gW8Ojo,89816
17
+ gpustack_runtime/deployer/kuberentes.py,sha256=V7_lPMFaLCJz3vqFBGKomOs9EZs7nGjrSV9EJ5lLyVM,89323
18
18
  gpustack_runtime/deployer/podman.py,sha256=_qdbsTezacRmiXa3n04OUPUsgVy1pSFgJSKxous4s14,82156
19
19
  gpustack_runtime/deployer/cdi/__init__.py,sha256=2wHrxkud3GJokE3ytNc3jvjddemXkNuuz_oIKzxD3-I,4000
20
20
  gpustack_runtime/deployer/cdi/__types__.py,sha256=04DKvcogk7OoHS7TU2Bmht3VVMu7iOEBWTEOvxpHt4w,18399
@@ -25,7 +25,7 @@ gpustack_runtime/deployer/cdi/hygon.py,sha256=h6-vQfv03sgxYjMJAf_JOMq9cHFPaNjK1Y
25
25
  gpustack_runtime/deployer/cdi/iluvatar.py,sha256=6nNECZpU5IPP6-5l-O1rzU-ib-WcuwKvDg7ZV__1NE4,3650
26
26
  gpustack_runtime/deployer/cdi/metax.py,sha256=tmJBvr-n9pERAp-dXsa54qv6xmxt0rJoJwY36TFdoWk,4143
27
27
  gpustack_runtime/deployer/cdi/thead.py,sha256=SvIDKNYZx7FwMPTTxyJ2RRjlr9LXLN8BUYCUhidmiQk,3671
28
- gpustack_runtime/deployer/k8s/deviceplugin/__init__.py,sha256=KoFztB0MmwO-lHFgEa0wLRsQyG2BN8i5w3mzo43GkbE,10498
28
+ gpustack_runtime/deployer/k8s/deviceplugin/__init__.py,sha256=cCP8Swtz_LzeIrKnwNszD54fj8ApAMgffUym4Wcyc_g,10975
29
29
  gpustack_runtime/deployer/k8s/deviceplugin/__types__.py,sha256=LCkgPDZ64Mra7bo5jmtsAO2Ypbc4qK99lMl6R_nQhnY,3043
30
30
  gpustack_runtime/deployer/k8s/deviceplugin/plugin.py,sha256=ipZ_V6pgJ2pzyEYUgAizZ7_W3a4noKEdTiZ9GAeuiRY,17728
31
31
  gpustack_runtime/deployer/k8s/types/kubelet/deviceplugin/v1beta1/__init__.py,sha256=3rOYmgDIIJ4idEtwgnumGStH7PaK-J7EYrOnLa9A-8o,118
@@ -59,9 +59,9 @@ gpustack_runtime/detector/pyixml/__init__.py,sha256=6ss_Dyl8lIT4WrKpfwmQqzBmg4Bx
59
59
  gpustack_runtime/detector/pymxsml/__init__.py,sha256=YxfNHq7TWd7CpNroP45BGXhcWNpY_sXgVzNGtx68DII,45409
60
60
  gpustack_runtime/detector/pyrocmcore/__init__.py,sha256=rgwIdPS-7GG7_5luRMR1XG9QyNM3lJh5ryD7kfZqpWg,2523
61
61
  gpustack_runtime/detector/pyrocmsmi/__init__.py,sha256=ACwRtJWVIuJ4NTcBJxk0zrVb_qtDOMkApMdbJoag5g0,11906
62
- gpustack_runtime/_version_appendix.py,sha256=VLCosBR_TL4DtCZkpcNTzR57fiBiNckG8dZUua523Ok,23
63
- gpustack_runtime-0.1.41.post2.dist-info/METADATA,sha256=KgdFo9ZEq09i9TQWXLYgfmd7mbvAUxY5SYVocoAOJSM,2364
64
- gpustack_runtime-0.1.41.post2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
65
- gpustack_runtime-0.1.41.post2.dist-info/entry_points.txt,sha256=bBO_61GxP6dIT74uZwbSDgW5Vt2pTePUS3CgjUJkUgg,68
66
- gpustack_runtime-0.1.41.post2.dist-info/licenses/LICENSE,sha256=OiPibowBvB-NHV3TP_NOj18XNBlXcshXZFMpa3uvKVE,10362
67
- gpustack_runtime-0.1.41.post2.dist-info/RECORD,,
62
+ gpustack_runtime/_version_appendix.py,sha256=NCkcFhpU5_5eIeG-39gvsVgVabq_3NDFCToVnvsn6EU,23
63
+ gpustack_runtime-0.1.41.post3.dist-info/METADATA,sha256=RLNYsBXAICxX3S0JO0t_V-73-MfKoJoLH8Mcq5kessc,2364
64
+ gpustack_runtime-0.1.41.post3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
65
+ gpustack_runtime-0.1.41.post3.dist-info/entry_points.txt,sha256=bBO_61GxP6dIT74uZwbSDgW5Vt2pTePUS3CgjUJkUgg,68
66
+ gpustack_runtime-0.1.41.post3.dist-info/licenses/LICENSE,sha256=OiPibowBvB-NHV3TP_NOj18XNBlXcshXZFMpa3uvKVE,10362
67
+ gpustack_runtime-0.1.41.post3.dist-info/RECORD,,