Skip to content

Use sandbox mode which is more robust in singularity cleanup phase#193

Merged
bedroge merged 20 commits intoEESSI:mainfrom
julianmorillo:build-sandbox
Apr 16, 2026
Merged

Use sandbox mode which is more robust in singularity cleanup phase#193
bedroge merged 20 commits intoEESSI:mainfrom
julianmorillo:build-sandbox

Conversation

@julianmorillo
Copy link
Copy Markdown
Contributor

No description provided.

@boegel
Copy link
Copy Markdown
Contributor

boegel commented Mar 30, 2026

@julianmorillo Is there any documentation that would explain why this works better?

No strong objections as long as it works, I just don't see why this would work better (though it seems to based on EESSI/dev.eessi.io-riscv#35 (comment))

@trz42
Copy link
Copy Markdown
Contributor

trz42 commented Mar 31, 2026

Could we use this optionally? It's been tested on RISC-V, but we haven't seen this on other systems. So, to not cause problems on the other systems, maybe the safest way forward would be to add an option and use that where needed.

@julianmorillo
Copy link
Copy Markdown
Contributor Author

julianmorillo commented Mar 31, 2026

@boegel
SingularityCE User Guide (runtime behavior changes)
SingularityCE 4.1 Admin/User notes (FUSE + sandbox fallback)

The critical mechanism here (from the documentation above) is that SIF images require mounting (via FUSE). In the documentation above it can be read: "SIF/SquashFS container images will now be mounted with squashfuse… when kernel mounts are not available."
In an unprivileged HPC environment this becomes:

The documentation above also explains that if mounting fails or is unsuitable --> Singularity uses a sandbox: “If the FUSE mount fails, Singularity will fall back to extracting the container to a temporary sandbox.” and “fallback to extraction to a temporary sandbox directory”.
The key insight is that:

  • Sandbox = extracted directory
  • No mount needed
  • No FUSE
  • No teardown/cleanup complexity

@bedroge
Copy link
Copy Markdown
Contributor

bedroge commented Mar 31, 2026

Could we use this optionally? It's been tested on RISC-V, but we haven't seen this on other systems. So, to not cause problems on the other systems, maybe the safest way forward would be to add an option and use that where needed.

This makes sense to me. The sandbox mode is probably (much) slower, especially when multiple jobs are extracting that image to a shared filesystem at the same time.

@julianmorillo
Copy link
Copy Markdown
Contributor Author

Could we use this optionally? It's been tested on RISC-V, but we haven't seen this on other systems. So, to not cause problems on the other systems, maybe the safest way forward would be to add an option and use that where needed.

This makes sense to me. The sandbox mode is probably (much) slower, especially when multiple jobs are extracting that image to a shared filesystem at the same time.

I already made it optional through an environment variable that should be defined in site_config.sh. Would that work?

@julianmorillo
Copy link
Copy Markdown
Contributor Author

julianmorillo commented Apr 10, 2026

Tested successfully in EESSI/dev.eessi.io-riscv#103, and EESSI/dev.eessi.io-riscv#105

Copy link
Copy Markdown
Contributor

@bedroge bedroge left a comment

Choose a reason for hiding this comment

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

Could you move the eb_hooks.py changes to a separate PR, as they are unrelated?

The sandbox stuff looks good to me, though it would be good to also add an option to the script itself, as most of these things have a corresponding option. -s is already taken for --save, so we need another one (-z? or only use a long option --sandbox?)

@julianmorillo
Copy link
Copy Markdown
Contributor Author

Implemented all the suggested changes. I took the option of just using the long --sandbox option.

Copy link
Copy Markdown
Contributor

@bedroge bedroge left a comment

Choose a reason for hiding this comment

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

Tested it, and works fine. Some final nitpicks and then we can merge this.

Comment thread eessi_container.sh Outdated
Comment thread eessi_container.sh Outdated
Comment thread eessi_container.sh Outdated
Copy link
Copy Markdown
Contributor

@bedroge bedroge left a comment

Choose a reason for hiding this comment

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

Lgtm, thanks @julianmorillo!

@bedroge bedroge merged commit 0aaadf7 into EESSI:main Apr 16, 2026
69 checks passed
@julianmorillo julianmorillo deleted the build-sandbox branch April 16, 2026 14:42
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.

4 participants