ccluster (Python)
Pydantic v2 models for the ccluster.nvidia.com/v1alpha1 API and for the typed values of
every chart in the catalog, plus a small client that registers clusters with the control
plane. The models are generated: nothing in ccluster/v1alpha1/ or
ccluster/catalogs/cluster_base/ is written by hand.
uv add ccluster-py --path ../python # or: pip install ./python; released: pip install ccluster-py
from ccluster import catalogs
from ccluster.catalogs.cluster_base import gpu_operator, keda
from ccluster.v1alpha1 import CCLComponentSet, CCLComponentSetSpec, ObjectMeta
cs = CCLComponentSet(
metadata=ObjectMeta(name="local-base", namespace="ccluster-quickstart"),
spec=CCLComponentSetSpec(
components=[
catalogs.component("keda", "ccluster-local", keda.CHART, "keda"),
catalogs.component(
"gpu-operator", "ccluster-local", gpu_operator.CHART, "gpu-operator",
gpu_operator.Values(
gpu_operator=gpu_operator.ChartValues(
driver=gpu_operator.Toggle(enabled=False),
),
),
),
]
),
)
print(cs.model_dump(by_alias=True, exclude_none=True)) # kubectl apply -f this
Field names are snake_case with the wire name as the alias, so always dump with
by_alias=True, exclude_none=True. exclude_none is what keeps an unset optional out of
the values Helm sees while an explicit False stays in — the same distinction the Go
catalog makes with pointer fields.
Registering a cluster
CCLClient writes into one namespace, given at construction and created then if it does
not exist, and by default connects with the in-cluster configuration of the pod it runs
in. register_cluster creates a Secret named <name>-credentials in Argo CD's
cluster-secret shape (server, and a config carrying the bearer token and the CA) and a
CCLInfraPlane pointing at it; unregister_cluster deletes the Secret and the CCLInfraPlane, the
CCLInfraPlane first so the operator's finalizer removes the mirrored Argo CD Secret, and
leaves the namespace. Everything is server-side applied under the ccluster-py field
manager, so re-registering a cluster rotates its token in place.
from ccluster.client import CCLClient
client = CCLClient("tenant-a") # in-cluster
plane = client.register_cluster(
"edge-1",
"https://10.0.0.1:6443",
bearer_token=open("token").read(),
ca_cert=open("ca.crt").read(),
)
client.unregister_cluster("edge-1")
server, bearer_token and ca_cert are all optional. With none given,
register_cluster registers the cluster the operator itself runs in, credential-free —
Argo CD's special-cased in-cluster address, no ServiceAccount or token needed:
plane = client.register_cluster("ccluster-local")
From a workstation, pass a client built from your kubeconfig:
from kubernetes.config import new_client_from_config
client = CCLClient("tenant-a", api_client=new_client_from_config())
examples/register_cluster.py is the same as a command. The call returns once the
objects are applied; kubectl get cclinfraplane -n <namespace> shows when the operator
has marked the plane Available.
What is generated from what
| Python | Source | Via |
|---|---|---|
ccluster/v1alpha1/*.py |
config/crd/bases/*.yaml (the CRD openAPIV3Schema) |
hack/pyschema → JSON Schema → datamodel-code-generator |
ccluster/catalogs/cluster_base/<chart>/values.py |
catalogs/cluster_base/<chart>/component.go (Values and friends) |
hack/pyschema (invopop/jsonschema reflection) → datamodel-code-generator |
every __init__.py under those two |
the same | hack/pyschema |
Three things are deliberately added on the way from the CRD: apiVersion and kind get
defaults, metadata becomes a small ObjectMeta (name, namespace, labels, annotations)
instead of an opaque dict, and a component's values is typed dict[str, Any] rather than
"anything". Everything else, including every validation constraint and doc comment, is the
CRD's.
ccluster/__init__.py, ccluster/client.py (CCLClient), ccluster/catalogs/__init__.py
(entry, component), examples/ and tests/ are hand-written.
Regenerating
make python-generate # from the repository root; needs Go and uv
make python-test
CI regenerates and fails on any diff, so edit the Go types or the CRD markers, regenerate,
and commit the result. Adding a chart to catalogs/ means adding it to the table in
hack/pyschema/main.go too.
Metadata
Release files for ccluster-py 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ccluster_py-0.0.2.tar.gz | 19.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ccluster_py-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 77.6 kB
Release files / ccluster_py-0.0.2.tar.gz
| Download URL | ccluster_py-0.0.2.tar.gz |
|---|---|
| Size | 19.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c58f1d5f349f2ae7c8680e75575d16bb3025697bd1c5eff6bbcffed414f8f2e
|
|
BLAKE2b-256 checksum How to use checksums |
9487460b74dc0e201e7d2ce6d2226d940611baeaf323a415aa354658cddbb8ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / ccluster_py-0.0.2-py3-none-any.whl
| Download URL | ccluster_py-0.0.2-py3-none-any.whl |
|---|---|
| Size | 58.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba967b4d4250aed99a03cf6ce9ed2e506887241a7fb358b74c1ee795847907e1
|
|
BLAKE2b-256 checksum How to use checksums |
f2a72f95427213a3688a322a95c4a8cdc4625fed2f1ecf8c74abe6d22ba181c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logSecurity for ccluster-py 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for ccluster_py-0.0.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.