Add Kubernetes API client with optional dependency [2/3]#65
Open
gustcol wants to merge 3 commits intofacebookresearch:mainfrom
Open
Add Kubernetes API client with optional dependency [2/3]#65gustcol wants to merge 3 commits intofacebookresearch:mainfrom
gustcol wants to merge 3 commits intofacebookresearch:mainfrom
Conversation
Introduce KubernetesPodRow/Payload and KubernetesNodeConditionRow/Payload schemas following the existing Row+Payload(DerivedCluster) pattern, plus a KubernetesClient Protocol mirroring SlurmClient for pluggable K8s data sources. This is the foundation for Kubernetes-layer observability in SUNK (Slurm-on-K8s) clusters. Ref: facebookresearch#63
Implement KubernetesApiClient using the official kubernetes Python library as an optional dependency. Supports both in-cluster and kubeconfig auth, extracts slurm.coreweave.com/job-id annotations for Slurm-K8s correlation, and emits one KubernetesPodRow per container. Includes KubernetesFakeClient for testing with injectable data. Ref: facebookresearch#63
CI CommandsThe following CI workflows run automatically on every push and pull request:
The following commands can be used by maintainers to trigger additional tests that require access to secrets:
|
6 tasks
Add type: ignore[import-not-found] comments to kubernetes imports since the library lacks type stubs and is an optional dependency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
KubernetesApiClientusing the officialkubernetesPython library as an optional dependency (pip install gpucm[kubernetes])slurm.coreweave.com/job-idannotations for Slurm-K8s job correlationKubernetesFakeClientfor testing with injectable pod/node dataStacked PR series: [1/3] #64 ← [2/3] → [3/3]
Ref: #63
Test plan
test_kubernetes_client.py)ufmtformatting cleanflake8linting clean