squashfuse - #172
Merged
Merged
Conversation
Adds a fuse-based alternative to the setuid kernel squashfs mount: a per-task rootless user-namespace sandbox (src/uenv/rootless.cpp) that mounts images via squashfuse's low-level API, namespace-join infrastructure (src/uenv/ns_join.*) so that only one task per node performs the mount and the rest join its namespaces, and a dedicated Slurm SPANK plugin path (src/slurm/plugin_fuse.cpp) selected at build time via the new `fuse`/`fuse_version` meson options. squashfs-mount now dispatches between the setuid/kernel and rootless/fuse implementations through a small setup/mount/exit hook seam. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
bcumming
reviewed
Aug 18, 2026
|
|
||
| #include "util/expected.h" | ||
|
|
||
| namespace uenv { |
Member
There was a problem hiding this comment.
These wrappers for openat and write would go into src/util.
However, they are used in one location (rootless.cpp), so you could define them in an anonymous namespace at the top of that file.
| #include <util/expected.h> | ||
|
|
||
| // timeout in seconds for waiting for join semaphore. | ||
| #define JOIN_TIMEOUT 30 |
Member
There was a problem hiding this comment.
use constexpr, e.g. consexpr int join_timeout=30;
| @@ -0,0 +1,179 @@ | |||
| #include "ns_join.h" | |||
Member
There was a problem hiding this comment.
The ns_join.* files could probably go into src/util and be in their own C++ namespace,
| namespace uenv { | ||
|
|
||
| /* Variables for coordinating join */ | ||
| struct join_t { |
Member
There was a problem hiding this comment.
This can probably be PIMPLed, so that the interface does not leak all the implementation (i.e. end users probably won't need the pointer to the semaphore)
| assert_line --partial "error: unable to create repository" | ||
| assert_line --partial "Permission denied" | ||
| # root ignores directory permissions, so skip this subtest when running as root | ||
| if [[ "$(id -u)" -ne 0 ]]; then |
Member
There was a problem hiding this comment.
Tests should not be run as root, so I think we can skip this.
do_sqfs_ll_mount hand-rolled a pipe()/fork()/read()/write() dance to let the parent block until the forked squashfuse daemon signals it has mounted. Pull that into a small, independently unit-tested class in src/util/, leaving the squashfuse-specific child body untouched. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
simonpintarelli
force-pushed
the
squashfuse-only
branch
from
August 18, 2026 21:10
9206274 to
bb6e4a6
Compare
simonpintarelli
force-pushed
the
squashfuse-only
branch
from
August 19, 2026 08:17
4435585 to
506a2d2
Compare
This reverts commit fc48b12.
…ter jobs - if any
daemon outlasts all processes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add rootless FUSE mounting backend with multi-task --join support
Adds -Dmount_backend=fuse as an unprivileged alternative to the setuid
kernel backend, using squashfuse in a user+mount namespace. Includes
uenv run/start --join, which lets multiple Slurm tasks on a node share
one mount via a leader-election rendezvous (src/util/proc_barrier.*).
Hardened via torture testing on Alps: mount lifetime is now owned by a
supervisor reaped with the Slurm step's cgroup rather than tied to an
arbitrary rank's command, followers keep their working directory across
setns(), and shared-memory/mutex teardown fails closed under fault
injection.