Skip to content

Recovery: drain handling for GPU reset - #111

Merged
pfl merged 2 commits into
intel:mainfrom
tkatila:recovery-drain
Sep 8, 2026
Merged

Recovery: drain handling for GPU reset#111
pfl merged 2 commits into
intel:mainfrom
tkatila:recovery-drain

Conversation

@tkatila

@tkatila tkatila commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
@tkatila
tkatila requested a review from pfl as a code owner September 7, 2026 09:18
@tkatila tkatila changed the title Recovery drain Recovery: drain handling for GPU reset Sep 7, 2026
@tkatila
tkatila requested a lite review from Copilot September 7, 2026 09:18

Copilot AI 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.

🟡 Changes recommended

A drain timeout can be enforced using the default timeout while incorrectly reporting “after 0s” in the failure message when spec.drain.timeoutSeconds is non-positive (defensive path inconsistency).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a pre-reset node drain phase to the GPURecoveryPlan controller so PCIe reset recoveries (slot/SBR/AMC) don’t run under active workloads and while DRA ResourceClaims still reserve the device, while keeping reflashes out of this drain path.

Changes:

  • Introduces a draining state machine phase before reset Jobs, including node tainting, pod eviction, and ResourceClaim-based “GPU still reserved” gating.
  • Adds taint cleanup logic (including on finalizer delete) so nodes are not left unschedulable.
  • Expands/updates envtest coverage for drain behavior and adds operator tolerations for the recovery taint (kustomize + Helm).
File summaries
File Description
internal/controller/gpurecoveryplan_helpers.go Adds drain helpers (capping lists, drain deadline/failure helpers, taint builder) and de-duplicates repeated status messages.
internal/controller/gpurecoveryplan_controller.go Adds drain phase to reconciliation, node taint reconciliation/cleanup, ResourceClaim reservation checks, and RBAC updates.
internal/controller/gpurecoveryplan_controller_test.go Adds extensive envtest coverage for the draining state machine, taint cleanup, PDB behavior, and claim-reservation gating.
internal/controller/gpurecoveryplan_const.go Adds drain-related constants (taint key, list cap, default timeout).
config/manager/manager.yaml Ensures the operator Deployment tolerates the recovery taint it applies.
charts/gpu-base-operator/values.yaml Adds configurable extra tolerations for the operator pod (Helm values).
charts/gpu-base-operator/templates/manager.yaml Adds built-in recovery taint toleration plus optional extra tolerations via Helm values.
charts/gpu-base-operator/README.md Documents the new operator.tolerations chart value.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/controller/gpurecoveryplan_helpers.go

for i := range plan.Status.Events {
switch plan.Status.Events[i].State {
case intelv1a1.RecoveryEventStateDraining,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe just an 'if' here if no other cases will be added later?

A reset acts on the PCIe bus, not just on the GPU, so it can
disturb the host itself.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
@pfl
pfl merged commit 0461c7f into intel:main Sep 8, 2026
11 checks passed
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.

3 participants