Locate persistenced and fabricmanager sockets at /run instead of /var/run

This chagne prefers (non-symlink) sockets at /run over /var/run for
nvidia-persistenced and nvidia-fabricmanager sockets.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2023-03-16 15:30:43 +02:00
parent 7000c6074e
commit df40fbe03e
2 changed files with 24 additions and 4 deletions

View File

@ -2,6 +2,8 @@
## v1.13.0-rc.3 ## v1.13.0-rc.3
* Prefer /run over /var/run when locating nvidia-persistenced and nvidia-fabricmanager sockets.
## v1.13.0-rc.2 ## v1.13.0-rc.2
* Don't fail chmod hook if paths are not injected * Don't fail chmod hook if paths are not injected

View File

@ -25,21 +25,39 @@ type ipcMounts mounts
// NewIPCDiscoverer creats a discoverer for NVIDIA IPC sockets. // NewIPCDiscoverer creats a discoverer for NVIDIA IPC sockets.
func NewIPCDiscoverer(logger *logrus.Logger, driverRoot string) (Discover, error) { func NewIPCDiscoverer(logger *logrus.Logger, driverRoot string) (Discover, error) {
d := newMounts( sockets := newMounts(
logger, logger,
lookup.NewFileLocator( lookup.NewFileLocator(
lookup.WithLogger(logger), lookup.WithLogger(logger),
lookup.WithRoot(driverRoot), lookup.WithRoot(driverRoot),
lookup.WithSearchPaths("/run", "/var/run"),
lookup.WithCount(1),
),
driverRoot,
[]string{
"/nvidia-persistenced/socket",
"/nvidia-fabricmanager/socket",
},
)
mps := newMounts(
logger,
lookup.NewFileLocator(
lookup.WithLogger(logger),
lookup.WithRoot(driverRoot),
lookup.WithCount(1),
), ),
driverRoot, driverRoot,
[]string{ []string{
"/var/run/nvidia-persistenced/socket",
"/var/run/nvidia-fabricmanager/socket",
"/tmp/nvidia-mps", "/tmp/nvidia-mps",
}, },
) )
return (*ipcMounts)(d), nil d := Merge(
(*ipcMounts)(sockets),
(*ipcMounts)(mps),
)
return d, nil
} }
// Mounts returns the discovered mounts with "noexec" added to the mount options. // Mounts returns the discovered mounts with "noexec" added to the mount options.