-
Notifications
You must be signed in to change notification settings - Fork 7
Feature: Allow selecting NVIDIA Container Toolkit by git ref (or latest) for Holodeck installs #475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@ArangoGutierrez 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
…git/latest) Co-authored-by: ArangoGutierrez <[email protected]>
… feature Co-authored-by: ArangoGutierrez <[email protected]>
There was a problem hiding this comment.
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 adds support for multiple installation sources for the NVIDIA Container Toolkit in Holodeck, enabling users to install from package repositories, git repositories, or track the latest commits from a branch. This provides flexibility for users who need specific versions, development builds, or bleeding-edge features.
Key changes:
- Extended API types to support package, git, and latest installation sources with comprehensive configuration options
- Updated container toolkit template to conditionally handle different installation methods with provenance tracking
- Maintained full backward compatibility with existing version-based configurations
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
api/holodeck/v1alpha1/types.go |
Adds new API structs for source selection (NCTSource, NCTPackageConfig, NCTGitConfig, NCTLatestConfig, NCTBuildConfig) |
api/holodeck/v1alpha1/zz_generated.deepcopy.go |
Auto-generated deep copy methods for new API types |
pkg/provisioner/templates/container-toolkit.go |
Updates template struct and constructor to handle multiple installation sources with default fallbacks |
pkg/provisioner/templates/container-toolkit_test.go |
Comprehensive test suite covering all source types, backward compatibility, and template execution |
examples/nct-sources/*.yaml |
Example configurations demonstrating each source type and backward compatibility |
examples/nct-sources/README.md |
Documentation explaining the new source options and usage patterns |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ | ||
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ | ||
&& curl -s -L https://nvidia.github.io/libnvidia-container/{{.PackageChannel}}/deb/nvidia-container-toolkit.list | \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template uses unescaped variables in shell commands which could allow command injection if user input contains shell metacharacters. Consider validating or escaping the PackageChannel, GitRepo, GitRef, and other user-controlled variables before template execution.
Copilot uses AI. Check for mistakes.
# Set up Go path and version | ||
export PATH=/usr/lib/go-1.21/bin:$PATH | ||
export GOPATH=/tmp/go | ||
export GOROOT=/usr/lib/go-1.21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Go version is hardcoded as 1.21 in multiple places. Consider defining this as a constant or configuration parameter to make it easier to update across the codebase.
export GOROOT=/usr/lib/go-1.21 | |
sudo apt-get update && sudo apt-get install -y git build-essential golang-{{.GoVersion}} | |
# Set up Go path and version | |
export PATH=/usr/lib/go-{{.GoVersion}}/bin:$PATH | |
export GOPATH=/tmp/go | |
export GOROOT=/usr/lib/go-{{.GoVersion}} |
Copilot uses AI. Check for mistakes.
git checkout {{.GitRef}} | ||
|
||
# Set up build environment | ||
{{range $key, $value := .GitExtraEnv}}export {{$key}}="{{$value}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Environment variable names and values from user input are directly injected into shell commands without validation. This could allow command injection through malicious environment variable names or values containing shell metacharacters.
{{range $key, $value := .GitExtraEnv}}export {{$key}}="{{$value}}" | |
{{range $key, $value := .GitExtraEnv}}export {{safeEnvKey $key}}={{shellEscape $value}} |
Copilot uses AI. Check for mistakes.
This PR implements the ability to provision Holodeck environments with NVIDIA Container Toolkit (NCT) installed from multiple sources: distro packages (current behavior), specific git refs, or latest commits from tracked branches.
Problem
Previously, Holodeck could only install NCT from distro packages, which blocked:
Solution
Extended the
spec.nvidiaContainerToolkit
configuration with a newsource
field supporting three installation methods:Package Source (Default)
Git Source
Latest Source
Key Features
version
andenableCDI
fields continue to work unchanged/etc/nvidia-container-toolkit/PROVENANCE.json
with build metadataImplementation Details
api/holodeck/v1alpha1/types.go
with new source configuration structsTesting
All existing tests continue to pass, ensuring no regressions. New tests cover:
Fixes #462.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.