Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuse: automatically use squashfuse for images, deprecate --sif-fuse #2451

Merged
merged 2 commits into from
Jan 2, 2024

Conversation

dtrudg
Copy link
Member

@dtrudg dtrudg commented Dec 18, 2023

Description of the Pull Request (PR):

Deprecate the explicit --sif-fuse flag and sif fuse directive for singularity.conf. These were previously used to enable experimental FUSE mount of SIF/SquashFS containers.

Modify image handling so that we now try squashfuse mounts automatically, with fall back to temporary sandbox extraction, when:

  • squashfs kernel mounts have been disabled in singularity.conf -or-
  • we are running in a non-setuid / user namespace flow.

Add a --tmp-sandbox flag to allow forcing extraction to a temporary sandbox when a kernel mount or FUSE mount would otherwise be used / attempted.

This change exposed an issue via the e2e tests - where there is a failure after the starter is called, but before the container is entered successfully, the host cleanup may not be called. To address this, added the commit...

fix: ensure host cleanup runs when parent exits

When a container doesn't exit cleanly, or fails to start correctly, then the master process won't write into the cleanup socket to initiate cleanup in the host namespaces.

Prior to this commit, this caused the host cleanup to exit with an EOF error, leaving FUSE mounts in place in host namespaces.

The host cleanup process has SIGTERM set as its parent death signal, so we can trap this to ensure that cleanup runs for an 'unclean' exit where the master doesn't initate cleanup via the socket.

This fixes or addresses the following GitHub issues:

Before submitting a PR, make sure you have done the following:

@dtrudg dtrudg added this to the SingularityCE 4.1.0 milestone Dec 18, 2023
@dtrudg dtrudg self-assigned this Dec 18, 2023
@dtrudg dtrudg force-pushed the issue-2216 branch 9 times, most recently from 55b9035 to ddc3466 Compare December 19, 2023 16:53
@dtrudg dtrudg force-pushed the issue-2216 branch 3 times, most recently from be0e29c to d4106e3 Compare January 2, 2024 13:58
dtrudg added 2 commits January 2, 2024 14:53
Deprecate the explicit `--sif-fuse` flag and `sif fuse` directive for
`singularity.conf`. These were previously used to enable experimental
FUSE mount of SIF/SquashFS containers.

Modify image handling so that we now try squashfuse mounts
automatically, with fall back to temporary sandbox extraction, when:

* squashfs kernel mounts have been disabled in `singularity.conf`
* we are running in a non-setuid / user namespace flow.

Add a `--tmp-sandbox` flag to allow forcing extraction to a temporary
sandbox when a kernel mount or FUSE mount would otherwise be used.

Fixes sylabs#2216
When a container doesn't exit cleanly, or fails to start correctly,
then the master process won't write into the cleanup socket to
initiate cleanup in the host namespaces.

Prior to this commit, this caused the host cleanup to exit with an EOF
error, leaving FUSE mounts in place in host namespaces.

The host cleanup process has SIGTERM set as its parent death signal,
so we can trap this to ensure that cleanup runs for an 'unclean' exit
where the master doesn't initate cleanup via the socket.
@dtrudg dtrudg marked this pull request as ready for review January 2, 2024 15:11
@dtrudg dtrudg requested review from wobito and tri-adam January 2, 2024 15:12
@dtrudg dtrudg merged commit 420887e into sylabs:main Jan 2, 2024
@dtrudg dtrudg deleted the issue-2216 branch January 2, 2024 15:34
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.

Use squashfuse in native mode when 'allow kernel squashfs = no'
2 participants