CAC-260: Report SGLang HiCache readiness from engine Pods - #171
CAC-260: Report SGLang HiCache readiness from engine Pods#171fredericsun wants to merge 8 commits into
Conversation
Codex reviewFiles reviewed
FindingsBlockingNone. Should-fixNone. Nit
Per-category coverage
Verdictapprove-with-nits |
Codex reviewFiles reviewed
FindingsBlockingNone. Should-fix
NitNone. Per-category coverage
Verdictchanges-requested |
Codex reviewFiles reviewed
FindingsBlocking
Should-fix
NitNone. Per-category coverage
Verdictchanges-requested |
Codex reviewFiles reviewed
FindingsBlocking
Should-fix
NitNone. Per-category coverage
Verdictchanges-requested |
|
#171 (comment) |
5d4671e to
c3476f3
Compare
Codex reviewFiles reviewed
FindingsBlocking
Should-fix
Nit
Per-category coverage
Verdictchanges-requested |
Codex reviewFiles reviewed
FindingsBlocking
Should-fix
NitNone. Per-category coverage
Verdictchanges-requested |
Review — direction is solid; one reachable panic to fix before mergeRead the full diff. The 🔴 Blocking — nil-pointer panic when a
|
Summary
Report readiness for engine-local SGLang HiCache
CacheBackends from the state of their selected engine Pods.Ready=Truemeans that every participating engine Pod:CacheBackendname, UID, and generation.This confirms that the current HiCache configuration has reached serviceable engine Pods. It does not claim that a HiCache host-tier write/read round trip occurred, or distinguish a GPU hit from a host-tier read.
The controller remains observation-only for engine-local backends. It does not create, patch, restart, or automatically roll out the user-owned engine workload.
Readiness contract
ReadyProgressingDegradedFalseTrueFalseAwaitingEnginePodsTrueFalseFalseAllEnginePodsSkippedFalseFalseTrueEnginePodsNotInjectedFalseFalseTrueEnginePodsInjectionMismatchFalseTrueFalseEnginePodsRolloutInProgressFalseFalseTrueEnginePodsUnavailableTrueFalseFalseEnginePodsReadyTerminating and terminal (
SucceededorFailed) Pods are excluded.An explicitly skipped Pod is excluded only when both the operator skip annotation and the webhook-verified skip receipt are present.
If the controller cannot list the live Pod set, it returns an error and preserves the previously published readiness verdict rather than replacing it with a potentially incorrect condition.
After a
CacheBackendspec update, existing Pods retain their old injection generation. The backend therefore remainsReady=False/Progressing=Trueuntil the workload owner rolls those Pods.This PR adds no cluster-wide Pod watch. A non-ready backend is polled every five seconds and returns to the existing matched-Pod reconciliation cadence after convergence.
Change breakdown
webhook: stamp CacheBackend injection generationAdds the
inferencecache.io/injected-generationannotation to the existing injection receipt.Every successful Pod injection now records:
inferencecache.io/injected-byinferencecache.io/injected-by-uidinferencecache.io/injected-generationThe generation identifies the exact
CacheBackendspec rendered into the Pod. Fail-open and explicit-skip paths remove all three injection annotations so a Pod cannot retain a stale or partial receipt.Unit and envtest coverage verify successful stamping, cleanup, and skip behavior.
controller: report engine-local backend readinessAdds the engine-local readiness evaluator and routes
SGLangHiCachereconciliation through it.The controller:
CacheBackendnamespace.Ready,Progressing, andDegradedwith stable reason strings.status.endpointempty and removes server-backed health conditions.Table-driven tests cover no-Pod, all-skipped, missing receipt, mismatched identity, stale generation, unavailable Pod, converged, mixed-Pod, and Pod-list error cases.
test/docs: cover SGLang HiCache readiness contractUpdates the API documentation, generated CRD descriptions, sample guidance, and engine-binding documentation to describe the new readiness semantics and data-plane boundary.
The installed-cluster smoke gate now verifies:
Ready=False/AwaitingEnginePodsstate.Progressing=TrueandDegraded=Falsewhile no engine Pod exists.Ready=True/EnginePodsReady.Progressing=False,Degraded=False, and the matched Pod count is correct.The smoke fixture does not run SGLang or perform KV-cache I/O.
Out of scope
Linked issues
CAC-260
Validation
Passed locally:
make testmake lintmake manifests generate— no generated driftmake verify-docs-sync DOCS_SYNC_BASE=origin/mainmake cigofmtgo vetgolangci-lintverify-golden-vectorswas explicitly skipped bymake cibecause the local Python environment does not havexxhash.The full installed-cluster smoke was not run locally for this branch. The smoke gate is updated, but this PR does not claim a real SGLang runtime or HiCache data-plane test.
Checklist
Vendor-neutral naming (required — see CONTRIBUTING.md)
oci/oracle/*.oci.com/oraclecloud.comin any API group, CRD group, proto package, gRPC service/package, Kubernetes namespace, image registry, Helm chart, or Go module path.pkg/adapters/.../) — never in core controllers, CRD types, the proto contract, or default config.Quality
make buildandmake testpass locally.make lintclean.make manifests generateproduces no drift.Contracts
CacheBackenddesign documentation is updated with the readiness contract.v1alpha1consumers. The CRD shape remains compatible; this begins publishing standard readiness conditions forSGLangHiCache.proto/is unchanged, sodocs/design/grpc-contract.mddoes not require an update.