What version of Singularity are you using? 3.4.1
What did you expect to see when you do...?
$ vagrant init sylabs/singularity-3.4-centos-7-64
$ vagrant up
$ vagrant ssh
[vagrant@localhost ~]$ singularity --version
singularity version 3.4.1-1
What actually happend? Why was it incorrect?
$ vagrant init sylabs/singularity-3.4-centos-7-64
$ vagrant up
$ vagrant ssh
[vagrant@localhost ~]$ singularity --version
-bash: singularity: command not found
The singularity command is not available in the CentOS flavour of the Vagrant image – the Ubuntu flavour works as expected.
How can others reproduce this issue/problem?
Install Vagrant and follow the steps listed in the code blocks above
macOS 10.14.6
Running via Vagrant
Apologies for this. @GodloveD bumped the versions of the vagrant containers yesterday. I'll try to take a look this afternoon unless he is able to.
This is fixed in the latest image just released: https://app.vagrantup.com/sylabs/boxes/singularity-3.4-centos-7-64/versions/20190927.0.0
[vagrant@localhost ~]$ cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
[vagrant@localhost ~]$ singularity --version
singularity version 3.4.1-1
Thanks for this - singularity is now available in the VM. However, I've found another problem, outlined below:
[vagrant@localhost ~]$ sudo singularity --version
sudo: singularity: command not found
[vagrant@localhost ~]$ which singularity
/usr/local/bin/singularity
[vagrant@localhost ~]$ sudo which singularity
which: no singularity in (/sbin:/bin:/usr/sbin:/usr/bin)
[vagrant@localhost ~]$ sudo env | grep PATH
PATH=/sbin:/bin:/usr/sbin:/usr/bin
This affects building images, although the obvious workaround is to provide the absolute path to the Singularity executable, i.e. /usr/local/bin/singularity
Thanks for the heads up @orbsmiv. And thanks for the quick work fixing the first issue @dctrud.
I think a more robust solution to this issue would be to add /usr/local/bin to the secure path in /etc/sudoers. You can do that manually as a workaround for now. I'll make a change to the packer config so that is default on CentOS. 😸
This should now be fixed in the latest vagrant box. Can you confirm @orbsmiv?
Confirmed on singularity-3.4-centos-7-64/versions/20191002.0.0
[vagrant@localhost ~]$ sudo grep "secure_path" /etc/sudoers
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
[vagrant@localhost ~]$ sudo singularity version
3.4.1-1

@GodloveD yes, all works for me now – thanks for the speedy work!