I am using Singularity containers to run commands from Nextflow workflow management system. I have a conda environment inside Singularity which I can activate when I shell into the container
singularity pull shub://brucemoran/Singularity:pcgr.centos7
singularity shell brucemoran-Singularity-pcgr.centos7.img
#<inside container>
source activate pcgr
When Nextflow executes I have defined to source activate pcgr
which I think should activate the conda env. But I get an unbound variable HOST
warning. I think that relates to the non-activation and subsequent use of variables that should be defined if the env was activated(?).
I would like the container to activate the env (pcgr) whenever it is executed. I tried with
%run
source activate pcgr
and
%post
source activate pcgr
but this doesn't work for me
singularity exec pcgr.img which pcgr.py
which: no pcgr.py in ...
I cannot see how this is done, but presume it is easy and I am massively overlooking something!
Help appreciated.