Hi @dkhutch,
On Gadi is preferrable not to run conda init
, but rather use an already available conda
/micromamba
executable and setup (similar to what the conda init
command would do). Then add a ~/.condarc
file for its configuration.
I would strongly suggest switching to micromamba
, which is much faster and has pretty much all the conda
functionalities a general user would need.
My suggestion (and my setup on Gadi) is the following:
Micromamba executable
In my ~/.bash_profile
I have the following lines:
# >>> mamba initialize >>>
export MAMBA_EXE='/g/data/vk83/apps/base_conda/bin/micromamba';
echo "Initializing 'micromamba' using $MAMBA_EXE"
export MAMBA_ROOT_PREFIX='/scratch/$PROJECT/$USER/micromamba';
__mamba_setup="$($MAMBA_EXE shell hook --shell bash --root-prefix $MAMBA_ROOT_PREFIX 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__mamba_setup"
else
alias micromamba="$MAMBA_EXE" # Fallback on help from mamba activate
fi
unset __mamba_setup
# <<< mamba initialize <<<
This runs the setup for mircomamba
, setting its exe to /g/data/vk83/apps/base_conda/bin/micromamba
and its root prefix to /scratch/$PROJECT/$USER/micromamba
.
Configuration
micromamba
can be configured with a ~/.condarc
file.
I suggest something similar to:
auto_activate_base: false
envs_dirs:
- $MAMBA_ROOT_PREFIX/envs
pkgs_dirs:
- $MAMBA_ROOT_PREFIX/pkgs
conda-build:
root-dir: $MAMBA_ROOT_PREFIX/bld
channels:
- accessnri
- conda-forge
- nodefaults
changeps1: true
Micromamba alias (optional)
If you want to alias micromamba
with something different or shorter, you can add an alias in your ~/.bashrc
file. For example, I have it aliased to mamba
:
alias mamba='micromamba'
Conda
A very similar approach could be done with conda
if needed. The only reason to also need conda
I think is being able to build conda packages using conda build
.
In this case, the following can be added to the ~/.bash_profile
after the micromamba setup above:
# >>> conda initialize >>>
export CONDA_EXE=/g/data/xp65/public/apps/med_conda/bin/conda
echo "Initializing 'conda' using $CONDA_EXE"
__conda_setup="$($CONDA_EXE shell.bash hook --root-prefix $MAMBA_ROOT_PREFIX 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "$CONDA_EXE" ]; then
. "$(dirname $(dirname $CONDA_EXE))/etc/profile.d/conda.sh"
else
export PATH="$(dirname $CONDA_EXE):$PATH"
fi
fi
# <<< conda initialize <<<
In this case, I would keep the same ~/.condarc
configuration and make sure to only use conda
to build packages, and micromamba
for all the rest.