Skip to content

Commit

Permalink
fix: reflecting mamba and not micromamba support
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeesters committed Apr 9, 2024
1 parent 609ba07 commit bf5a550
Showing 1 changed file with 48 additions and 55 deletions.
103 changes: 48 additions & 55 deletions slides/common/software_environment.tex
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ \subsection{Using Conda}
Conda Implementations:
\begin{itemize}
\item Conda - Python
\item Miniconda - Conda with little less overhead
\item Mamba - drop-in replacement for "Conda", C\texttt{++}, parallel solver, fast
\item \textmu-Mamba - static version of Mamba, little overhead, no "base" environment, slightly different commands
\end{itemize}
Expand All @@ -166,74 +167,61 @@ \subsection{Using Conda}
\begin{frame}[fragile]
\frametitle{Installing Mamba}
You \emph{could} run
\begin{lstlisting}[language=Bash, style=Shell, basicstyle=\small,breaklines=true ]
$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
\begin{lstlisting}[language=Bash, style=Shell, basicstyle=\tiny,breaklines=true ]
$ wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
$ bash Miniforge3-Linux-x86_64.sh
\end{lstlisting}
to retrieve (Mini)Conda (a flavour of conda with less overhead).
to retrieve Mamba.\newline\pause
\begin{hint}
\footnotesize URL is from \url{https://docs.conda.io/en/latest/miniconda.html}.\newline However, we are going to use tweaked scripts provided to you.
\end{hint}
\pause
\begin{hint}
However, instead of downloading, we will work through this together on the slides to come.
We will work through the installation process \emph{together} on the slides to come.
\end{hint}
Instead, please execute the installer script
\begin{lstlisting}[language=Bash, style=Shell]
$ bash install_mamba.sh
\end{lstlisting}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{We will favour \emph{\textmu-Mamba} over Conda!}
Many know ``Conda'' as a package manager -- and this is correct! But:
\begin{block}{Why we recommend using ``\textmu-Mamba''}
Conda carries some overhead. Alternative implementations can be faster and require less files. Mamba is a ``drop-in'' for Conda. This means: \emph{every command is the same}, except we will write \altverb{mamba} where usuall \altverb{conda} would be.\newline
Why?\newline
Mamba is an implementation of Conda, written in \CC{}. It is able to carry out some tasks in parallel and works considerably faster. In turn, \textmu-Mamba is a staticically compiled version of Mamba and does not require a ``base'' environment (we will learn about environments, soon), which means even less overhead.
\end{block}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Installing \sout{Conda}/\textmu-Mamba}
Please run
\begin{lstlisting}[language=Bash, style=Shell]
$ "${SHELL}" <(curl -L micro.mamba.pm/install.sh)
# or in your sample folder
$ bash install_micromamba.sh
\end{lstlisting}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Installing \sout{Conda}/\textmu-Mamba - II}
\begin{frame}[fragile]
\frametitle{Mamba - Installation - Part I}
Start the installation script - if not done:
\begin{lstlisting}[language=Bash, style=Shell]
$ bash install_mamba.sh
\end{lstlisting}
You need to confirm (with ``Enter'')
\begin{itemize}[<+->]
\item the license agreement
\item the binary folder.
\item the shell you are using (just to be on the save side)
\item whether conda-forge shall be configured (this is a major resource channel)
\item the prefix location (where \textmu-Mamba shall be placed)
\end{itemize}
The tool will tell up about the modification of your \altverb{.bashrc} file (which is executed upon \emph{every} login, we will discuss this in a minute).
The tool will tell up about the modification of your \altverb{.bashrc} file (which is executed upon \emph{every} login - if not corrected).
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Installing \sout{Conda}/\textmu-Mamba - III}
\frametitle{Installing Mamba - Part II}
\footnotesize
\begin{columns}[t]
\begin{column}{0.5\textwidth}
You now have a section like this in your ``\texttt{\textasciitilde/.bashrc}'':
\begin{lstlisting}[language=Bash, style=Shell, basicstyle=\tiny, breaklines=true]
# >>> mamba initialize >>>
# !! Contents within this block are managed by 'mamba init' !!
export MAMBA_EXE='/home/<user>/.local/bin/micromamba';
export MAMBA_ROOT_PREFIX='/home/<prefix>';
__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('<prefix>/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__mamba_setup"
eval "$__conda_setup"
else
if [ -f "<prefix>/etc/profile.d/conda.sh" ]; then
. "<prefix>/etc/profile.d/conda.sh"
else
alias micromamba="$MAMBA_EXE" # Fallback on help from mamba activate
export PATH="<prefix>/bin:$PATH"
fi
fi
unset __mamba_setup
# <<< mamba initialize <<<
unset __conda_setup

if [ -f "<prefix>/etc/profile.d/mamba.sh" ]; then
. "<prefix>/etc/profile.d/mamba.sh"
fi
# <<< conda initialize <<<
\end{lstlisting}
\bcattention \emph{Every} time you log-in this will be executed. Also, here, ``\texttt{<prefix>}'' denotes \emph{your} prefix.
\end{column}
Expand All @@ -242,18 +230,23 @@ \subsection{Using Conda}
{\footnotesize Please edit your ``\texttt{\textasciitilde/.bashrc}'' file and put part in a function, to re-gain manual control:}
\begin{lstlisting}[language=Bash, style=Shell, basicstyle=\tiny, breaklines=true]
@function conda_initialize {@
# >>> mamba initialize >>>
# !! Contents within this block are managed by 'mamba init' !!
export MAMBA_EXE='/home/<user>/.local/bin/micromamba';
export MAMBA_ROOT_PREFIX='/home/<prefix>';
__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('<prefix>/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__mamba_setup"
eval "$__conda_setup"
else
if [ -f "<prefix>/etc/profile.d/conda.sh" ]; then
. "<prefix>/etc/profile.d/conda.sh"
else
alias micromamba="$MAMBA_EXE" # Fallback on help from mamba activate
export PATH="<prefix>/bin:$PATH"
fi
fi
unset __conda_setup

if [ -f "<prefix>/etc/profile.d/mamba.sh" ]; then
. "<prefix>/etc/profile.d/mamba.sh"
fi
unset __mamba_setup
# <<< mamba initialize <<<
# <<< conda initialize <<<
@}@
\end{lstlisting}
\end{column}
Expand Down Expand Up @@ -307,7 +300,7 @@ \subsection{Using Conda}
\pause
This will list packages with channel and version information, e.\,g.
\begin{lstlisting}[language=Bash, style=Shell, basicstyle=\tiny]
$ micromamba search minimap
$ mamba search minimap
<snip>
Loading channels: done
# Name Version Build Channel
Expand Down

0 comments on commit bf5a550

Please # to comment.