mamba-org / devcontainer-features

MIT License
4 stars 2 forks source link

micromamba feature does not install mamba, only configures shell #18

Open phillies opened 1 year ago

phillies commented 1 year ago

I added the micromamba feature to my python-debian based container, however, after the installation the /home/vscode/micromamba folder is practically empty, containing only the initialization script:

$ find /home/vscode/micromamba/
/home/vscode/micromamba/
/home/vscode/micromamba/etc
/home/vscode/micromamba/etc/profile.d
/home/vscode/micromamba/etc/profile.d/micromamba.sh
/home/vscode/micromamba/conda-meta

This is the build log:

2023-04-28 09:23:36.244Z: #19 0.702 ===========================================================================
2023-04-28 09:23:36.245Z: #19 0.702 Feature       : micromamba
#19 0.702 Description   : Installs micromamba, the fast cross-platform package manager.
#19 0.702 Id            : ghcr.io/mamba-org/devcontainer-features/micromamba
#19 0.702 Version       : 1.1.1
#19 0.702 Documentation : https://github.com/mamba-org/devcontainer-features/tree/main/src/micromamba
#19 0.702 Options       :
#19 0.702     VERSION="latest"
#19 0.702     ALLOWREINSTALL="false"
#19 0.702     CHANNELS=""
#19 0.702     PACKAGES=""
#19 0.702     ENVFILE=".devcontainer/env.yml"
#19 0.702     ENVNAME="testenv"
#19 0.702 ===========================================================================
2023-04-28 09:23:36.354Z: #19 0.781 Installing prerequisites for downloading micromamba...
#19 0.813 Downloading micromamba from https://micro.mamba.pm/api/micromamba/linux-64/latest...
2023-04-28 09:23:38.609Z: #19 2.931 Micromamba download complete.
#19 2.931 Micromamba executable installed.
2023-04-28 09:23:38.865Z: #19 3.324 Setting channel_priority to strict
2023-04-28 09:23:38.975Z: #19 3.434 Initializing Bash shell
2023-04-28 09:23:39.077Z: #19 3.471 Modifying RC file "/home/vscode/.bashrc"
#19 3.471 Generating config for root prefix "/home/vscode/micromamba"
#19 3.471 Setting mamba executable to: "/usr/local/bin/micromamba"
#19 3.471 Adding (or replacing) the following in your "/home/vscode/.bashrc" file
#19 3.471
#19 3.471 # >>> mamba initialize >>>
#19 3.471 # !! Contents within this block are managed by 'mamba init' !!
#19 3.471 export MAMBA_EXE="/usr/local/bin/micromamba";
#19 3.471 export MAMBA_ROOT_PREFIX="/home/vscode/micromamba";
#19 3.471 __mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
#19 3.471 if [ $? -eq 0 ]; then
#19 3.471     eval "$__mamba_setup"
#19 3.471 else
#19 3.471     if [ -f "/home/vscode/micromamba/etc/profile.d/micromamba.sh" ]; then
#19 3.471         . "/home/vscode/micromamba/etc/profile.d/micromamba.sh"
#19 3.471     else
#19 3.471         export  PATH="/home/vscode/micromamba/bin:$PATH"  # extra space after export prevents interference from conda init
#19 3.471     fi
#19 3.471 fi
#19 3.471 unset __mamba_setup
#19 3.471 # <<< mamba initialize <<<
#19 3.471
#19 3.473 Setting Bash shell to automatically activate
#19 3.483 Initializing zsh shell
#19 3.522 Modifying RC file "/home/vscode/.zshrc"
#19 3.522 Generating config for root prefix "/home/vscode/micromamba"
#19 3.522 Setting mamba executable to: "/usr/local/bin/micromamba"
#19 3.522 Adding (or replacing) the following in your "/home/vscode/.zshrc" file
#19 3.522
#19 3.522 # >>> mamba initialize >>>
#19 3.522 # !! Contents within this block are managed by 'mamba init' !!
#19 3.522 export MAMBA_EXE="/usr/local/bin/micromamba";
#19 3.522 export MAMBA_ROOT_PREFIX="/home/vscode/micromamba";
#19 3.522 __mamba_setup="$("$MAMBA_EXE" shell hook --shell zsh --prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
#19 3.522 if [ $? -eq 0 ]; then
#19 3.522     eval "$__mamba_setup"
#19 3.522 else
#19 3.522     if [ -f "/home/vscode/micromamba/etc/profile.d/micromamba.sh" ]; then
#19 3.522         . "/home/vscode/micromamba/etc/profile.d/micromamba.sh"
#19 3.522     else
#19 3.522         export  PATH="/home/vscode/micromamba/bin:$PATH"  # extra space after export prevents interference from conda init
#19 3.522     fi
#19 3.522 fi
#19 3.522 unset __mamba_setup
#19 3.522 # <<< mamba initialize <<<
#19 3.522
#19 3.535 Micromamba configured.
2023-04-28 09:23:39.227Z: #19 3.559
#19 3.559                                            __
2023-04-28 09:23:39.230Z: #19 3.559           __  ______ ___  ____ _____ ___  / /_  ____ _
#19 3.559          / / / / __ `__ \/ __ `/ __ `__ \/ __ \/ __ `/
#19 3.559         / /_/ / / / / / / /_/ / / / / / / /_/ / /_/ /
#19 3.559        / .___/_/ /_/ /_/\__,_/_/ /_/ /_/_.___/\__,_/
#19 3.559       /_/
#19 3.559
#19 3.559 Collect information..
#19 3.559 Cleaning index cache..
#19 3.559 Cleaning lock files..
#19 3.560 Cleaning tarballs..
#19 3.560 Cleaning packages..
#19 3.561 Done!
2023-04-28 09:23:39.378Z: #19 DONE 3.8s
maresb commented 1 year ago

Hey, thanks a lot for the feedback!

The directory /home/vscode/micromamba is for the Conda environment itself, whereas the micromamba executable is installed as a system binary in /usr/local/bin. (Having it installed system-wide allows it to not be dependent on any particular Conda env, and allowing it to create an initial Conda env from scratch.)

Given this information, does everything look in order?

Maybe we need to improve the docs to make this clear. (This repo is still quite young and to be improved.)

eitsupi commented 1 year ago

Just to be clear, this Feature installs micromamba, not mamba. Could you check the micromamba command?

maresb commented 1 year ago

It's definitely confusing how the logs say mamba initialize when it's micromamba and not mamba. But that issue is upstream in micromamba and I've actually already complained about it already. (It's complicated, and actually the vision is for micromamba and mamba to someday become equivalent.)

eitsupi commented 1 year ago

By the way, if you want to install mamba directly, here is another Feature which you can install mambaforge with. https://github.com/rocker-org/devcontainer-features/tree/main/src/miniforge

maresb commented 1 year ago

I wonder if #20 solves this issue. Micromamba should actually be using /opt/conda as the root prefix, not ~/micromamba. If you get the chance, could you please try again and see if everything works as expected now?