ccluster-py 0.0.10.dev169__tar.gz → 0.0.10.dev171__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.
Files changed (36) hide show
  1. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/PKG-INFO +3 -2
  2. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/README.md +2 -1
  3. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/pyproject.toml +1 -1
  4. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/pyproject.toml.orig +1 -1
  5. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/cluster_base/istio/__init__.py +8 -6
  6. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/client.py +28 -0
  7. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/LICENSE +0 -0
  8. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/__init__.py +0 -0
  9. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/__init__.py +0 -0
  10. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/cluster_base/argo_rollouts/__init__.py +0 -0
  11. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/cluster_base/cert_manager/__init__.py +0 -0
  12. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/cluster_base/final_stack/__init__.py +0 -0
  13. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/cluster_base/fluent_bit/__init__.py +0 -0
  14. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/cluster_base/gpu_operator/__init__.py +0 -0
  15. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/cluster_base/ingress_nginx/__init__.py +0 -0
  16. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/cluster_base/kai_scheduler/__init__.py +0 -0
  17. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/cluster_base/keda/__init__.py +0 -0
  18. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/cluster_base/kube_prometheus_stack/__init__.py +0 -0
  19. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/cluster_base/longhorn/__init__.py +0 -0
  20. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/cluster_base/metrics_server/__init__.py +0 -0
  21. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/cluster_base/network_operator/__init__.py +0 -0
  22. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/cluster_base/prometheus_adapter/__init__.py +0 -0
  23. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/deployments/compute_deployment/__init__.py +0 -0
  24. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/deployments/dynamo_deployment/__init__.py +0 -0
  25. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/deployments/inference_deployment/__init__.py +0 -0
  26. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/deployments/job_deployment/__init__.py +0 -0
  27. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/namespace_base/__init__.py +0 -0
  28. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/resources/kai_gpu_queues/__init__.py +0 -0
  29. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/catalogs/resources/persistent_volume/__init__.py +0 -0
  30. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/cli.py +0 -0
  31. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/py.typed +0 -0
  32. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/v1alpha1/__init__.py +0 -0
  33. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/v1alpha1/base.py +0 -0
  34. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/v1alpha1/cclclusterconfig.py +0 -0
  35. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/v1alpha1/cclcomponentset.py +0 -0
  36. {ccluster_py-0.0.10.dev169 → ccluster_py-0.0.10.dev171}/src/ccluster/v1alpha1/cclinfraplane.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ccluster-py
3
- Version: 0.0.10.dev169
3
+ Version: 0.0.10.dev171
4
4
  Summary: Pydantic models and a client for the ccluster.nvidia.com API and its Helm chart catalog
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -182,7 +182,8 @@ raises `NotFoundError` for a missing set.
182
182
  conditions by type and drops the ones the operator computed from an older generation, so
183
183
  what is left is its verdict on the spec as it now stands — after a failed validation
184
184
  `ComponentsApplied` still carries the previous generation's. `get_component_set` and
185
- `get_infraplane` read one object and return it as its model, or raise `NotFoundError`.
185
+ `get_infraplane` read one object and return it as its model, or raise `NotFoundError`;
186
+ `list_component_sets` and `list_infraplanes` return every one in the client's namespace.
186
187
 
187
188
  ```python
188
189
  if not client.is_component_set_finished(name="local-base"):
@@ -160,7 +160,8 @@ raises `NotFoundError` for a missing set.
160
160
  conditions by type and drops the ones the operator computed from an older generation, so
161
161
  what is left is its verdict on the spec as it now stands — after a failed validation
162
162
  `ComponentsApplied` still carries the previous generation's. `get_component_set` and
163
- `get_infraplane` read one object and return it as its model, or raise `NotFoundError`.
163
+ `get_infraplane` read one object and return it as its model, or raise `NotFoundError`;
164
+ `list_component_sets` and `list_infraplanes` return every one in the client's namespace.
164
165
 
165
166
  ```python
166
167
  if not client.is_component_set_finished(name="local-base"):
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "ccluster-py"
7
- version = "0.0.10.dev169"
7
+ version = "0.0.10.dev171"
8
8
  description = "Pydantic models and a client for the ccluster.nvidia.com API and its Helm chart catalog"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -9,7 +9,7 @@ build-backend = "uv_build"
9
9
  # `ccluster` (src/ccluster).
10
10
  name = "ccluster-py"
11
11
  # Placeholder: the release version is the git tag, stamped in by `make python-build`.
12
- version = "0.0.10.dev169"
12
+ version = "0.0.10.dev171"
13
13
  description = "Pydantic models and a client for the ccluster.nvidia.com API and its Helm chart catalog"
