Skip to content

Recovery: API and docs - #102

Open
tkatila wants to merge 2 commits into
intel:mainfrom
tkatila:recovery-api-docs
Open

Recovery: API and docs#102
tkatila wants to merge 2 commits into
intel:mainfrom
tkatila:recovery-api-docs

Conversation

@tkatila

@tkatila tkatila commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Includes also the fwupdate PR #101 content though it's not required for anything.

Please note, the main content in this PR is the gpurecoveryplan_types.go and RECOVERY.md. The CRD yamls and copy functions are generated.

ContentImageVerifier no longer speaks in API types nor knows anything about
firmware. Its single method is VerifyImage(ctx, ImageVerifyRequest), where the
request carries the image reference, pull secret, TLS setting and the expected
files as plain fields, so any caller can use the verifier without owning a
GPUFirmwareUpdate.

An empty Files list means "reachability only" and resolves the manifest with
remote.Head instead of pulling every layer and streaming the export.

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.

Pull request overview

This PR introduces the new GPU recovery API surface and documentation, and refactors firmware-update content image verification to use a generic request shape (aligning with the referenced fwupdate PR #101 direction).

Changes:

  • Add GPURecoveryPlan v1alpha1 API types, register them in the scheme, and include generated deepcopy + CRD manifests (plus Helm CRD sync).
  • Add recovery documentation (RECOVERY.md) and link it from README.md, plus add samples and RBAC helper roles.
  • Refactor ContentImageVerifier to a generic VerifyImage(ctx, ImageVerifyRequest) and update firmware-update controller/tests accordingly (including a reachability-only fast path).

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
RECOVERY.md Adds detailed recovery workflow documentation and usage guidance.
README.md Adds a “GPU recovery” section and links to RECOVERY.md.
PROJECT Registers the new GPURecoveryPlan API with kubebuilder project config.
Makefile Syncs the new recovery CRD into the Helm chart CRDs directory.
internal/controller/gpufirmwareupdate_controller.go Updates firmware content-image verification to use generic VerifyImage request.
internal/controller/gpufirmwareupdate_controller_test.go Updates tests for new verifier interface and request/file shapes.
internal/controller/contentimage_verifier.go Generalizes verifier interface/types and adds reachability-only verification path.
internal/controller/contentimage_verifier_test.go Adds a unit test for path normalization helper.
config/samples/recoveryplan/kustomization.yaml Adds kustomize sample scaffold for recovery plan.
config/samples/recoveryplan/gpurecoveryplan.yaml Provides a commented sample GPURecoveryPlan manifest.
config/rbac/kustomization.yaml Wires recovery plan admin/editor/viewer helper ClusterRoles into kustomization.
config/rbac/gpurecoveryplan_*_role.yaml Adds helper ClusterRoles for recovery plan RBAC.
config/crd/kustomization.yaml Includes the new recovery plan CRD base.
config/crd/bases/intel.com_gpurecoveryplans.yaml Generated GPURecoveryPlan CRD definition.
charts/gpu-base-operator/crds/gpurecoveryplans.yaml Helm chart CRD copy of the generated recovery plan CRD.
api/v1alpha1/zz_generated.deepcopy.go Generated deep-copies for new API types.
api/v1alpha1/groupversion_info.go Registers GPURecoveryPlan types in the scheme.
api/v1alpha1/gpurecoveryplan_types.go Defines the new GPURecoveryPlan API types and validation markers.
Files not reviewed (1)
  • api/v1alpha1/zz_generated.deepcopy.go: Generated file
Suppressed comments (1)

api/v1alpha1/gpurecoveryplan_types.go:279

  • GoldenFirmwareSource’s comment says "At least one of ContainerSource or VolumeSource must be set", but the docs (and the state machine) describe cases where goldenFirmware is absent/empty and the event should move to missing-goldenfw. The comment should reflect that empty is allowed (and VolumeSource is not supported yet).
// GoldenFirmwareSource describes where the firmware file is located.
// At least one of ContainerSource or VolumeSource must be set.
type GoldenFirmwareSource struct {

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

Comment thread api/v1alpha1/gpurecoveryplan_types.go
Comment thread RECOVERY.md
Comment thread README.md Outdated
@tkatila
tkatila force-pushed the recovery-api-docs branch from 6f89daf to dfaa651 Compare August 31, 2026 14:09
Introduce the cluster-scoped GPURecoveryPlan kind: a plan per GPU model, an
admin-approval model over the recovery events the operator reports, and the
reset/reflash types it can run.

This is the API surface only, so it can be reviewed before the implementation
lands. There is no controller, no webhook and no kubectl plugin here, and the
CRD is not yet reconciled by anything — RECOVERY.md describes the whole feature,
including the parts (metrics, the kubectl gpurecovery plugin) that arrive with
the implementation.

Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
@tkatila
tkatila force-pushed the recovery-api-docs branch from dfaa651 to 1dca0f7 Compare August 31, 2026 15:36
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.

2 participants