as a research group, we would like to use a common conda environment in which we will install the common packages. We'd like to do this in a cluster/supercomputer.
What I couldn't find any information about is that how we can use an environment which is in a specific directory, in other words, how we can activate an environment which is in a specific directory. Thanks in advance.
I provide shared environments for students in a computational biology course where most of the assignments involve using an HPC. Some suggestions:
Create a dedicated folder for the shared environments (say /shared/conda_envs
). For a class, this folder is r-x
-only for students; for a research group, that's up to you, but I'd still do the same and have one person with the lab job of creating new environments who has write permissions (could be you).
Have users add the folder to the Conda configuration. This should be appended, so they don't default to creating environments there:
conda config --append envs_dirs /shared/conda_envs
This allows users to reference the environments by name rather than by prefix.
Create environments in copy-mode. This avoids any linking back to the creating user's package cache.
CONDA_ALWAYS_COPY=1 mamba env create -f env1.yaml -p /shared/conda_envs/env1