Skip to content

squashfuse - #172

Merged
bcumming merged 81 commits into
mainfrom
squashfuse-only
Sep 12, 2026
Merged

squashfuse#172
bcumming merged 81 commits into
mainfrom
squashfuse-only

Conversation

@simonpintarelli

@simonpintarelli simonpintarelli commented Aug 17, 2026

Copy link
Copy Markdown
Member

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.

simonpintarelli and others added 6 commits August 17, 2026 15:23
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>
Comment thread src/uenv/posix_io.h Outdated

#include "util/expected.h"

namespace uenv {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/uenv/ns_join.cpp Outdated
#include <util/expected.h>

// timeout in seconds for waiting for join semaphore.
#define JOIN_TIMEOUT 30

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use constexpr, e.g. consexpr int join_timeout=30;

Comment thread src/uenv/ns_join.cpp Outdated
@@ -0,0 +1,179 @@
#include "ns_join.h"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ns_join.* files could probably go into src/util and be in their own C++ namespace,

Comment thread src/uenv/ns_join.h Outdated
namespace uenv {

/* Variables for coordinating join */
struct join_t {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Comment thread test/integration/cli.bats Outdated
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests should not be run as root, so I think we can skip this.

simonpintarelli and others added 8 commits August 18, 2026 16:28
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>
@bcumming
bcumming merged commit 7f4ca24 into main Sep 12, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants