ccluster-py 0.0.10.dev173__tar.gz → 0.0.10.dev175__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.dev173 → ccluster_py-0.0.10.dev175}/PKG-INFO +6 -1
  2. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/README.md +5 -0
  3. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/pyproject.toml +1 -1
  4. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/pyproject.toml.orig +1 -1
  5. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/cluster_base/istio/__init__.py +36 -34
  6. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/cli.py +64 -5
  7. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/LICENSE +0 -0
  8. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/__init__.py +0 -0
  9. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/__init__.py +0 -0
  10. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/cluster_base/argo_rollouts/__init__.py +0 -0
  11. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/cluster_base/cert_manager/__init__.py +0 -0
  12. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/cluster_base/final_stack/__init__.py +0 -0
  13. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/cluster_base/fluent_bit/__init__.py +0 -0
  14. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/cluster_base/gpu_operator/__init__.py +0 -0
  15. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/cluster_base/ingress_nginx/__init__.py +0 -0
  16. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/cluster_base/kai_scheduler/__init__.py +0 -0
  17. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/cluster_base/keda/__init__.py +0 -0
  18. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/cluster_base/kube_prometheus_stack/__init__.py +0 -0
  19. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/cluster_base/longhorn/__init__.py +0 -0
  20. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/cluster_base/metrics_server/__init__.py +0 -0
  21. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/cluster_base/network_operator/__init__.py +0 -0
  22. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/cluster_base/prometheus_adapter/__init__.py +0 -0
  23. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/deployments/compute_deployment/__init__.py +0 -0
  24. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/deployments/dynamo_deployment/__init__.py +0 -0
  25. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/deployments/inference_deployment/__init__.py +0 -0
  26. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/deployments/job_deployment/__init__.py +0 -0
  27. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/namespace_base/__init__.py +0 -0
  28. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/resources/kai_gpu_queues/__init__.py +0 -0
  29. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/catalogs/resources/persistent_volume/__init__.py +0 -0
  30. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/client.py +0 -0
  31. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/py.typed +0 -0
  32. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/v1alpha1/__init__.py +0 -0
  33. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/v1alpha1/base.py +0 -0
  34. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/v1alpha1/cclclusterconfig.py +0 -0
  35. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/src/ccluster/v1alpha1/cclcomponentset.py +0 -0
  36. {ccluster_py-0.0.10.dev173 → ccluster_py-0.0.10.dev175}/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.dev173
3
+ Version: 0.0.10.dev175
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
@@ -260,6 +260,11 @@ read `<name>-credentials` there is cluster-admin on the infra plane, so keep rea
260
260
  that namespace's Secrets tight. Running it again reuses the
261
261
  same token.
262
262
 
263
+ `register` then waits until the CCLInfraPlane's `ClusterConfigApplied` condition is `True`,
264
+ which means the control plane reached the cluster, and prints the domain. If it is not
265
+ `True` within two minutes, `register` fails with the condition's reason and message; the
266
+ CCLInfraPlane stays, so fix the cause and run `register` again.
267
+
263
268
  `--server` is the address Argo CD dials, and defaults to the infra-plane context's server in
264
269
  the kubeconfig. Set it when that address is only reachable from your workstation, as with
265
270
  kind, whose kubeconfig points at `127.0.0.1`.
@@ -238,6 +238,11 @@ read `<name>-credentials` there is cluster-admin on the infra plane, so keep rea
238
238
  that namespace's Secrets tight. Running it again reuses the
239
239
  same token.
240
240
 
241
+ `register` then waits until the CCLInfraPlane's `ClusterConfigApplied` condition is `True`,
242
+ which means the control plane reached the cluster, and prints the domain. If it is not
243
+ `True` within two minutes, `register` fails with the condition's reason and message; the
244
+ CCLInfraPlane stays, so fix the cause and run `register` again.
245
+
241
246
  `--server` is the address Argo CD dials, and defaults to the infra-plane context's server in
242
247
  the kubeconfig. Set it when that address is only reachable from your workstation, as with
