-
Notifications
You must be signed in to change notification settings - Fork 313
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
Add DRA driver for IMEX #1143
base: main
Are you sure you want to change the base?
Add DRA driver for IMEX #1143
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ type ClusterPolicySpec struct { | |
// DevicePlugin component spec | ||
DevicePlugin DevicePluginSpec `json:"devicePlugin"` | ||
// DRADriver component spec | ||
DRADriver DRADriverSpec `json:"draDriver"` | ||
IMEXDRADriver IMEXDRADriverSpec `json:"imexDRADriver"` | ||
// DCGMExporter spec | ||
DCGMExporter DCGMExporterSpec `json:"dcgmExporter"` | ||
// DCGM component spec | ||
|
@@ -843,24 +843,24 @@ type SandboxDevicePluginSpec struct { | |
Env []EnvVar `json:"env,omitempty"` | ||
} | ||
|
||
// DRADriverSpec defines the properties for the NVIDIA DRA Driver deployment | ||
// IMEXDRADriverSpec defines the properties for the NVIDIA IMEX DRA Driver deployment | ||
// TODO: add 'controller' and 'kubeletPlugin' structs to allow for per-component configuration | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One question: Should we expose There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe we should at this point in time. But I can see where having the ability to control the |
||
type DRADriverSpec struct { | ||
// Enabled indicates if the deployment of NVIDIA DRA Driver through the operator is enabled | ||
type IMEXDRADriverSpec struct { | ||
// Enabled indicates if the deployment of NVIDIA IMEX DRA Driver through the operator is enabled | ||
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true | ||
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable NVIDIA DRA Driver deployment through GPU Operator" | ||
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable NVIDIA IMEX DRA Driver deployment through GPU Operator" | ||
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch" | ||
Enabled *bool `json:"enabled,omitempty"` | ||
|
||
// NVIDIA DRA Driver image repository | ||
// NVIDIA IMEX DRA Driver image repository | ||
// +kubebuilder:validation:Optional | ||
Repository string `json:"repository,omitempty"` | ||
|
||
// NVIDIA DRA Driver image name | ||
// NVIDIA IMEX DRA Driver image name | ||
// +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+ | ||
Image string `json:"image,omitempty"` | ||
|
||
// NVIDIA DRA Driver image tag | ||
// NVIDIA IMEX DRA Driver image tag | ||
// +kubebuilder:validation:Optional | ||
Version string `json:"version,omitempty"` | ||
|
||
|
@@ -1820,9 +1820,9 @@ func ImagePath(spec interface{}) (string, error) { | |
case *SandboxDevicePluginSpec: | ||
config := spec.(*SandboxDevicePluginSpec) | ||
return imagePath(config.Repository, config.Image, config.Version, "SANDBOX_DEVICE_PLUGIN_IMAGE") | ||
case *DRADriverSpec: | ||
config := spec.(*DRADriverSpec) | ||
return imagePath(config.Repository, config.Image, config.Version, "DRA_DRIVER_IMAGE") | ||
case *IMEXDRADriverSpec: | ||
config := spec.(*IMEXDRADriverSpec) | ||
return imagePath(config.Repository, config.Image, config.Version, "IMEX_DRA_DRIVER_IMAGE") | ||
case *DCGMExporterSpec: | ||
config := spec.(*DCGMExporterSpec) | ||
return imagePath(config.Repository, config.Image, config.Version, "DCGM_EXPORTER_IMAGE") | ||
|
@@ -1931,8 +1931,8 @@ func (p *DevicePluginSpec) IsEnabled() bool { | |
return *p.Enabled | ||
} | ||
|
||
// IsEnabled returns true if draDriver is enabled through gpu-operator | ||
func (d *DRADriverSpec) IsEnabled() bool { | ||
// IsEnabled returns true if IMEX DRA Driver is enabled through gpu-operator | ||
func (d *IMEXDRADriverSpec) IsEnabled() bool { | ||
if d.Enabled == nil { | ||
// default is true if not specified by user | ||
return true | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: nvidia-dra-driver | ||
name: nvidia-imex-dra-driver | ||
namespace: "FILLED BY THE OPERATOR" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: nvidia-dra-driver | ||
name: nvidia-imex-dra-driver | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: nvidia-dra-driver | ||
name: nvidia-imex-dra-driver | ||
subjects: | ||
- kind: ServiceAccount | ||
name: nvidia-dra-driver | ||
name: nvidia-imex-dra-driver | ||
namespace: "FILLED BY THE OPERATOR" |
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.
This approach seems better.