sylabs / singularity

SingularityCE is the Community Edition of Singularity, an open source container platform designed to be simple, fast, and secure.
https://sylabs.io/docs/
Other
774 stars 98 forks source link

Support `--sif-fuse` with `--overlay` in conjunction with kernel unprivileged overlay support. #1210

Open dtrudg opened 1 year ago

dtrudg commented 1 year ago

In order to allow unprivileged overlay from images, following the pattern where --sif-fuse performs mounts prior to the invocation of the singularity runtime, we need to:

Unfortunately, I think that we are blocked until https://github.com/tytso/e2fsprogs/pull/124 is addressed. I was hoping this would have been reviewed / merged, but looks like we'll have to wait longer.

fuse2fs doesn't currently support mounting from an offset in a file, so we can't fuse mount an ext partition out of a SIF. Most overlays would be ext. A squashfs read-only overlay would be a rare thing. I doubt that supporting only that is really worthwile?

Apptainer has a workaround for this blocker via an LD_PRELOAD - https://github.com/apptainer/apptainer/blob/main/tools/offsetpreload.c

I'm not particularly keen to build, bundle, and use an LD_PRELOAD here. Perhaps we'd consider it if it doesn't look like an offset patch will be merged, or we don't find an alternative?

We are still introducing the ability to use a directory overlay unprivileged in 3.11 - as long as the host kernel supports unprivileged overlay (we are not enabling fuse-overlayfs).

dtrudg commented 1 year ago

Offset support is in upstream fuse2fs but hasn't become available widely in distributions we need to target. Re-assess for 4.1.