243
248
  kind, whose kubeconfig points at `127.0.0.1`.
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "ccluster-py"
7
- version = "0.0.10.dev173"
7
+ version = "0.0.10.dev175"
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.dev173"
12
+ version = "0.0.10.dev175"
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"
@@ -35,78 +35,88 @@ class CNI(BaseModel):
35
35
  """
36
36
 
37
37
 
38
- class CiliumIstioPatch(BaseModel):
38
+ class IstioBase(BaseModel):
39
39
  """
40
- CiliumIstioPatch configures the Cilium DaemonSet patch.
40
+ IstioBase configures the istio-base subchart.
41
41
  """
42
42
 
43
43
  model_config = ConfigDict(
44
44
  extra="allow",
45
45
  populate_by_name=True,
46
46
  )
47
- enabled: bool | None = None
47
+ default_revision: Annotated[str | None, Field(alias="defaultRevision")] = None
48
48
  """
49
- Enabled applies the patch. The chart ships it off.
49
+ DefaultRevision is the revision tag installed as the default. The chart ships
50
+ "default".
50
51
  """
51
52
 
52
53
 
53
- class IstioBase(BaseModel):
54
+ class IstioGateway(BaseModel):
54
55
  """
55
- IstioBase configures the istio-base subchart.
56
+ IstioGateway configures the istio-gateway subchart.
56
57
  """
57
58
 
58
59
  model_config = ConfigDict(
59
60
  extra="allow",
60
61
  populate_by_name=True,
61
62
  )
62
- default_revision: Annotated[str | None, Field(alias="defaultRevision")] = None
63
+ enabled: bool | None = None
63
64
  """
64
- DefaultRevision is the revision tag installed as the default. The chart ships
65
- "default".
65
+ Enabled turns the ingress gateway on. The chart ships it off, to avoid the
66
+ istiod-webhook race on first install; enable it in a second pass once istiod
67
+ is Ready.
66
68
  """
67
69
 
68
70
 
69
- class IstioCNI(BaseModel):
71
+ class Pilot(BaseModel):
70
72
  """
71
- IstioCNI configures the istio-cni subchart.
73
+ Pilot configures istiod's pilot.
72
74
  """
73
75
 
74
76
  model_config = ConfigDict(
75
77
  extra="allow",
76
78
  populate_by_name=True,
77
79
  )
78
- cni: CNI | None = None
79
-
80
-
81
- class IstioGateway(BaseModel):
80
+ autoscale_min: Annotated[int | None, Field(alias="autoscaleMin")] = None
82
81
  """
83
- IstioGateway configures the istio-gateway subchart.
82
+ AutoscaleMin is the minimum pilot replica count. The chart ships 2.
84
83
  """
85
84
 
85
+
86
+ class Toleration(BaseModel):
86
87
  model_config = ConfigDict(
87
88
  extra="allow",
88
89
  populate_by_name=True,
89
90
  )
90
- enabled: bool | None = None
91
- """
92
- Enabled turns the ingress gateway on. The chart ships it off, to avoid the
93
- istiod-webhook race on first install; enable it in a second pass once istiod
94
- is Ready.
95
- """
91
+ key: str | None = None
92
+ operator: str | None = None
93
+ value: str | None = None
94
+ effect: str | None = None
95
+ toleration_seconds: Annotated[int | None, Field(alias="tolerationSeconds")] = None
96
96
 
97
97
 
98
- class Pilot(BaseModel):
98
+ class IstioCNI(BaseModel):
99
99
  """
100
- Pilot configures istiod's pilot.
100
+ IstioCNI configures the istio-cni subchart.
101
101
  """
102
102
 
103
103
  model_config = ConfigDict(
104
104
  extra="allow",
105
105
  populate_by_name=True,
106
106
  )
107
- autoscale_min: Annotated[int | None, Field(alias="autoscaleMin")] = None
107
+ cni: CNI | None = None
108
+ tolerations: list[Toleration] | None = None
108
109
  """
