anaconda / anaconda-project

Tool for encapsulating, running, and reproducing data science projects
https://anaconda-project.readthedocs.io/en/latest/
Other
217 stars 88 forks source link

[ENH] Allow Mamba Solves (Toggle in A-P.yml) #334

Open InnocentBeard opened 3 years ago

InnocentBeard commented 3 years ago

If your issue really is with anaconda-project, please delete the above text and fill this out!

Is your feature request related to a problem? Please describe. Conda solves take a long time to install environments with multiple packages/dependencies.
Mamba solves are significantly faster, and much less prone to hanging.

Describe the solution you'd like Allow anaconda-project.yml switch/toggle to use mamba for packages/dependencies. If toggle is on, and mamba is not already installed, then

Preferred approach: Install mamba first (ie in a mamba proj env spec), then use this project mamba bin to manage packages/dependencies in the default/custom env-specs (whether they are specified in a-p.yml, or referenced via add-package CLI etc).

Alternative approach: Ask user if they would like to proceed with conda instead. Warn that solve may differ from the intended a-p.yml and unforseen problems may occur. Continue if user agrees. Exit if user disagrees.

mforbes commented 2 years ago

I believe you can do this by setting CONDA_EXE, i.e.:

CONDA_EXE=mamba anaconda-project prepare

Not sure if this is tested or approved... but this is how the conda executable is found

AlbertDeFusco commented 2 years ago

That's a good start and would help figure out how close it is. I suspect that there some incompatible CLI flags, but I hope that many things will work

AlbertDeFusco commented 2 years ago

Now that Conda 4.12 supports libmamba I'm happy to announce that it "just works" with anaconda-project.

You can enable the mamba solver in two ways

  1. Globally with conda config --set experimental_solver libmamba
  2. As needed CONDA_EXPERIMENTAL_SOLVER=libmamba anaconda-project ...