-
Notifications
You must be signed in to change notification settings - Fork 427
Allow IMEX channel requests by volume mount #740
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
Conversation
47ebbe5 to
bac3e25
Compare
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.
Minor comments, otherwise looks good
bac3e25 to
b05b68c
Compare
Signed-off-by: Evan Lezar <[email protected]>
Signed-off-by: Evan Lezar <[email protected]>
This change allows IMEX channels to be requested using the
volume mount mechanism.
A mount from /dev/null to /var/run/nvidia-container-devices/imex/{{ .ChannelID }}
is equivalent to including {{ .ChannelID }} in the NVIDIA_IMEX_CHANNELS
envvironment variables.
Signed-off-by: Evan Lezar <[email protected]>
b05b68c to
2e6712d
Compare
| if len(nvidia.Devices) > 0 { | ||
| args = append(args, fmt.Sprintf("--device=%s", nvidia.Devices)) | ||
| if devicesString := strings.Join(nvidia.Devices, ","); len(devicesString) > 0 { | ||
| args = append(args, fmt.Sprintf("--device=%s", devicesString)) | ||
| } | ||
| if len(nvidia.MigConfigDevices) > 0 { | ||
| args = append(args, fmt.Sprintf("--mig-config=%s", nvidia.MigConfigDevices)) | ||
| } | ||
| if len(nvidia.MigMonitorDevices) > 0 { | ||
| args = append(args, fmt.Sprintf("--mig-monitor=%s", nvidia.MigMonitorDevices)) | ||
| } | ||
| if len(nvidia.ImexChannels) > 0 { | ||
| args = append(args, fmt.Sprintf("--imex-channel=%s", nvidia.ImexChannels)) | ||
| if imexString := strings.Join(nvidia.ImexChannels, ","); len(imexString) > 0 { | ||
| args = append(args, fmt.Sprintf("--imex-channel=%s", imexString)) |
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.
Minor comment -- not worth fixing in this PR -- but it would be nice to keep all of these consistent -- MigConfigDevices and MigMonitorDevices are still just strings rather than a list it looks like...
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.
Yes. I will update in a follow-up.
This allows IMEX channels to be requested as volume mounts in addition to the
NVIDIA_IMEX_CHANNELSenvironment variable.See NVIDIA/k8s-device-plugin#985 where this is used in the NVIDIA Device Plugin when the
deviceListStrategyis set tovolume-mounts.