vsoch / scif

scientific filesystem: a filesystem organization for scientific software and metadata
https://sci-f.github.io/
Mozilla Public License 2.0
30 stars 13 forks source link

singularity run --app support? #51

Closed bilke closed 5 years ago

bilke commented 5 years ago

I built a container with some scif apps which where installed via scif install .... I can run them with scif:

singularity exec container.simg scif run app_foo

I would expect that I can also run them with the singularity run --app syntax:

singularity run --app app_foo container.simg

But in this case there is no runscript defined:

No Singularity runscript for contained app: app_foo

Also singularity test --app does not work too but singularity help --app works!

Bug or intended? Thanks!

vsoch commented 5 years ago

The syntax:

singularity run --app app_foo container.simg

is using singularity as the controller for apps, so if there is a bug in the implementation you should take it up on the sylabs board --> https://github.com/sylabs/singularity/issues Feel free to leave this open if/when you have any more questions!

bilke commented 5 years ago

@vsoch Ok I think I found the reason:

The runscript for the app installed via scif install .. is existing but is not marked as executable:

ls -ll /scif/apps/app_foo/scif

-rw-r--r--. 1 root root 357 Oct 30 12:30 app_foo.scif
-rw-r--r--. 1 root root  27 Oct 30 12:30 runscript
-rw-r--r--. 1 root root  50 Oct 30 12:30 runscript.help
-rw-r--r--. 1 root root  30 Oct 30 12:30 test.sh

But singularity tests the file for it:

https://github.com/sylabs/singularity/blob/master/etc/actions/run#L11-L12

I guess runscript and test.sh should be chmod +x. Maybe here: https://github.com/vsoch/scif/blob/ee6dd5533a7fffe423fcd995552b05f1253982c3/scif/utils/fileio.py#L80-L86

or here: https://github.com/vsoch/scif/blob/ee6dd5533a7fffe423fcd995552b05f1253982c3/scif/main/install.py#L223

vsoch commented 5 years ago

Definitely a bug! GIve me a few minutes I'll get a fix for you done.

vsoch commented 5 years ago

okay here is how to test, let me know if this fixes the issue:

pip uninstall scif
# do the above until it tells you not installed to remove any previous versions
git clone -b fix/script-chmod https://www.github.com/vsoch/scif
cd scif
python setup.py install
bilke commented 5 years ago

Thanks a lot it works!

vsoch commented 5 years ago

Great! Thanks for testing, closing issue.

https://pypi.org/project/scif/0.0.76/