14
14
  readme = "README.md"
15
15
  license = "Apache-2.0"
@@ -13,8 +13,8 @@ from pydantic import BaseModel, ConfigDict, Field
13
13
  class CNI(BaseModel):
14
14
  """
15
15
  CNI is where istio-cni writes its plugin binary and configuration. These are the only
16
- values in this chart that must be tuned per cluster: the chart's defaults target
17
- k3s/k3d, and the correct paths depend on the node image. See the CNIBinDir constants.
16
+ values in this chart that must be tuned per cluster: the chart's defaults are the
17
+ standard paths, and the correct paths depend on the node image.
18
18
  """
19
19
 
20
20
  model_config = ConfigDict(
@@ -23,13 +23,15 @@ class CNI(BaseModel):
23
23
  )
24
24
  cni_conf_dir: Annotated[str | None, Field(alias="cniConfDir")] = None
25
25
  """
26
- CNIConfDir is the CNI configuration directory. Use CNIConfDirDefault on
27
- anything but k3s.
26
+ CNIConfDir is the CNI configuration directory. The chart ships /etc/cni/net.d
27
+ (CNIConfDirDefault); k3s needs /var/lib/rancher/k3s/agent/etc/cni/net.d
28
+ (CNIConfDirK3s).
28
29
  """
29
30
  cni_bin_dir: Annotated[str | None, Field(alias="cniBinDir")] = None
30
31
  """
31
- CNIBinDir is the CNI binary directory. Use CNIBinDirGKE on GKE COS and
32
- CNIBinDirDefault on EKS, kind and kubeadm.
32
+ CNIBinDir is the CNI binary directory. The chart ships /opt/cni/bin
33
+ (CNIBinDirDefault); GKE COS needs /home/kubernetes/bin (CNIBinDirGKE) and k3s
34
+ /var/lib/rancher/k3s/data/cni (CNIBinDirK3s).
33
35
  """
34
36
 
35
37
 
@@ -147,9 +147,14 @@ class CCLClient:
147
147
  api_client is required. In a pod, call kubernetes.config.load_incluster_config() and
148
148
  pass kubernetes.client.ApiClient(); from a workstation pass
149
149
  kubernetes.config.new_client_from_config().
150
+
151
+ An empty namespace raises ValueError: the Kubernetes client reads it as every
152
+ namespace, so the client's lists would reach past the one it serves.
150
153
  """
151
154
 
152
155
  def __init__(self, namespace: str, *, api_client: k8s.ApiClient) -> None:
156
+ if not namespace:
157
+ raise ValueError("namespace must not be empty")
153
158
  self.namespace = namespace
154
159
  self._api = api_client
155
160
  self._discovery = _discover(api_client)
@@ -266,6 +271,16 @@ class CCLClient:
266
271
  self._get(self._discovery.infra_plane_gvr, name)
267
272
  )
268
273
 
274
+ def list_infraplanes(self) -> list[CCLInfraPlane]:
275
+ """Return the CCLInfraPlanes in the client's namespace.
276
+
277
+ A namespace that does not exist has none.
278
+ """
279
+ return [
280
+ CCLInfraPlane.model_validate(item)
281
+ for item in self._list(self._discovery.infra_plane_gvr)
282
+ ]
283
+
269
284
  def apply_component_set(
270
285
  self, *, name: str, components: list[ComponentSpec]
271
286
  ) -> CCLComponentSet:
@@ -366,6 +381,16 @@ class CCLClient:
366
381
  self._get(self._discovery.component_set_gvr, name)
367
382
  )
368
383
 
384
+ def list_component_sets(self) -> list[CCLComponentSet]:
385
+ """Return the CCLComponentSets in the client's namespace.
386
+
387
+ A namespace that does not exist has none.
388
+ """
389
+ return [
390
+ CCLComponentSet.model_validate(item)
391
+ for item in self._list(self._discovery.component_set_gvr)
392
+ ]
393
+
369
394
  def _apply(self, gvr, body, *, dry_run: bool = False):
370
395
  # dry_run="All" has the API server validate and admit the object without
371
396
  # persisting it.
@@ -387,3 +412,6 @@ class CCLClient:
387
412
 
388
413
  def _get(self, gvr, name: str) -> dict:
389
414
  return self._discovery.dynamic.get(gvr, name=name, namespace=self.namespace).to_dict()
415
+
416
+ def _list(self, gvr) -> list[dict]:
417
+ return self._discovery.dynamic.get(gvr, namespace=self.namespace).to_dict().get("items") or []