Skip to content

Commit

Permalink
Merge pull request #562 from HEXRD/packaging-use-libmamba
Browse files Browse the repository at this point in the history
Try using libmamba solver for conda packaging
  • Loading branch information
psavery authored Oct 16, 2023
2 parents bf02efc + 8647375 commit 11fae15
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/container_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ ${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
${HOME}/miniconda3/bin/conda config --set solver libmamba

# Install conda build and create output directory
${HOME}/miniconda3/bin/conda install --override-channels -c conda-forge conda-build -y
mkdir output
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:

- name: Install build requirements
run: |
# Change default solver to be libmamba, so that it runs much faster
conda install -n base -c conda-forge conda-libmamba-solver
conda config --set solver libmamba
conda activate hexrd
# FIXME: downgrade urllib3 until this issue is fixed:
# https://github.com/Anaconda-Platform/anaconda-client/issues/654
Expand All @@ -58,7 +62,16 @@ jobs:
if: ${{ matrix.config.name != 'Linux' }}
run: |
conda activate hexrd
# For some reason, we need to set this in the environment as well.
# It seems conda build sometimes needs the solver in the environment
# and sometimes in the base environment. I don't know why.
conda install -c conda-forge conda-libmamba-solver
conda config --env --set solver libmamba
mkdir output
# Conda build is ignoring the .condarc for some reason, so we need to
# set this environment variable instead.
# Setting this variable via `env` did not seem to work for some reason.
export CONDA_SOLVER=libmamba
conda build --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.
Expand Down

0 comments on commit 11fae15

Please sign in to comment.