singularity
singularity copied to clipboard
Environment not set for tests during build
Version of Singularity:
3.2.1
Expected behavior
Tests run after build behave the same as tests run with singularity test
Actual behavior
Environment as defined by %environment is not defined so test commands fail due to e.g. PATH
not set
Steps to reproduce behavior
Bootstrap: docker
From: ubuntu
%environment
export FOO=bar
%test
[ "${FOO}" = "bar" ]
singularity build test.sif test.def
-- fails
singulart build -T test.sif test.def && singularity test test.sif
-- passes
This seems like a bug to me as well.
I opened (https://github.com/sylabs/singularity-userdocs/issues/184) to help better determine the ordering of this as well. Thanks for the report @Flamefire !
@Flamefire @jscook2345 This is intended behavior, environment scripts are not sourced during the build, but are sourced when singularity test
is executed
This is intended behavior, environment scripts are not sourced during the build, but are sourced when singularity test is executed
I can't believe this is fully thought through. Why would it be wanted, that the tests run at the end of a build are executed in a different environment than when executed with singularity test
? This would mean that for reliable tests one would need to do sudo singularity build [...] && singularity test [...]
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
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.
@Flamefire Still getting this problem ? Have this been solved already ? If yes, what work around have you followed and applied ?
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.
I don't really use this anymore, so I can't tell. But there is a reproducer in the OP, so it is easy to check.
Singularity repo is now retired as the code base is now moved to Apptainer. We are closing all the old issues under the old Singularity repo. For further assistance please open a new issue under the new Apptainer repo. Thanks for your support.