109
- AutoscaleMin is the minimum pilot replica count. The chart ships 2.
110
+ Tolerations replaces the istio-cni-node DaemonSet's tolerations, and an empty list
111
+ removes them all. Unset, the chart keeps the upstream list, whose wildcards tolerate
112
+ every NoSchedule and NoExecute taint.
113
+
114
+ On Cilium, list only the taints istio-cni-node must run on, such as
115
+ dedicated_compute=true:NoSchedule. The wildcards also tolerate
116
+ node.cilium.io/agent-not-ready, so istio-cni can write its CNI configuration
117
+ before cilium-agent is Ready and break pod networking on that node until the
118
+ istio-cni pod is recreated. The DaemonSet controller still adds the node-condition
119
+ tolerations, such as not-ready and unreachable.
110
120
  """
111
121
 
112
122
 
@@ -135,14 +145,6 @@ class Values(BaseModel):
135
145
  istiod: Istiod | None = None
136
146
  istio_gateway: Annotated[IstioGateway | None, Field(alias="istio-gateway")] = None
137
147
  istio_cni: Annotated[IstioCNI | None, Field(alias="istio-cni")] = None
138
- cilium_istio_patch: Annotated[
139
- CiliumIstioPatch | None, Field(alias="ciliumIstioPatch")
140
- ] = None
141
- """
142
- CiliumIstioPatch enables the in-chart DaemonSet patch applied to
143
- istio-cni-node when Cilium is the cluster CNI. Rendered by
144
- templates/cilium-patch.yaml. The chart ships it off.
145
- """
146
148
 
147
149
 
148
150
  # CHART is the chart directory, relative to the root of the catalog repository.
@@ -8,8 +8,9 @@ subcommand, it prints its usage. init saves the kubeconfig context of the one co
8
8
  plane the user works with, after checking it serves the ccluster API, to a small config
9
9
  file; the other commands read it from there. register registers an infra-plane cluster
10
10
  with that control plane: it creates a cluster-admin ServiceAccount token on the infra
11
- plane and hands it to CCLClient.apply_infraplane on the control plane. Both clusters are
12
- reached through kubeconfig contexts, so no credentials are stored by ccluster itself.
11
+ plane, hands it to CCLClient.apply_infraplane on the control plane, and waits for the
12
+ control-plane operator to report that it reached the cluster. Both clusters are reached
13
+ through kubeconfig contexts, so no credentials are stored by ccluster itself.
13
14
  unregister reverses register on the control plane and leaves the infra plane alone.
14
15
  """
15
16
 
@@ -31,7 +32,8 @@ from kubernetes.dynamic import DynamicClient
31
32
  from kubernetes.dynamic.exceptions import ResourceNotFoundError
32
33
 
33
34
  from ccluster.client import CCLClient
34
- from ccluster.v1alpha1 import API_VERSION, Kind
35
+ from ccluster.v1alpha1 import API_VERSION, CCLInfraPlane, Kind
36
+ from ccluster.v1alpha1.cclinfraplane import Condition, Status
35
37
 
36
38
 
37
39
  # What register creates on the infra plane. Argo CD deploys charts that install CRDs,
@@ -51,6 +53,13 @@ CONFIG_ENV = "CCLUSTER_CONFIG"
51
53
  _TOKEN_TIMEOUT_SECONDS = 30.0
52
54
  _TOKEN_POLL_SECONDS = 1.0
53
55
 
56
+ # How long register waits for the control plane to write the cluster's CCLClusterConfig.
57
+ # It is longer than the operator's one-minute retry of a failed write, so register run
58
+ # again after a fix, such as installing the ccluster-ip chart, sees that retry.
59
+ _CLUSTER_CONFIG_TIMEOUT_SECONDS = 120.0
60
+ _CLUSTER_CONFIG_POLL_SECONDS = 2.0
61
+ _CLUSTER_CONFIG_APPLIED = "ClusterConfigApplied"
62
+
54
63
 
55
64
  @click.group(
56
65
  context_settings={"help_option_names": ["-h", "--help"]},
@@ -134,6 +143,11 @@ def register(
134
143
  checks the CCLInfraPlane first, so a NAME it refuses creates nothing on the infra plane.
135
144
  Re-running reuses the same token.
136
145
 
146
+ register then waits until the CCLInfraPlane's ClusterConfigApplied condition is True,
147
+ which means the control plane reached the cluster, and prints the domain. If it is not
148
+ True within two minutes, register fails with the condition's reason and message. The
149
+ CCLInfraPlane stays: fix the cause and run register again to wait for it.
150
+
137
151
  Pass --server when the kubeconfig's address is not reachable from the control plane,
138
152
  for example a kind cluster, whose kubeconfig points at 127.0.0.1.
139
153
  """
@@ -154,9 +168,14 @@ def register(
154
168
  plane = client.apply_infraplane(
155
169
  name=name, server=server, bearer_token=token, ca_cert=ca_cert
156
170
  )
171
+ click.echo(
172
+ f"Applied CCLInfraPlane {plane.metadata.namespace}/{plane.metadata.name} "
173
+ f"for {server}; waiting for the control plane to reach the cluster"
174
+ )
175
+ plane = _wait_for_cluster_config(client, name, server)
157
176
  click.echo(
158
- f"Registered CCLInfraPlane {plane.metadata.namespace}/{plane.metadata.name} "
159
- f"for {server}"
177
+ f"Registered CCLInfraPlane {plane.metadata.namespace}/{plane.metadata.name}; "
178
+ f"its domain is {plane.status.domain}"
160
179
  )
161
180
 
162
181
 
@@ -298,6 +317,46 @@ def _cluster_admin_token(api_client: k8s.ApiClient) -> tuple[str, bytes]:
298
317
  time.sleep(_TOKEN_POLL_SECONDS)
299
318
 
300
319
 
320
+ def _wait_for_cluster_config(client: CCLClient, name: str, server: str) -> CCLInfraPlane:
321
+ """Poll the CCLInfraPlane name until its ClusterConfigApplied condition is True.
322
+
323
+ Returns the plane; at the timeout, raises an error with the condition's last reason and
324
+ message. A False does not end the wait. Registering again with another server changes
325
+ only the credentials Secret, not the CCLInfraPlane's generation, so until the operator
326
+ has tried the new server the condition still describes the old one.
327
+ """
328
+ deadline = time.monotonic() + _CLUSTER_CONFIG_TIMEOUT_SECONDS
329
+ while True:
330
+ plane = client.get_infraplane(name=name)
331
+ conditions = plane.status.conditions if plane.status else None
332
+ condition = next((c for c in conditions or [] if c.type == _CLUSTER_CONFIG_APPLIED), None)
333
+ if condition is not None and condition.status == Status.true:
334
+ return plane
335
+ if time.monotonic() >= deadline:
336
+ raise click.ClickException(_cluster_config_error(plane, condition, server))
337
+ time.sleep(_CLUSTER_CONFIG_POLL_SECONDS)
338
+
339
+
340
+ def _cluster_config_error(
341
+ plane: CCLInfraPlane, condition: Condition | None, server: str
342
+ ) -> str:
343
+ """Say why plane's ClusterConfigApplied condition, condition, is not True."""
344
+ prefix = (
345
+ f"CCLInfraPlane {plane.metadata.namespace}/{plane.metadata.name} is applied, "
346
+ f"but after {_CLUSTER_CONFIG_TIMEOUT_SECONDS:g}s"
347
+ )
348
+ if condition is None:
349
+ return (
350
+ f"{prefix} it has no {_CLUSTER_CONFIG_APPLIED} condition; "
351
+ "is the ccluster-cp operator running?"
352
+ )
353
+ return (
354
+ f"{prefix} {_CLUSTER_CONFIG_APPLIED} is {condition.status.value} ({condition.reason}): "
355
+ f"{condition.message}; if the control plane cannot reach {server}, run register "
356
+ "again with --server set to an address it can reach"
357
+ )
358
+
359
+
301
360
  def _create_if_absent(create, *args) -> None:
302
361
  """Call a typed client's create method, treating AlreadyExists as success."""
303
362
  try: