singularity
singularity copied to clipboard
%test section of bootstrap does not bring in the same things as shell/exec
Version of Singularity:
2.3.1
Expected behavior
It would be good to consider supporting things like environment, bind mounting and Nvidia stack (--nv) in the %test section of the bootstrap so that container testing could be included inside of the Singularity spec file.
Actual behavior
Environment variables defined in %environment don't work, bind mounting does not work, --nv does not work.
Steps to reproduce behavior
For example with the environment: %environment export FOO=bar %test echo $FOO
NOTE: The environment and bind mounting work if the %test section is executed separately after the container was built, e.g. when doing sudo singularity bootstrap my.img my.def followed by sudo singularity bootstrap -s test my.img my.def
But this requires the initial bootstrap to run again, and, still does not bring in the Nvidia stack.
My current workaround is to do the testing in a separate singularity exec command, but, it beats the purpose of having single spec file for the container deployment.
Hi @mcuma!
If you want to bind mount a directory into your container during bootstrap you can actually already do it by leveraging the %setup section. Just write something like this:
%setup
mount --no-mtab --rbind "/host/dir" "$SINGULARITY_ROOTFS/container/dir"
As for the --nv option working during bootstrap for test, I thinks it's a good idea. We've had requests in the past, but the users have always found workarounds.
+1. I was about to reference this issue in the other about bootstrap :)
Hello,
This is a templated response that is being sent out to all open issues. We are working hard on 'rebuilding' the Singularity community, and a major task on the agenda is finding out what issues are still outstanding.
Please consider the following:
- Is this issue a duplicate, or has it been fixed/implemented since being added?
- Is the issue still relevant to the current state of Singularity's functionality?
- Would you like to continue discussing this issue or feature request?
Thanks, Carter
@carterpeel this needs to be evaluated if it’s still an issue, and if so it’s considered a bug and needs to be fixed.
This issue has been automatically marked as stale because it has not had activity in over 60 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Don't close stalebot, the contributors to this issue have responded and it's the maintainers that have not.
@mcuma We're looking into the issue carefully, soon will bring to community and discuss ways to better solve as well address this. Thankyou for keeping the interest in the subject.
Pending issues from the old repo copied to the new repo (https://github.com/apptainer/apptainer/issues/1390) and cleaned from the old, retired repo.