From 2cf3813778e8c5b51ebfbf7e65fcb64b54befbe4 Mon Sep 17 00:00:00 2001 From: Patrick Avery Date: Tue, 10 Oct 2023 13:30:41 -0500 Subject: [PATCH] Try using libmamba solver for conda packaging It is [officially supported by conda](https://www.anaconda.com/blog/conda-is-fast-now), and it is significantly faster. Before this commit, Windows packaging usually takes 1 hour and 15 minutes. Mac packaging usually takes about 45 minutes. Linux usually takes about 35 minutes. We'll see if there are any noticeable differences. Signed-off-by: Patrick Avery --- .github/workflows/container_build.sh | 7 +++++-- .github/workflows/package.yml | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/container_build.sh b/.github/workflows/container_build.sh index 9c2911edf..5eb0c9615 100755 --- a/.github/workflows/container_build.sh +++ b/.github/workflows/container_build.sh @@ -21,9 +21,12 @@ ${HOME}/miniconda3/bin/conda create --override-channels -c conda-forge -y -n hex ${HOME}/miniconda3/bin/activate hexrd ${HOME}/miniconda3/bin/conda activate hexrd +# Install the libmamba solver (it is much faster) +${HOME}/miniconda3/bin/conda install -n base -c conda-forge conda-libmamba-solver + # Install conda build and create output directory -${HOME}/miniconda3/bin/conda install --override-channels -c conda-forge conda-build -y +${HOME}/miniconda3/bin/conda install --solver libmamba --override-channels -c conda-forge conda-build -y mkdir output # Build the package -${HOME}/miniconda3/bin/conda build --override-channels -c conda-forge --output-folder output/ conda.recipe/ +${HOME}/miniconda3/bin/conda build --solver libmamba --override-channels -c conda-forge --output-folder output/ conda.recipe/ diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index b959c9470..82a2fd575 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -46,9 +46,11 @@ jobs: - name: Install build requirements run: | conda activate hexrd + # Change default solver to be libmamba, so that it runs much faster + conda install -n base -c conda-forge conda-libmamba-solver # FIXME: downgrade urllib3 until this issue is fixed: # https://github.com/Anaconda-Platform/anaconda-client/issues/654 - conda install --override-channels -c conda-forge anaconda-client conda-build conda 'urllib3<2.0.0' + conda install --solver libmamba --override-channels -c conda-forge anaconda-client conda-build conda 'urllib3<2.0.0' # This is need to ensure ~/.profile or ~/.bashrc are used so the activate # command works. @@ -59,7 +61,7 @@ jobs: run: | conda activate hexrd mkdir output - conda build --override-channels -c conda-forge --output-folder output/ conda.recipe/ + conda build --solver libmamba --override-channels -c conda-forge --output-folder output/ conda.recipe/ # This is need to ensure ~/.profile or ~/.bashrc are used so the activate # command works. shell: bash -l {0}