setup-miniconda: Setup conda step takes too long

Thank you for creating/maintaining this great Action!

It seems that setting up conda alone takes longer than usual. For example, take a look at this log, the “Set up conda” step. It takes 3 and a half minutes setting up conda (excluding the installation of dependencies). Is that expected or am I doing something wrong?

Thank you once again!

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

There are a lot more moving pieces coming up now than just use what’s on disk vs get an installer from a URL with a scheme we’ve been able to predict for half a decade, and the current code’s behavior w/r/t to mamba is hard to reason about.

I’ll wager, if you provide a mamba-version, it’s still going to try to install mamba from conda-forge, even if it’s already there, and still use conda for everything except the environment solve (e.g. conda config). These would defeat most gains of already having it on-disk, post-installer. Since such an installer with mamba didn’t exist until 13 hours ago, this wasn’t a problem… my thinking is we’ll likely need something like conda-exe: mamba if you know it’s already installed, as even if it is available, you might not want to use it, and tomorrow there may well be The Next Tool (lambada, tarantala) from The Next Installer.

Anyhow, I felt fixing some of these issues requires some pretty drastic restructuring… on #107 (which is becoming #108, #109, … pending review) I made a best effort attempt at getting us set up for The Next X, where X can be a one/two file PR. Hopefully we can get to where we can start adding features and addressing performance, but I fear not addressing the current technical debt first is going to make the situation worse.

I confirm the recently released MambaForge installer makes the CI faster:

- name: Setup conda
  uses: conda-incubator/setup-miniconda@v2
  with:
    installer-url: https://github.com/conda-forge/miniforge/releases/download/4.9.2-2/Mambaforge-Linux-x86_64.sh
    channel-priority: true
    use-only-tar-bz2: true
    activate-environment: my-env

- name: Anaconda Login
  run: |
    # Bypass the installation of anaconda-client
    TOKEN_DIR="$HOME/.config/binstar"
    TOKEN_PATH="$TOKEN_DIR/https%3A%2F%2Fapi.anaconda.org.token"
    mkdir -p $TOKEN_DIR
    echo -e "${ANACONDA_USER_TOKEN}\c" > $TOKEN_PATH

- name: Install Dependencies
  run: mamba env update -f env.yml

(the snippet also includes a way to login to anaconda without the need to install anaconda-client. Could be helpful for some here.)

Good question and I actually don’t know. The new installer ships mamba by default and I use directly without mamba-version.

I need to first login to anaconda first (see snippet) so I don’t rely on setup-conda to install my env.

I guess if you want to use setup-conda to install an env file, setup-conda should be modified to indeed check for mamba and bypass its installation if it exists.

Maybe someone from @conda-incubator/setup-miniconda-team can confirm or not?

Thanks @hadim for the example. Will add a PR to check the changes that introduced the regression.