Skip to content

Recovery: approvals and reset job creation - #110

Merged
pfl merged 2 commits into
intel:mainfrom
tkatila:recovery-approvals
Sep 4, 2026
Merged

Recovery: approvals and reset job creation#110
pfl merged 2 commits into
intel:mainfrom
tkatila:recovery-approvals

Conversation

@tkatila

@tkatila tkatila commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

This is missing the reflash job creation. It's coming in a later PR.

While reviewing the PR content, I made some code restructuring which sadly makes the diff a bit confusing.

The recovery controller runs a hardware reset by creating a one-shot Job
on the node hosting the broken GPU. Add the template it starts from.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>

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

The re-approval path can consume a one-shot approval even when no recovery Job actually starts, which can incorrectly force re-approval and diverge from the intended consumption semantics.

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

Pull request overview

This PR advances the GPU recovery workflow by adding approval handling and reset Job creation/monitoring to the GPURecoveryPlan controller, plus lifecycle safeguards (finalizer) so in-flight recovery Jobs aren’t orphaned during plan deletion.

Changes:

  • Add approval matching (including node label selectors) and event override handling, and create/reset recovery Jobs for approved events.
  • Track Job outcomes to update event state, retain Jobs for diagnostics, and clean up Jobs on plan deletion via a new finalizer.
  • Add a reset Job template (embedded deployment asset), expand RBAC, and significantly extend envtest/unit coverage around approvals/finalizers/job handling.
File summaries
File Description
internal/controller/gpurecoveryplan_helpers.go Adds shared helpers for approvals (node label cache), Job terminal detection, status message capping, and plan/event state utilities.
internal/controller/gpurecoveryplan_controller.go Implements finalizer handling, approval processing, recovery Job creation, Job status sync, and spec/status persistence ordering.
internal/controller/gpurecoveryplan_controller_test.go Adds extensive tests for finalizers, approval matching/consumption, overrides, job retention, and persistence behavior.
internal/controller/gpurecoveryplan_const.go Introduces constants for the plan finalizer and recovery Job labels.
config/rbac/role.yaml Updates RBAC to allow updating/patching GPURecoveryPlans and managing finalizers.
charts/gpu-base-operator/templates/role.yaml Mirrors RBAC updates in the Helm chart role template.
config/deployments/xpum/xpum-reset-job.yaml Adds the reset Job YAML template used by the controller for reset actions.
config/deployments/deployments.go Embeds and exposes the reset Job template via XpuManagerResetJob().
config/deployments/deployments_test.go Adds basic template existence checks and validates resetter container requirements.
.trivyignore.yaml Extends ignore list to cover the new reset Job template where relevant.
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 2
  • 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_controller.go Outdated
Comment thread internal/controller/gpurecoveryplan_helpers.go Outdated
This adds the two phases that get it out — matching it against spec.approvals,
and running the reset Job the approval authorises.

Approvals come in two shapes. An eventId approval names one event; a
selector approval is standing policy, matched against the event's recovery
type, its node name and its node's labels.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
@pfl
pfl merged commit 7d54e2a into intel:main Sep 4, 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