Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conda-solver option #291

Merged
merged 12 commits into from
Nov 25, 2023
Merged

Add conda-solver option #291

merged 12 commits into from
Nov 25, 2023

Conversation

jaimergp
Copy link
Member

Github Actions runners now ship Miniconda 23.5.2, which bundles conda-libmamba-solver (although it's not enabled by default). conda will switch to libmamba as the new default solver soon, so we better be prepared and provide configurability here to (A) opt-in already, (B) opt-out if it doesn't work.

@@ -14,9 +14,6 @@ export const updateMamba: types.IToolProvider = {
provides: async (inputs, options) =>
inputs.mambaVersion !== "" || options.mambaInInstaller,
toolPackages: async (inputs, options) => {
core.warning(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So mamba support is no longer experimental?

Should we still warn about "differently solved environments!" @jaimergp ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point I'd expect people to know enough about it.

Copy link
Member

@goanpeca goanpeca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaimergp just to double check, are the options being automatically used with the solver, or do we need to update the code to actually include the use of such option? 🤔

@jaimergp
Copy link
Member Author

jaimergp commented Oct 3, 2023

conda will take the solver from .condarc, so I think that's all we need. You can see in the logs how it's already in use (that kind of channels, platform output is libmamba only).

@tobiasdiez
Copy link

Any update on this one here? Would be nice to be able to use the new conda solver!

@jaimergp
Copy link
Member Author

Hi @tobiasdiez, in the meantime, you can use CONDA_SOLVER (env var). It will only apply to the jobs you are using it on, though (it's not a persistent configuration like conda-solver), but should be enough to get you started:

      - uses: conda-incubator/setup-miniconda@v2
        env:
          CONDA_SOLVER: libmamba
        with:
          auto-update-conda: true
          python-version: "3.9"

@goanpeca
Copy link
Member

@jaimergp is the failing test related to this change? 🤔

@jaimergp
Copy link
Member Author

@goanpeca - not our fault. Both conda and micromamba fail to accept the offending file:

$ micromamba env create -f etc/example-empty-channels-environment.yml
info     libmamba ****************** Backtrace Start ******************
debug    libmamba Loading configuration
trace    libmamba Compute configurable 'create_base'
trace    libmamba Compute configurable 'no_env'
trace    libmamba Compute configurable 'no_rc'
trace    libmamba Compute configurable 'rc_files'
trace    libmamba Compute configurable 'root_prefix'
trace    libmamba Get RC files configuration from locations up to HomeDir
trace    libmamba Configuration not found at '/Users/jrodriguez/.mambarc'
trace    libmamba Configuration found at '/Users/jrodriguez/.condarc'
trace    libmamba Configuration not found at '/Users/jrodriguez/.conda/condarc.d'
trace    libmamba Configuration not found at '/Users/jrodriguez/.conda/condarc'
trace    libmamba Configuration not found at '/Users/jrodriguez/.conda/.condarc'
trace    libmamba Configuration not found at '/Users/jrodriguez/micromamba/.mambarc'
trace    libmamba Configuration not found at '/Users/jrodriguez/micromamba/condarc.d'
trace    libmamba Configuration not found at '/Users/jrodriguez/micromamba/condarc'
trace    libmamba Configuration not found at '/Users/jrodriguez/micromamba/.condarc'
trace    libmamba Configuration not found at '/var/lib/conda/.mambarc'
trace    libmamba Configuration not found at '/var/lib/conda/condarc.d/'
trace    libmamba Configuration not found at '/var/lib/conda/condarc'
trace    libmamba Configuration not found at '/var/lib/conda/.condarc'
trace    libmamba Configuration not found at '/etc/conda/.mambarc'
trace    libmamba Configuration not found at '/etc/conda/condarc.d/'
trace    libmamba Configuration not found at '/etc/conda/condarc'
trace    libmamba Configuration not found at '/etc/conda/.condarc'
trace    libmamba Update configurable 'no_env'
trace    libmamba Compute configurable 'file_specs'
error    libmamba Could not read 'channels' as vector of strings from '/Users/jrodriguez/devel/setup-miniconda/etc/example-empty-channels-environment.yml'
critical libmamba yaml-cpp: error at line 5, column 1: bad conversion
info     libmamba ****************** Backtrace End ********************
$ conda env create -f etc/example-empty-channels-environment.yml
Retrieving notices: ...working... done

SpecNotFound: /Users/jrodriguez/devel/setup-miniconda/etc/example-empty-channels-environment.yml is not a valid yaml file.

That test should be expected to fail. Maybe old versions supported that, but not anymore. So either a bug to report or something not supported anymore, but nothing we need to do on our side to handle it (other than xfail/remove the test).

@goanpeca goanpeca changed the base branch from main to develop November 14, 2023 21:36
@goanpeca
Copy link
Member

goanpeca commented Nov 14, 2023

@jaimergp could you update/rebase the PR. It seems some of the other PR merges are causing this one to have conflicts

Done

@goanpeca goanpeca marked this pull request as draft November 14, 2023 21:37
@goanpeca goanpeca self-assigned this Nov 14, 2023
@goanpeca goanpeca marked this pull request as ready for review November 14, 2023 22:10
@goanpeca goanpeca marked this pull request as draft November 14, 2023 22:52
Base automatically changed from develop to main November 22, 2023 18:22
@dbast
Copy link
Member

dbast commented Nov 23, 2023

libmamba is the default solver for conda since version 23.10.0 and miniconda3 23.10.0 ... so the new standard / reality is lib/mamba and users get used to it... do we still want this option to be able to switch to the old solver OR should we skip the option for the sake of less configuration hell and test-combination explosion?... users can also switch to the old solver by requesting an old miniconda3.

@jaimergp The PR looks good and is all green. Do you still want it? Merge or close it?

@dbast dbast marked this pull request as ready for review November 23, 2023 14:22
@dbast dbast merged commit 8874247 into main Nov 25, 2023
54 checks passed
@dbast dbast deleted the conda-solver branch November 25, 2023 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants