Skip to content

Commit

Permalink
Try using libmamba solver for conda packaging
Browse files Browse the repository at this point in the history
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 <patrick.avery@kitware.com>
  • Loading branch information
psavery committed Oct 10, 2023
1 parent 4bb01a1 commit 2cf3813
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/container_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
6 changes: 4 additions & 2 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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}
Expand Down

0 comments on commit 2cf3813

Please sign in to comment.