From bf5a5507bd58c67fc2b6dec84d179bd4afb858be Mon Sep 17 00:00:00 2001 From: Christian Meesters Date: Tue, 9 Apr 2024 15:45:13 +0200 Subject: [PATCH] fix: reflecting mamba and not micromamba support --- slides/common/software_environment.tex | 103 ++++++++++++------------- 1 file changed, 48 insertions(+), 55 deletions(-) diff --git a/slides/common/software_environment.tex b/slides/common/software_environment.tex index d8df801..88e0294 100644 --- a/slides/common/software_environment.tex +++ b/slides/common/software_environment.tex @@ -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} @@ -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//.local/bin/micromamba'; -export MAMBA_ROOT_PREFIX='/home/'; -__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="$('/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then - eval "$__mamba_setup" + eval "$__conda_setup" +else +if [ -f "/etc/profile.d/conda.sh" ]; then + . "/etc/profile.d/conda.sh" else - alias micromamba="$MAMBA_EXE" # Fallback on help from mamba activate + export PATH="/bin:$PATH" +fi fi -unset __mamba_setup -# <<< mamba initialize <<< +unset __conda_setup + +if [ -f "/etc/profile.d/mamba.sh" ]; then + . "/etc/profile.d/mamba.sh" +fi +# <<< conda initialize <<< \end{lstlisting} \bcattention \emph{Every} time you log-in this will be executed. Also, here, ``\texttt{}'' denotes \emph{your} prefix. \end{column} @@ -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//.local/bin/micromamba'; -export MAMBA_ROOT_PREFIX='/home/'; -__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="$('/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then - eval "$__mamba_setup" + eval "$__conda_setup" +else +if [ -f "/etc/profile.d/conda.sh" ]; then + . "/etc/profile.d/conda.sh" else - alias micromamba="$MAMBA_EXE" # Fallback on help from mamba activate + export PATH="/bin:$PATH" +fi +fi +unset __conda_setup + +if [ -f "/etc/profile.d/mamba.sh" ]; then + . "/etc/profile.d/mamba.sh" fi -unset __mamba_setup -# <<< mamba initialize <<< +# <<< conda initialize <<< @}@ \end{lstlisting} \end{column} @@ -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 Loading channels: done # Name Version Build Channel