Skip to content

resolve location of singularity command before running 'sudo singularity build'#2482

Merged
ocaisa merged 1 commit intoeasybuilders:developfrom
boegel:which_singularity
Apr 23, 2018
Merged

resolve location of singularity command before running 'sudo singularity build'#2482
ocaisa merged 1 commit intoeasybuilders:developfrom
boegel:which_singularity

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Apr 23, 2018

Without this, we're at the mercy of whatever $PATH is set to under sudo, which may lead to situations like:

== Running 'sudo singularity build /tmp/GCC-6.4.0-2.28.simg /tmp/Singularity.GCC-6.4.0-2.28', you may need to enter your 'sudo' password...
== (streaming) output for command 'sudo singularity build /tmp/GCC-6.4.0-2.28.simg /tmp/Singularity.GCC-6.4.0-2.28':
sudo: singularity: command not found
ERROR: cmd "sudo singularity build  /tmp/GCC-6.4.0-2.28.simg /tmp/Singularity.GCC-6.4.0-2.28" exited with exit code 1 and output:
sudo: singularity: command not found

[boegel@localhost ~]$ which singularity
/usr/local/bin/singularity

/usr/local/bin is not in $PATH under sudo for security reasons. We would probably hit the same issue if Singularity is installed in a non-default installation prefix.

Fix is trivial: resolve location of singularity command to an absolute path before calling out to it...

@boegel boegel added the bug fix label Apr 23, 2018
@boegel boegel added this to the 3.6.0 milestone Apr 23, 2018
@ocaisa ocaisa merged commit f7e5387 into easybuilders:develop Apr 23, 2018
@boegel boegel deleted the which_singularity branch April 24, 2018 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants