Quick question - wouldn't code for singularity testing need to go in %test?
imho - the %runscript section shouldn't be required, and given that it's not required, I think that the default behavior of running /bin/sh is a reasonable thing to do. Why? A few reasons:
- most new users are going to follow the workflow of create --> run, and they probably won't know to make or specify a runscript. What they really want to do is get into the container, so if they do singularity run and nothing happens, it's confusing. The reason (I think) that the message is there is to prompt them to thing "huh, there is this thing called a runscript, and it wasn't found, does that mean I can change that?"
- Docker has similar subtle differences between exec and run. Exec is more like "shove this command to this container, do it, and then back to my command window." That can be modified with something like:
docker exec -it [containerid] bash
which means "run and interactive terminal with bash command" (which will not return to the user command line until they exit) but it's a little farther away from the traditional exec command. Run, on the other hand, is what you would expect - you want to think of your container like an executable and run it, and it does whatever it's supposed to do. This is different from exec because exec the executor (**Halloween screens**) determines the command run.
I hope that the discussion above cleared up the confusion that (I think) you might have between run/exec, which I infer when you say "a container meant to be used with singularity exec' - containers are not "meant" to be used with exec, they are intended (for users) to be run with singularity run --> runscript, and exec is more sending a specific command to the container. If you want to provide explicit instructions to the user for using exec, this would work, but I would suggest instead writing a runscript that takes input arguments to handle the commands you have in mind, because running the container as an executable (.container.img) will also trigger the runscript.