提交 2f562d5a 编写于 作者: K Kurt Jensen 提交者: Felix Abecassis

Add support for the --no-cgroups argument of nvidia-container-cli

Closes: #25

[fabecassis@nvidia.com: squash commits, change title, add config files, go fmt]
Signed-off-by: NFelix Abecassis <fabecassis@nvidia.com>
上级 25bd7c49
......@@ -8,5 +8,6 @@ environment = []
#debug = "/var/log/nvidia-container-runtime-hook.log"
#ldcache = "/etc/ld.so.cache"
load-kmods = true
#no-cgroups = false
#user = "root:video"
ldconfig = "@/sbin/ldconfig"
......@@ -8,5 +8,6 @@ environment = []
#debug = "/var/log/nvidia-container-runtime-hook.log"
#ldcache = "/etc/ld.so.cache"
load-kmods = true
#no-cgroups = false
#user = "root:video"
ldconfig = "@/sbin/ldconfig"
......@@ -8,5 +8,6 @@ environment = []
#debug = "/var/log/nvidia-container-runtime-hook.log"
#ldcache = "/etc/ld.so.cache"
load-kmods = true
#no-cgroups = false
#user = "root:video"
ldconfig = "@/sbin/ldconfig"
......@@ -8,5 +8,6 @@ environment = []
#debug = "/var/log/nvidia-container-runtime-hook.log"
#ldcache = "/etc/ld.so.cache"
load-kmods = true
#no-cgroups = false
#user = "root:video"
ldconfig = "@/sbin/ldconfig.real"
......@@ -26,6 +26,7 @@ type CLIConfig struct {
Debug *string `toml:"debug"`
Ldcache *string `toml:"ldcache"`
LoadKmods bool `toml:"load-kmods"`
NoCgroups bool `toml:"no-cgroups"`
User *string `toml:"user"`
Ldconfig *string `toml:"ldconfig"`
}
......@@ -48,6 +49,7 @@ func getDefaultHookConfig() (config HookConfig) {
Debug: nil,
Ldcache: nil,
LoadKmods: true,
NoCgroups: false,
User: nil,
Ldconfig: nil,
},
......
......@@ -117,7 +117,9 @@ func doPrestart() {
if cli.Ldconfig != nil {
args = append(args, fmt.Sprintf("--ldconfig=%s", *cli.Ldconfig))
}
if cli.NoCgroups {
args = append(args, "--no-cgroups")
}
if len(nvidia.Devices) > 0 {
args = append(args, fmt.Sprintf("--device=%s", nvidia.Devices))
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册