feat(driver): support multiple installation sources (package, runfile, git)#636
Conversation
…, git) Extend NVIDIADriver to install from CUDA packages (default), .run files, or by building open-gpu-kernel-modules from source. Follows the existing CTK/Kubernetes multi-source pattern with full backward compatibility. Closes: NVIDIA#567 (Phase 1 — driver sources) Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Pull Request Test Coverage Report for Build 21915250119Details
💛 - Coveralls |
There was a problem hiding this comment.
Pull request overview
This PR extends the NVIDIA driver installation to support three sources: package (default, via CUDA repositories), runfile (direct .run file installation), and git (building from open-gpu-kernel-modules). The implementation follows the established multi-source pattern used for Container Toolkit and Kubernetes components, ensuring full backward compatibility with legacy Branch/Version fields.
Changes:
- Added new API types (DriverSource enum, DriverPackageSpec, DriverRunfileSpec, DriverGitSpec) with validation logic
- Implemented three installation templates (package, runfile, git) with GPU detection, idempotency, and provenance tracking
- Integrated git ref resolution in dependency.go for git-based installations
- Added comprehensive unit tests covering all source types and edge cases
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| api/holodeck/v1alpha1/types.go | Adds new driver source types and specs; maintains backward compatibility with deprecated Branch/Version fields |
| api/holodeck/v1alpha1/validation.go | Implements NVIDIADriver.Validate() with checks for all three source types |
| api/holodeck/v1alpha1/validation_test.go | Adds 15 comprehensive test cases covering all source configurations and error conditions |
| pkg/provisioner/templates/nv-driver.go | Refactors NewNvDriver to return error; adds three templates (package, runfile, git) with provenance tracking |
| pkg/provisioner/templates/nv-driver_test.go | Adds 17 unit tests for constructor and Execute methods across all sources; updates license header |
| pkg/provisioner/dependency.go | Integrates git ref resolution with 35-second timeout for git source installations |
| // +optional | ||
| // +optional |
There was a problem hiding this comment.
Duplicate kubebuilder marker: The '+optional' annotation appears twice on consecutive lines. Only one marker is needed per field.
| // +optional | ||
| // +optional |
There was a problem hiding this comment.
Duplicate kubebuilder marker: The '+optional' annotation appears twice on consecutive lines. Only one marker is needed per field.
| // +optional | ||
| // +optional |
There was a problem hiding this comment.
Duplicate kubebuilder marker: The '+optional' annotation appears twice on consecutive lines. Only one marker is needed per field.
| // +optional | ||
| // +optional |
There was a problem hiding this comment.
Duplicate kubebuilder marker: The '+optional' annotation appears twice on consecutive lines. Only one marker is needed per field.
| // +optional | ||
| // +optional |
There was a problem hiding this comment.
Duplicate kubebuilder marker: The '+optional' annotation appears twice on consecutive lines. Only one marker is needed per field.
| // +optional | ||
| // +optional |
There was a problem hiding this comment.
Duplicate kubebuilder marker: The '+optional' annotation appears twice on consecutive lines. Only one marker is needed per field.
| // +optional | ||
| // +optional |
There was a problem hiding this comment.
Duplicate kubebuilder marker: The '+optional' annotation appears twice on consecutive lines. Only one marker is needed per field.
| // +optional | ||
| // +optional |
There was a problem hiding this comment.
Duplicate kubebuilder marker: The '+optional' annotation appears twice on consecutive lines. Only one marker is needed per field.
| // +optional | ||
| // +optional |
There was a problem hiding this comment.
Duplicate kubebuilder marker: The '+optional' annotation appears twice on consecutive lines. Only one marker is needed per field.
| // +optional | ||
| // +optional |
There was a problem hiding this comment.
Duplicate kubebuilder marker: The '+optional' annotation appears twice on consecutive lines. Only one marker is needed per field.
Summary
NVIDIADriverto install from CUDA packages (default),.runfiles, or by buildingopen-gpu-kernel-modulesfrom sourceContext
Part of #567 (Phase 1 — Driver Sources). Depends on #635 (provenance) for
BuildComponentsStatusto be fully aware of multi-source fields, but can be merged independently.New API Types
DriverSourceenum:package,runfile,gitDriverPackageSpec— branch + version pinningDriverRunfileSpec— URL + SHA256 checksumDriverGitSpec— repo + ref (defaults toopen-gpu-kernel-modules)Templates
--silent --dkmsinstallmake modules,modules_install,depmodWiring
dependency.go: git ref resolution viagitref.NewGitHubResolver()Test plan
go build ./...passesgo vet ./...passes