Install Singularity & Apptainer SUID-free; bump to latest#180
Open
kennedydane wants to merge 5 commits into
Open
Install Singularity & Apptainer SUID-free; bump to latest#180kennedydane wants to merge 5 commits into
kennedydane wants to merge 5 commits into
Conversation
Reconfigure both container runtimes so containers run via unprivileged user namespaces instead of the setuid-root starter binary, and install them without any sudo: - Build with mconfig --without-suid (drop --with-suid for apptainer). - Point --localstatedir/--sysconfdir under the per-version install prefix so make install writes only to the user-writable /software tree; remove become: true from the go-based installs. - Bound singularity's --without-conmon to < 4.3 (removed in 4.3.0); keep --without-seccomp. - Stop managing singularity.conf/apptainer.conf here (config lives elsewhere); emit a debug reminder to set 'allow setuid = no' there. Pin to the latest releases and comment out older versions for reference: SingularityCE 4.4.1, Apptainer 1.5.0, plus Go 1.25.10 (both runtimes require Go >= 1.25.7). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reconfigures SingularityCE and Apptainer builds/installs to be SUID-free (rootless runtime) and install entirely into the user-writable /software prefix (no become: true), while also bumping both runtimes (and Go) to newer versions.
Changes:
- Build SingularityCE/Apptainer with
mconfig --without-suidand install state/config directories under the per-version install prefix (--localstatedir/--sysconfdir). - Remove root-owned
apptainer.confdeployment from this role and replace it with operator reminders to enforceallow setuid = noin externally managed config. - Bump versions in the compiled role to SingularityCE 4.4.1, Apptainer 1.5.0, and Go 1.25.10; comment older versions as reference.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| ansible/roles/compiled/templates/common/apptainer.conf | Sets allow setuid = no and disables setuid squashfs mounting in the (now orphaned) template. |
| ansible/roles/compiled/tasks/common/singularity.yaml | Updates mconfig flags/paths for SUID-free install and removes privileged install step; adds operator reminder. |
| ansible/roles/compiled/tasks/common/main.yml | Bumps runtime and Go versions; narrows installs to latest versions while retaining older entries as comments. |
| ansible/roles/compiled/tasks/common/apptainer.yaml | Switches to --without-suid, installs fully unprivileged, removes config templating, and adds operator reminder. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Note in apptainer.conf that it is retained for reference only and no longer deployed (config managed elsewhere). - Point the apptainer/singularity setuid reminders at the full config file path instead of just the sysconfdir root. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Addressed the Copilot review feedback in 8c6b9f9:
|
The 'Ensure installation parent exists' tasks used mode o=rwx,g=rx,o=rx, which repeated o= and never set the owner bits. Correct to u=rwx,g=rx,o=rx (0755). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
localstatedir holds only empty mount-point stubs created at install time and never written at runtime, so install_dir can be read-only and the install stays sudo-free. Add a comment so it isn't moved back to /usr/local/var by a future change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
libsubid-dev is not packaged for Ubuntu 22.04; SingularityCE 4.3+
requires libsubid headers to build unless --without-libsubid is passed.
Add the flag bounded to >= 4.3 (complementing the < 4.3 --without-conmon
bound) so the build succeeds on Jammy and the commented reference
versions stay buildable. Impact is limited to fakeroot subid lookups
(static /etc/sub{u,g}id only, no NSS) and is nil for plain rootless runs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
MikeCTZA
approved these changes
Jun 2, 2026
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.
Summary
Reconfigure both container runtimes so containers run via unprivileged user namespaces instead of the setuid-root
starter-suidbinary, and so the runtimes install without any sudo. Also bumps both to their latest releases.Scope was deliberately limited to running containers — building happens elsewhere, so
roles/containers/build tasks and.deffiles are untouched.Changes
SUID-free build & install (
apptainer.yaml,singularity.yaml)mconfig --without-suid(apptainer switched from--with-suid).--localstatedir/--sysconfdirunder the per-version install prefix somake installwrites only to the user-writable/softwaretree → removedbecome: truefrom the go-based installs.--without-conmonto< 4.3(the flag was removed in SingularityCE 4.3.0); kept--without-seccomp.Config managed elsewhere
apptainer.confdeployment fromapptainer.yaml.debugreminder to setallow setuid = noin the externally-managedsingularity.conf/apptainer.conf.make installstill drops a default config into the new sysconfdir, so the runtime has a baseline before the separate tooling hardens it.Version bumps (
main.yml)Notes / follow-ups
roles/compiled/templates/common/apptainer.confis now orphaned (nothing deploys it). It still holds the ilifu bind-path reference (/idia,/data,/users, …) — that content should move into the separate config management, after which the template can be deleted here.Verification (non-root user)
🤖 Generated with Claude Code