NVIDIA / aistore

AIStore: scalable storage for AI applications
https://aistore.nvidia.com
MIT License
1.23k stars 164 forks source link

dutils_linux.go uses lsblk to get host device information #98

Closed tmbdev closed 2 years ago

tmbdev commented 2 years ago

Using lsblk to get host device information is not supported in all environments because it leaks host information into the container. It happens to work under docker right now, but it doesn't work in podman (an improved drop-in replacement for Docker) and other container runtimes.

$ podman run -p 51080:51080 -v /shared/aistore:/ais/disk0 aistore/cluster-minimal:latest
E 06:28:40.198737 dutils_linux.go:80 No disks for /dev/sda1("sda1"):
[]
E 06:28:40.198996 vinit.go:42 FATAL ERROR: t[xbWPpOjy]: mp[/ais/disk0, fs=/dev/sda1] has no disks
FATAL ERROR: t[xbWPpOjy]: mp[/ais/disk0, fs=/dev/sda1] has no disks
$

(A workaround for podman is to add --security-opt unmask=/sys/dev/block, but not all runtimes or environments may allow that.)