How to tell singularity to use a specific config file?

1,261 views
Skip to first unread message

tin h

unread,
Mar 21, 2017, 3:53:06 PM3/21/17
to singu...@lbl.gov

 

Hi folks,

 

Is it possible to tell singularity to use a specific singularity.conf file?  I tried to see if there is a command line parameter for this and didn’t see it.

 

What I am trying to do maybe a bit archaic, but I do work in a dinosaur company J  One of the motivation is to install singularity on a NFS share location, so that many workstations can use singularity without having to install it on each individual machine.  It would also allow us to switch between say release and dev version of singularity easily ;-)

 

I did ./configure –prefix=/prog/singularity/2.2.1     

But the resulting singularity binary still looked for singularity.conf in /usr/local:

    ERROR  : Could not open configuration file /usr/local/etc/singularity/singularity.conf: No such file or directory

    ERROR  : Called singularity_config_get_value() before opening a config!

This was for singularity 2.2.1 in RHEL 6.


Thanks!

Tin

Rémy Dernat

unread,
Mar 21, 2017, 4:53:58 PM3/21/17
to singu...@lbl.gov
Hi,

I think that behaviour occurs if you installed a previous version and you did not remove everything deeply, before trying that new install.

So perhaps you could try to remove every singularity folders/files, then logout/login and reinstall it.

My singularity software is installed in a NFS directory, and I use module to load it. It works perfectly.

However, something like ~/.local/singularity.conf could be interesting to manage different user's configurations.

Best regards,

Rémy

--
You received this message because you are subscribed to the Google Groups "singularity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.

Brian Bockelman

unread,
Mar 21, 2017, 11:00:47 PM3/21/17
to singu...@lbl.gov
Hi,

Since it affects the security settings of the binary, one cannot allow
users to specify the configuration file. It gets hardcoded at compile
time.

You *can* specify a NFS-mounted configuration file as part of
./configure step. Did you try to 'make clean' after running
configure?

Brian
>> email to singularity...@lbl.gov.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "singularity" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to singularity...@lbl.gov.

Ron Jerome

unread,
Mar 22, 2017, 9:32:56 AM3/22/17
to singularity
OK, but I have another use case for multiple.conf files... 

We have a multi-tenant HPC system where we want different bind mounts (and potentially other settings) for each tenant.  Is there currently any way to achieve this?

Ron.

David Godlove

unread,
Mar 22, 2017, 10:55:58 AM3/22/17
to singu...@lbl.gov
One way is to use the SINGULARITY_BINDPATH environmental variable.  User's can set that in their .bashrc if they always want it to be the same, and if you want to change it for a particular container you can write a wrapper script that set's everything up at runtime.  

Here's an example wrapper script:

#!/bin/bash
SINGULARITY_BINDPATH="/gpfs,/gs2,/gs3,/gs4,/gs5,/spin1,/data,/scratch,/fdb,/lscratch"
export SINGULARITY_BINDPATH
dir=$(dirname  "$0")
cmd=$(basename "$0")
args="$@"
singularity exec $dir/digits.img $cmd $args

If you put this in the same directory with an image called digits.img, then you can create symliks to the wrapper script that become commands to be executed from within your container.  For instance, 

digits-devserver -> digits.sh
python -> digits.sh

Now if the directory with all of this stuff is on your path and you type python, you will be dumped into an interactive python prompt within the digits container with all of the bind mounts listed (assuming the image contains this stuff).

To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.

Ron Jerome

unread,
Mar 24, 2017, 1:28:29 PM3/24/17
to singularity
Good point, but what if we don't want to enable "user defined binds"?

What I'm thinking is being able to read a set of binds from a specific file based on the users group membership.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.

Gregory M. Kurtzer

unread,
Mar 24, 2017, 2:06:23 PM3/24/17
to singularity
Hi Ron,

You must then have different Singularity builds for each of these groups. Due to security reasons, the location of the Singularity configuration file is hard coded into the execution binaries.

Greg

To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.



--
Gregory M. Kurtzer
HPC Systems Architect and Technology Developer
Lawrence Berkeley National Laboratory HPCS
University of California Berkeley Research IT
Singularity Linux Containers (http://singularity.lbl.gov/)
Warewulf Cluster Management (http://warewulf.lbl.gov/)
Reply all
Reply to author
Forward
0 new messages