Comments (2)
Hi. The answers here are that we don't perform these binds & env var handling by default for simplicity, because the 'correct' behavior is ill-defined, or varies between workflows, and because running desktop applications under Singularity is relatively rare.
If we pass /run/user/xxx
into the container then we are mixing aspects of the user's session on the host with the container. If you are running a graphical application from a container, but within a desktop environment running on the host, then you want tight integration and access to dbus / pulseaudio / pipewire etc. through the sockets under /run/user/xxx
might be appropriate. If you are trying to run tools in a container for greater isolation / compatibility across very different host/container OS versions then it is not. Singularity is most commonly used to execute batch and command line workflows, so we avoid the potential issues of mounting /run/user/xxx
by default.
With regard to /etc/machine-id
there is no complete consensus on what a container runtime should do. See e.g. https://wiki.debian.org/MachineId . However, the discussion / PR for a mount that has been used in Charliecloud seems like it'd be appropriate: hpc/charliecloud#1050
If you want to mount /etc/machine-id
by default, you can add it to the bind path
section in the singularity.conf
configuration file.
The SESSION_MANAGER
env var is passed through, as Singularity's default is to pass through almost all host environment. Again, it's not always clear if things should be unset for different workflows. The SESSION_MANAGER
often goes hand-in-hand with various XDG_
environment variables which are set when running under an interactive session on the host. These can be inappropriate in a container at times, but at other times their presence results in behavior that is expected (e.g. custom XDG_CONFIG_DIR
locations).
One thing you can do, is set the runscript in your container definition to unset SESSION_MANGER
before it runs code, something like...
%runscript
unset SESSION_MANAGER
code $@
Would then likely allow a singularity run
to work as expected.
from singularity.
@dtrudg Thanks a lot for the extensive answer! I agree with you that the current behaviour makes sense when because running desktop applications under Singularity is relatively rare. I will close this issue since it is easy to work around these issues using the recipe file.
from singularity.
Related Issues (20)
- Unknown image format/type in nextflow pipeline HOT 5
- Drop remaining direct containers/common usage
- CNI dhcp plugin does not work - netns bind issues
- oci-sif: inefficent copies of oci (layout) and tarball images
- delete sandbox
- allow user ns in singularity.conf
- allow ipc ns in singularity.conf
- e2e: OCI CustomHomePreservesRootShell failure
- Guidance on Choosing Between Apptainer and SingularityCE for Computational Materials Science Applications.
- Error when installing from Ubuntu package HOT 1
- Review / Fix dnf/yum/zypper ConveyorPacker unit tests
- `--data` convenience flag for --bind with image-src=/
- pkg/ocibundle/ocisif test dependent on squashfuse, but not gated HOT 1
- pkg/image TestSIFInitializer test failure
- OCI ConveyorPacker test failures
- Library ConveyorPacker Test Failure HOT 1
- SIFAssembler test failure
- tmpfs error using singularity with PID namespace on RHEL 8.8 HOT 5
- Does not build an .img file on Vagrant 2.4.1 on Mac(Sonoma 14.5 (23F79)) HOT 2
- 4.1.4 Backports
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from singularity.