Using the shared CCBR mamba installation on Biowulf

Author

Kelly Sovacool

You can configure conda/mamba to use our shared CCBR installation of miniforge3 on Biowulf, which will allow you to access CCBR environments while also creating your own environments.

Initialize your shell

Initialize your shell with mamba. This will modify your shell’s rc file (e.g. ~/.zshrc or ~/.bashrc) to allow you to use mamba.

Specify your shell language with --shell SHELL. The below example is for zsh:

/data/CCBR_Pipeliner/db/PipeDB/miniforge3/bin/mamba shell init \
  --shell zsh --root-prefix=/data/$USER/mamba

or bash:

/data/CCBR_Pipeliner/db/PipeDB/miniforge3/bin/mamba shell init \
  --shell bash --root-prefix=/data/$USER/mamba

We recommend setting --root-prefix to your data directory /data/$USER since more space is available than in your home directory ~/.

Source your shell’s rc file to make these changes take effect.

source ~/.zshrc
source ~/.bashrc

Update your conda configuration

Copy and paste the following contents into your conda configuration file: ~/.condarc

channels:
  - conda-forge
  - bioconda
channel_priority: strict
show_channel_urls: true
envs_dirs:
  - /data/$USER/mamba/envs/
  - /data/CCBR_Pipeliner/db/PipeDB/miniforge3/envs/
pkgs_dirs:
  - /data/$USER/mamba/pkgs/
denylist_channels:
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r

You can optionally add other configuration options as you see fit (e.g. auto_activate_base), but it is important to at least have all of the content above.

Verify mamba setup

Let’s make sure everything is working as expected. You should be able to activate shared CCBR environments, and also create new environments for your own personal use.

mamba info
       libmamba version : 2.1.1
          mamba version : 2.1.1
           curl version : libcurl/8.14.1 OpenSSL/3.5.1 zlib/1.3.1 zstd/1.5.7 libssh2/1.11.1 nghttp2/1.64.0
     libarchive version : libarchive 3.7.7 zlib/1.3.1 liblzma/5.8.1 bz2lib/1.0.8 liblz4/1.10.0 libzstd/1.5.7
       envs directories : /gpfs/gsfs12/users/$USER/mamba/envs
                          /vf/users/CCBR_Pipeliner/db/PipeDB/miniforge3/envs
          package cache : /gpfs/gsfs12/users/$USER/mamba/pkgs
            environment : base (active)
           env location : /gpfs/gsfs12/users/$USER/mamba
      user config files : /home/$USER/.mambarc
 populated config files : /home/$USER/.condarc
       virtual packages : __unix=0=0
                          __linux=4.18.0=0
                          __glibc=2.28=0
                          __archspec=1=x86_64_v4
               channels : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/bioconda/linux-64
                          https://conda.anaconda.org/bioconda/noarch
       base environment : /gpfs/gsfs12/users/$USER/mamba
               platform : linux-64

($USER will be filled in with your actual username on Biowulf.)

Note that the channel URLs point to https://conda.anaconda.org/ (only community-supported channels), and no channels point to https://repo.anaconda.com (commercial channels).

New environments you create will be in /data/$USER/mamba/envs/, but you will also be able to activate any environment listed in /data/CCBR_Pipeliner/db/PipeDB/miniforge3/envs/

Activate a CCBR environment

mamba activate py3.11-8
mamba deactivate

Create a new environment for your own use

The environment will be created in /data/$USER/mamba/envs/mytestenv.

mamba create -n mytestenv python=3.13 r-base=4.5
conda-forge/linux-64                                        Using cache
conda-forge/noarch                                          Using cache
bioconda/linux-64                                           Using cache
bioconda/noarch                                             Using cache


Transaction

  Prefix: /gpfs/gsfs12/users/$USER/mamba/envs/mytestenv

  Updating specs:

   - python=3.13
   - r-base=4.5

View environments

You should see both your personal environments and the shared CCBR environments listed.

mamba info --envs

Conclusion & Support

If all of the above commands worked as expected, you’re all set up to use mamba on biowulf! 🎉

TipGetting support

If you have any questions about conda or mamba generally, please refer to the mamba documentation

If you have any questions or run into problems while using the CCBR mamba installation on biowulf, please contact us at CCBR_Pipeliner@mail.nih.gov

Optional: create a new shared CCBR environment

If you are a member of the CCBR_Pipeliner group on biowulf, you can create new environments in the CCBR mamba installation for others to use.

Important

You can run the groups command on biowulf to see which groups you are a member of.

groups
CCBR CCBR_Pipeliner

If CCBR_Pipeliner is not listed, you will not be able to create a shared CCBR environment.

Create your new environment using the CCBR miniforge3 directory for the prefix. The environment name is the directory name after /data/CCBR_Pipeliner/db/PipeDB/miniforge3/envs/. For example, the following will create an environment called test-$USER ($USER will be replaced by your actual username).

mamba create --prefix=/data/CCBR_Pipeliner/db/PipeDB/miniforge3/envs/test-$USER \
  python=3.12

Change the permissions to ensure everyone can use the environment:

chmod -R a+rX /data/CCBR_Pipeliner/db/PipeDB/miniforge3/envs/test-$USER

The environment files should now be readable and executable by all:

ls -alh /vf/users/CCBR_Pipeliner/db/PipeDB/miniforge3/envs/test-$USER
total 0
drwxrwsr-x 2 $USER CCBR_Pipeliner 4.0K Oct 24 12:21 .
drwxrwsr-x 2 $USER CCBR_Pipeliner 4.0K Oct 24 12:21 ..
drwxrwsr-x 2 $USER CCBR_Pipeliner 4.0K Oct 24 12:22 bin
drwxrwsr-x 2 $USER CCBR_Pipeliner 4.0K Oct 24 12:21 compiler_compat
drwxrwsr-x 2 $USER CCBR_Pipeliner 4.0K Oct 24 12:22 conda-meta
drwxrwsr-x 2 $USER CCBR_Pipeliner 4.0K Oct 24 12:21 include
drwxrwsr-x 2 $USER CCBR_Pipeliner 4.0K Oct 24 12:21 lib
drwxrwsr-x 2 $USER CCBR_Pipeliner 4.0K Oct 24 12:21 man
drwxrwsr-x 2 $USER CCBR_Pipeliner 4.0K Oct 24 12:21 share
drwxrwsr-x 2 $USER CCBR_Pipeliner 4.0K Oct 24 12:21 ssl
drwxrwsr-x 2 $USER CCBR_Pipeliner 4.0K Oct 24 12:21 x86_64-conda-linux-gnu

Activate the new environment and make sure it works as expected:

mamba activate test-$USER
which python
python --version
mamba deactivate
/vf/users/CCBR_Pipeliner/db/PipeDB/miniforge3/envs/test-$USER/bin/python
Python 3.12.12

That’s it! Now anyone on biowulf can activate your environment.

NoteClean up

If you created an environment only for testing purposes, please delete it when you are finished so that the CCBR environments directory doesn’t get cluttered.

mamba env remove -n test-$USER