Skip to content

feat: surface DeviceConfig readiness via Ready condition - #691

Open
leo8a wants to merge 1 commit into
ROCm:mainfrom
leo8a:user/leo8a/deviceconfig-ready-condition
Open

leo8a wants to merge 1 commit into
ROCm:mainfrom
leo8a:user/leo8a/deviceconfig-ready-condition

Conversation

@leo8a

@leo8a leo8a commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Surfaces build/driver-install progress and overall readiness of a DeviceConfig directly on the CR, so users (and CI) can watch a single object for completion instead of hunting KMM builder pods and tailing logs.

Resolves the request in #688.

Previously the Ready condition was set True after any successful reconcile pass — before the out-of-tree driver was built/loaded or the device plugin was running — so oc wait --for=condition=Ready returned too early.

Approach

  • Derive Ready from component status the operator already collects:
    • driver (only when managed via KMM): available on all targeted nodes;
    • device plugin (only when enabled): available on all targeted nodes.
  • New reasons DriverNotReady / DevicePluginNotReady with a a/b nodes message; OperatorReady kept for backwards compatibility. Ready is left untouched while Error=True (validation / no matching nodes own that path).
  • Evaluated both where component status is written: the reconciler status update and the daemonset watcher (device-plugin status changes don't trigger a reconcile).
  • Robustness: status patches use optimistic locking so concurrent writers don't clobber each other's conditions; the reconciler no longer overwrites watcher-owned device-plugin/metrics-exporter status; the watcher no longer patches a deleted owner.
  • New printer columns: Ready, Reason, and Message (-o wide).

Validation

  • Unit tests in internal/conditions/deviceconfig_test.go; go build, go vet, go test ./internal/... pass.
  • Verified on an OpenShift cluster (MI325) by re-applying a DeviceConfig:
    NAME                    READY   REASON           AGE
    amdgpu-driver-install   False   DriverNotReady   1s
    amdgpu-driver-install   False   DriverNotReady   33s
    amdgpu-driver-install   True    OperatorReady    49s
    
    oc wait deviceconfig/amdgpu-driver-install --for=condition=Ready returns only once the driver and device plugin are actually available.

Signed-off-by: Leonardo Ochoa-Aday lochoa@redhat.com

Ready was set True after any successful reconcile, before the driver
was built or the device plugin was running. Derive it from driver and
device plugin availability so oc wait --for=condition=Ready is
meaningful, with DriverNotReady/DevicePluginNotReady reasons.

Add Ready/Reason/Message printer columns, use optimistic locking on
status patches, and keep watcher-owned status from being overwritten.

Refs: ROCm#688

Signed-off-by: Leonardo Ochoa-Aday <lochoa@redhat.com>
@leo8a

leo8a commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

/cc @yansun1996

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant