Skip to content

Add option to skip individual component validators (toolkit, cuda, plugin) - #2867

Open
udaykishore-resu wants to merge 1 commit into
NVIDIA:mainfrom
udaykishore-resu:feat/validator-skip-option
Open

Add option to skip individual component validators (toolkit, cuda, plugin)#2867
udaykishore-resu wants to merge 1 commit into
NVIDIA:mainfrom
udaykishore-resu:feat/validator-skip-option

Conversation

@udaykishore-resu

@udaykishore-resu udaykishore-resu commented Sep 5, 2026

Copy link
Copy Markdown

Description

Adds validator.toolkit.skip, validator.cuda.skip and validator.plugin.skip to the ClusterPolicy (and matching Helm values). When set, the operator passes SKIP_VALIDATION=true to the corresponding init container of the nvidia-operator-validator DaemonSet, and the nvidia-validator binary only writes the component readiness status file (toolkit-ready / cuda-ready / plugin-ready) instead of running the validation.

The init containers are deliberately kept rather than removed: toolkit-ready gates the device-plugin, GFD, DCGM exporter, MIG manager and MPS control daemon init containers, and node-status-exporter watches all of the status files. Skipping driver is intentionally not supported because driver-ready carries the driver-root contract consumed by other operands.

Motivation: on GKE (COS) the toolkit and device plugin are preinstalled (toolkit.enabled=false, devicePlugin.enabled=false), but toolkit-validation still fails because GKE only injects nvidia-smi into containers that request nvidia.com/gpu, while the validator relies on NVIDIA_VISIBLE_DEVICES=all.

Usage:

validator:
  toolkit:
    skip: true

Fixes #1460

Checklist

  • No secrets, sensitive information, or unrelated changes
  • Lint checks passing (make lint)
  • Generated assets in-sync (make validate-generated-assets)
  • Go mod artifacts in-sync (make validate-modules)
  • Test cases are added for new code paths

Testing

  • New unit tests: 5 cases in TestTransformValidatorComponent and a GKE-shaped end-to-end case in TestTransformValidator (controllers/transforms_test.go); TestSkipComponentValidation in cmd/nvidia-validator/main_test.go.
  • go test ./controllers/... ./api/... ./cmd/nvidia-validator/... ./internal/... passes; make lint, make generate manifests produce no diff.
  • Not yet exercised on a live GKE cluster — feedback from anyone running COS with the preinstalled toolkit would be welcome.

Add a 'skip' option to the toolkit, cuda and plugin validator specs of
the ClusterPolicy (validator.toolkit.skip, validator.cuda.skip,
validator.plugin.skip). When set, the operator passes
SKIP_VALIDATION=true to the corresponding init container of the
nvidia-operator-validator DaemonSet and the nvidia-validator binary only
creates the component readiness status file instead of running the
validation.

The init containers are intentionally kept rather than removed, because
other operands (device-plugin, gpu-feature-discovery, dcgm-exporter,
mig-manager, mps-control-daemon) block on the 'toolkit-ready' status
file and the node-status-exporter metrics report on all status files.

This is needed e.g. on GKE with COS, where the container toolkit and the
device plugin are preinstalled (toolkit.enabled=false,
devicePlugin.enabled=false) but the toolkit-validation init container
still fails, since GKE only injects nvidia-smi into containers that
request an nvidia.com/gpu resource.

Related to NVIDIA/gpu-operator issue 1460

Signed-off-by: Uday Kishore Resu <udaykishoresu2@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds optional skip settings for plugin, toolkit, and CUDA validators. Helm values and templates expose these settings. The controller passes SKIP_VALIDATION=true to skipped validators. The validator bypasses supported validation and recreates readiness status files. Unsupported components return errors. Tests cover configuration transformation and status-file behavior.

Merge Risk: 🟠 High · up to f8308

The new skip configuration may be discarded by installed CRDs or overridden at runtime, making validation run despite the requested setting. These issues should be fixed before merge.


Comment @coderabbitai help to get the list of available commands.

@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.

Actionable comments posted: 1

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (2)
controllers/object_controls.go-2462-2462 (1)

2462-2462: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Reserve SKIP_VALIDATION after component environment processing.

A component Env entry named SKIP_VALIDATION is applied after the skip setting and replaces "true". For example, skip: true plus env: [{name: SKIP_VALIDATION, value: "false"}] runs validation instead of skipping it. Apply the reserved variable after user Env entries, or reject that Env name.

  • controllers/object_controls.go#L2462-L2462: Set the CUDA skip variable after CUDA Env processing.
  • controllers/object_controls.go#L2491-L2491: Set the plugin skip variable after plugin Env processing.
  • controllers/object_controls.go#L2517-L2517: Set the toolkit skip variable after toolkit Env processing.
cmd/nvidia-validator/main_test.go-370-380 (1)

370-380: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Test the skip behavior through validateComponent.

This test calls skipComponentValidation directly. It passes if validateComponent no longer dispatches when skipValidationFlag is true. It also derives expected filenames from implementation constants.

Set skipValidationFlag in the test, call validateComponent, and assert the fixed toolkit-ready, cuda-ready, and plugin-ready filenames. This prevents regressions that run validation or break dependent readiness-file consumers.

As per path instructions, flag tests that mirror the implementation instead of checking behavior.

Source: Path instructions


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Enterprise

Run ID: d584c8db-fcc4-41d4-a5fc-d30256c75d6e

📥 Commits

Reviewing files that changed from the base of the PR and between 08c40bc and f830833.

⛔ Files ignored due to path filters (4)
  • api/nvidia/v1/zz_generated.deepcopy.go is excluded by !**/zz_generated.*.go
  • bundle/manifests/nvidia.com_clusterpolicies.yaml is excluded by !bundle/manifests/nvidia.com_*.yaml
  • config/crd/bases/nvidia.com_clusterpolicies.yaml is excluded by !config/crd/bases/**
  • deployments/gpu-operator/crds/nvidia.com_clusterpolicies.yaml is excluded by !deployments/gpu-operator/crds/**
📒 Files selected for processing (7)
  • api/nvidia/v1/clusterpolicy_types.go
  • cmd/nvidia-validator/main.go
  • cmd/nvidia-validator/main_test.go
  • controllers/object_controls.go
  • controllers/transforms_test.go
  • deployments/gpu-operator/templates/clusterpolicy.yaml
  • deployments/gpu-operator/values.yaml

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.

// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Skip NVIDIA Device Plugin validation"
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
Skip *bool `json:"skip,omitempty"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Regenerate the CRD and deepcopy assets.

The supplied change adds three CRD fields but does not update generated assets. A cluster with the existing CRD schema will not persist these skip values, so the controller will not receive the requested configuration. Regenerate and commit the CRD, CSV, and deepcopy outputs.

As per path instructions, “Editing these types requires regenerating the deepcopy and CRD assets.”

Also applies to: 459-459, 486-486

Source: Path instructions

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.

[Feature Request] Option to skip specific validators

1 participant