This actually sounds like a bug with singularity - as your singularity session should be isolated from your normal environment. This is like your shell variables affecting the environment in a virtual Linux machine.
It seems to be a goal of singularity, that the process under it run under a completely isolated and consistent environment, see:
https://singularity.hpcng.org/
On 10/19/2021 9:35 AM, Götz Waschk wrote:
> Hi everyone,
>
> I have noticed a problem with environment-modules since upgrading to CentOS8. The startup file /usr/share/Modules/init/zsh modifies the variable $FPATH that defines the function search path used by zsh. If the variable is modified from its default, it is inherited by singularity when running a container, breaking functionality if this container has a different version of zsh.
>
> Here's an example of this behaviour:
>
> [wgs03] ~ % echo $FPATH
> /usr/share/Modules/init/zsh-functions:/usr/local/share/zsh/site-functions:/usr/share/zsh/site-functions:/usr/share/zsh/5.5.1/functions
> [wgs03] ~ % singularity run /project/singularity/images/SL6.img
> ************************************************************************
> * You are now running a shell in a Singularity container providing a *
> * Scientific Linux 6 environment. Most things should just work as if *
> * you had just logged in to such a system, but there are differences. *
> ************************************************************************
> /etc/site/zshrc:72: compinit: function definition file not found
> [wgs03:SL6] ~ % echo $FPATH
> /usr/share/Modules/init/zsh-functions:/usr/local/share/zsh/site-functions:/usr/share/zsh/site-functions:/usr/share/zsh/5.5.1/functions
>
> If I remove environment-modules from the system, this problem doesn't occur:
>
> [wgs03] ~ % echo $FPATH
> /usr/local/share/zsh/site-functions:/usr/share/zsh/site-functions:/usr/share/zsh/5.5.1/functions
> [wgs03] ~ % singularity run /project/singularity/images/SL6.img
> ************************************************************************
> * You are now running a shell in a Singularity container providing a *
> * Scientific Linux 6 environment. Most things should just work as if *
> * you had just logged in to such a system, but there are differences. *
> ************************************************************************
> [wgs03:SL6] ~ % echo $FPATH
> /usr/share/zsh/site-functions:/usr/share/zsh/4.3.11/functions
>
> So every time, $FPATH is modified, it is inherited by the container. I'd prefer it if zsh wouldn't modify $FPATH. Wouldn't it work as well if _module was placed in /usr/share/zsh/site-functions? My test regarding this was fine.
>
> Regards,
> Götz Waschk
>
>
>
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
>
--
--------------------------------------------------------
The views and opinions expressed above are strictly
those of the author(s). The content of this message has
not been reviewed nor approved by any entity whatsoever.
--------------------------------------------------------
Paul FM Info: http://paulfm.com/~paulfm/
--------------------------------------------------------
|