mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-05-31 18:48:28 +00:00
Add nvidia-container-runtime.modes.csv.default-kind config option
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
c59696e30e
commit
f00439c93e
@ -69,6 +69,9 @@ func TestGetConfig(t *testing.T) {
|
|||||||
CSV: csvModeConfig{
|
CSV: csvModeConfig{
|
||||||
MountSpecPath: "/etc/nvidia-container-runtime/host-files-for-container.d",
|
MountSpecPath: "/etc/nvidia-container-runtime/host-files-for-container.d",
|
||||||
},
|
},
|
||||||
|
CDI: cdiModeConfig{
|
||||||
|
DefaultKind: "nvidia.com/gpu",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
NVIDIACTKConfig: CTKConfig{
|
NVIDIACTKConfig: CTKConfig{
|
||||||
@ -86,6 +89,7 @@ func TestGetConfig(t *testing.T) {
|
|||||||
"nvidia-container-runtime.log-level = \"debug\"",
|
"nvidia-container-runtime.log-level = \"debug\"",
|
||||||
"nvidia-container-runtime.runtimes = [\"/some/runtime\",]",
|
"nvidia-container-runtime.runtimes = [\"/some/runtime\",]",
|
||||||
"nvidia-container-runtime.mode = \"not-auto\"",
|
"nvidia-container-runtime.mode = \"not-auto\"",
|
||||||
|
"nvidia-container-runtime.modes.cdi.default-kind = \"example.vendor.com/device\"",
|
||||||
"nvidia-container-runtime.modes.csv.mount-spec-path = \"/not/etc/nvidia-container-runtime/host-files-for-container.d\"",
|
"nvidia-container-runtime.modes.csv.mount-spec-path = \"/not/etc/nvidia-container-runtime/host-files-for-container.d\"",
|
||||||
"nvidia-ctk.path = \"/foo/bar/nvidia-ctk\"",
|
"nvidia-ctk.path = \"/foo/bar/nvidia-ctk\"",
|
||||||
},
|
},
|
||||||
@ -102,6 +106,9 @@ func TestGetConfig(t *testing.T) {
|
|||||||
CSV: csvModeConfig{
|
CSV: csvModeConfig{
|
||||||
MountSpecPath: "/not/etc/nvidia-container-runtime/host-files-for-container.d",
|
MountSpecPath: "/not/etc/nvidia-container-runtime/host-files-for-container.d",
|
||||||
},
|
},
|
||||||
|
CDI: cdiModeConfig{
|
||||||
|
DefaultKind: "example.vendor.com/device",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
NVIDIACTKConfig: CTKConfig{
|
NVIDIACTKConfig: CTKConfig{
|
||||||
@ -121,6 +128,8 @@ func TestGetConfig(t *testing.T) {
|
|||||||
"log-level = \"debug\"",
|
"log-level = \"debug\"",
|
||||||
"runtimes = [\"/some/runtime\",]",
|
"runtimes = [\"/some/runtime\",]",
|
||||||
"mode = \"not-auto\"",
|
"mode = \"not-auto\"",
|
||||||
|
"[nvidia-container-runtime.modes.cdi]",
|
||||||
|
"default-kind = \"example.vendor.com/device\"",
|
||||||
"[nvidia-container-runtime.modes.csv]",
|
"[nvidia-container-runtime.modes.csv]",
|
||||||
"mount-spec-path = \"/not/etc/nvidia-container-runtime/host-files-for-container.d\"",
|
"mount-spec-path = \"/not/etc/nvidia-container-runtime/host-files-for-container.d\"",
|
||||||
"[nvidia-ctk]",
|
"[nvidia-ctk]",
|
||||||
@ -139,6 +148,9 @@ func TestGetConfig(t *testing.T) {
|
|||||||
CSV: csvModeConfig{
|
CSV: csvModeConfig{
|
||||||
MountSpecPath: "/not/etc/nvidia-container-runtime/host-files-for-container.d",
|
MountSpecPath: "/not/etc/nvidia-container-runtime/host-files-for-container.d",
|
||||||
},
|
},
|
||||||
|
CDI: cdiModeConfig{
|
||||||
|
DefaultKind: "example.vendor.com/device",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
NVIDIACTKConfig: CTKConfig{
|
NVIDIACTKConfig: CTKConfig{
|
||||||
|
@ -50,6 +50,8 @@ type modesConfig struct {
|
|||||||
type cdiModeConfig struct {
|
type cdiModeConfig struct {
|
||||||
// SpecDirs allows for the default spec dirs for CDI to be overridden
|
// SpecDirs allows for the default spec dirs for CDI to be overridden
|
||||||
SpecDirs []string `toml:"spec-dirs"`
|
SpecDirs []string `toml:"spec-dirs"`
|
||||||
|
// DefaultKind sets the default kind to be used when constructing fully-qualified CDI device names
|
||||||
|
DefaultKind string `toml:"default-kind"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type csvModeConfig struct {
|
type csvModeConfig struct {
|
||||||
@ -94,6 +96,9 @@ func GetDefaultRuntimeConfig() *RuntimeConfig {
|
|||||||
CSV: csvModeConfig{
|
CSV: csvModeConfig{
|
||||||
MountSpecPath: "/etc/nvidia-container-runtime/host-files-for-container.d",
|
MountSpecPath: "/etc/nvidia-container-runtime/host-files-for-container.d",
|
||||||
},
|
},
|
||||||
|
CDI: cdiModeConfig{
|
||||||
|
DefaultKind: "nvidia.com/gpu",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user