Build development environments from a Dockerfile on Docker, Kubernetes, and OpenShift. Enable developers to modify their development environment quickly.
Apache License 2.0
111
stars
23
forks
source link
fix(remount): relocate libraries along with their symlinks #255
Look up the library directory, the value differs for Debian-based distros (the initial envbuilder image is non-Debian, but the final image may be Debian)
Find the symlinks pointing to mounts in the library directory
Temporarily move the library symlinks pointing to mounts to the magic directory while relocating the mounts
Look up the new library directory (in case it has changed)
Move back the library symlinks and mounts to the new library directory
After that the container should behave like a regular container created by the NVIDIA container runtime. Of course/unfortunately, the process of mounting/unmounting requires GPU containers to run with privileges:
Appropriate privilege (Linux: the CAP_SYS_ADMIN capability) is required to mount/umount filesystems.
This PR adds:
After that the container should behave like a regular container created by the NVIDIA container runtime. Of course/unfortunately, the process of mounting/unmounting requires GPU containers to run with privileges:
https://www.man7.org/linux/man-pages/man2/mount.2.html https://www.man7.org/linux/man-pages/man2/umount.2.html
The logic is not generalized to any symlinks or any directories, it only aims at providing compatibility with the NVIDIA container runtime for now.
More context can be found in this comment https://github.com/coder/envbuilder/issues/143#issuecomment-2192405828
Tested with the following images:
docker.io/library/debian:bookworm
docker.io/library/fedora:40
nvcr.io/nvidia/pytorch:24.05-py3
Closes #143