Hi Michael,
if the need for isolation is not too large, one way might be to just use
(old fashioned) different environment setups in the container (if you
really need to have more than one workflow per container)
I.e.,
if all the use cases share somewhat the same libs/bins, you could add
env setup functions to the environment section [1] to get the paths in
the container right for each use case.
Then -for 'automatic' execution or so- one could update the action
scripts at the end of the %post section [2].
So, that one or the other setup-function is executed for singularity
shell/execute/run/..., e.g., by adding on SINGULARITYENV_ envvars, so
that auser can choose his/her desired environment in the container by
exporting the corresponding envvar before starting the container.
Vanessa has a very good guide on how to tweak the action scripts
https://vsoch.github.io/2019/motd/
which might be a good starting point
Cheers,
Thomas
[1]
> Singularity
%environment
function setupHelp {
echo "Available environments"
echo " * setupGrid : WLCG Grid UI environment, needs CVMFS"
echo " ...
...."
echo ""
echo "To automatically setup an environment, export before starting
the container the singularity environment variable to 'true', e.g.,"
echo " export SINGULARITYENV_SETUPGRID=\"true\""
}
function setupGrid ...
[2]
%post
...
sed -i '2iecho \"Welcome to the DESY Basic SL6 Container\"'
/.singularity.d/actions/shell
sed -i '3iecho \" based on: $(/bin/cat /etc/redhat-release)\"'
/.singularity.d/actions/shell
...
sed XYZ /.singularity.d/actions/exec ...
sed ... ( if SINGULARITYENV_FOO ) ... setupFoo()
>> <javascript:>.
>
> --
> You received this message because you are subscribed to
> the Google Groups "singularity" group.
> To unsubscribe from this group and stop receiving emails
> from it, send an email to
singu...@lbl.gov <javascript:>.
>
>
> --
> You received this message because you are subscribed to the
> Google Groups "singularity" group.
> To unsubscribe from this group and stop receiving emails
> from it, send an email to
singu...@lbl.gov <javascript:>.
>
>
> --
> You received this message because you are subscribed to the
> Google Groups "singularity" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to
singu...@lbl.gov <javascript:>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "singularity" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
singularity...@lbl.gov
> <mailto:
singularity...@lbl.gov>.