Skip to content

gpu-config [3/13]: derive the sync label value - #3249

Open
henry118 wants to merge 3 commits into
NVIDIA:mainfrom
henry118:gpu-config/03-status
Open

henry118 wants to merge 3 commits into
NVIDIA:mainfrom
henry118:gpu-config/03-status

Conversation

@henry118

@henry118 henry118 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Part of #3246 (3/13). Depends on: #3247. Review only the last commit.

Adds internal/gpuconfig/status: the value of the
nvidia.com/gpu-config.sync node label. Not used yet.


Devin Review

@henry118
henry118 requested a review from a team as a code owner November 17, 2026 18:33

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

The change adds module load-ID lookup and driver readiness checks. It adds versioned state parsing and persistence with exclusive locking and atomic writes. It also adds a sync label based on the recorded apply decision, module load ID, and configuration hash. Tests cover these behaviors, including parsing errors, lock contention, write restrictions, and sync outcomes.

Merge Risk: Minimal · up to 6107f

This change adds helpers for driver readiness, a persisted GPU configuration state file, and a derived sync label. Nothing consumes them yet, so there is no user-facing behavior change. The review found no merge-blocking problems, only two optional test-coverage improvements.

Security architecture risk: Minimal · up to 6107f

The change establishes internal contracts without activating a new production execution path. The inspected persistence and status logic did not establish an introduced security, failure-containment, rollback, or ownership defect.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The introduced contracts concern node-local driver and configuration state, not a demonstrated new remote or cross-tenant entrypoint. Sync performs no node-label mutation itself, and the supplied relationship evidence establishes no production label consumer.

Trust Boundaries and Controls

  • observed — The ownership classification uses the same labeled-DaemonSet controller-reference rule as the preexisting validator: an nvidia.com API-version prefix and ClusterPolicy or NVIDIADriver kind. It is not a newly strengthened identity check, and the PR does not replace the validator's existing control.
  • observed — Load identity, readiness-directory selection, ownership classification, and document hashes are caller-supplied inputs. The library compares these values but does not itself authenticate directory writers or bind a recorded decision to a completed GPU operation. Those guarantees must be assessed when production callers are introduced.

Resilience and Maintainability Implications

  • observed — Malformed or unsupported-version state returns an error instead of being overwritten through the normal locked write path. Missing state has no apply decision, and skipped, unknown, or stale-load decisions cannot produce in-sync merely because their hashes match.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick comments: 2

internal/gpuconfig/loadid/loadid_test.go: 1

157-157: Trivial · Maintainability & Code Quality · Quick win

Add a real filesystem-read error case.

This fixture is readable. It fails because IS_HOST_DRIVER is missing, so the test checks parser-error propagation. It would still pass if readDriverInfo swallowed filesystem-read errors.

Keep this malformed-content case. Add a case that creates a directory at DriverReadyFile, then assert that Ready returns an error, false readiness and nil info.

As per coding guidelines, “New behavior needs appropriate test coverage.”

Source: Coding guidelines

internal/gpuconfig/statefile/file_test.go: 1

214-214: Trivial · Maintainability & Code Quality · Quick win

Test invalidation of an earlier successful read.

The first read already fails, so base is already nil. This test would still pass if Lock.Read retained an earlier successful snapshot after an error.

First read valid state successfully. Then replace it with version 2 and repeat the existing failure and preservation checks. This catches a regression that could overwrite unreadable state.

As per path instructions, “Flag assertions that would still pass if the behavior under test were broken.”

Source: Path instructions

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 246a9ca and 6107f41.

Files selected for processing: 9

  • internal/gpuconfig/loadid/driver.go
  • internal/gpuconfig/loadid/loadid.go
  • internal/gpuconfig/loadid/loadid_test.go
  • internal/gpuconfig/statefile/file.go
  • internal/gpuconfig/statefile/file_test.go
  • internal/gpuconfig/statefile/state.go
  • internal/gpuconfig/statefile/state_test.go
  • internal/gpuconfig/status/sync.go
  • internal/gpuconfig/status/sync_test.go

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.

Signed-off-by: Henry Wang <henrwang@nvidia.com>
Signed-off-by: Henry Wang <henrwang@nvidia.com>
Signed-off-by: Henry Wang <henrwang@nvidia.com>
@henry118
henry118 force-pushed the gpu-config/03-status branch from 2de329b to 15b1db5 Compare November 19, 2026 00:16
@henry118 henry118 changed the title gpu-config: derive the sync label value gpu-config [3/13]: derive the sync label value Nov 19, 2026

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