ccluster-py 0.0.10.dev172__tar.gz → 0.0.10.dev174__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.
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/PKG-INFO +6 -1
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/README.md +5 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/pyproject.toml +1 -1
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/pyproject.toml.orig +1 -1
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/cli.py +64 -5
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/LICENSE +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/cluster_base/argo_rollouts/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/cluster_base/cert_manager/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/cluster_base/final_stack/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/cluster_base/fluent_bit/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/cluster_base/gpu_operator/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/cluster_base/ingress_nginx/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/cluster_base/istio/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/cluster_base/kai_scheduler/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/cluster_base/keda/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/cluster_base/kube_prometheus_stack/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/cluster_base/longhorn/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/cluster_base/metrics_server/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/cluster_base/network_operator/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/cluster_base/prometheus_adapter/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/deployments/compute_deployment/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/deployments/dynamo_deployment/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/deployments/inference_deployment/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/deployments/job_deployment/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/namespace_base/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/resources/kai_gpu_queues/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/catalogs/resources/persistent_volume/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/client.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/py.typed +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/v1alpha1/__init__.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/v1alpha1/base.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/v1alpha1/cclclusterconfig.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/v1alpha1/cclcomponentset.py +0 -0
- {ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/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.
|
|
3
|
+
Version: 0.0.10.dev174
|
|
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.
|
|
7
|
+
version = "0.0.10.dev174"
|
|
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.
|
|
12
|
+
version = "0.0.10.dev174"
|
|
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"
|
|
@@ -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
|
|
12
|
-
|
|
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"
|
|
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:
|
|
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
|
{ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/v1alpha1/cclclusterconfig.py
RENAMED
|
File without changes
|
{ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/v1alpha1/cclcomponentset.py
RENAMED
|
File without changes
|
{ccluster_py-0.0.10.dev172 → ccluster_py-0.0.10.dev174}/src/ccluster/v1alpha1/cclinfraplane.py
RENAMED
|
File without changes
|