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

Replace conda with mamba #7227

Merged
merged 24 commits into from
Mar 29, 2021
Merged

Replace conda with mamba #7227

merged 24 commits into from
Mar 29, 2021

Conversation

crusaderky
Copy link
Collaborator

@crusaderky crusaderky commented Feb 16, 2021

Shave 2 minutes off each CI workflow
Blocked by #7383

@@ -18,7 +18,8 @@ jobs:
- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
mamba-version: "*"
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably useful to have a look at the master of the setup-miniconda actions and use miniforge-variant: Mambaforge. This gives you a base environment with mamba pre-installed and conda-forge as a channel.

Copy link
Contributor

Choose a reason for hiding this comment

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

They are only yet available on master, not on v2. If they also work here well, setup-miniconda could do a new release to have them available in a stable fashion.

Copy link
Collaborator Author

@crusaderky crusaderky Feb 17, 2021

Choose a reason for hiding this comment

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

(ignore; I was still using @v2)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it works now, thanks

@crusaderky
Copy link
Collaborator Author

There is a mamba-specific bug on MacOS Python 3.6 / numpy 1.15:

    try:
>       import scipy.stats
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   from .stats import *
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
>   from scipy.spatial.distance import cdist

../../../miniconda3/envs/test-environment/lib/python3.6/site-packages/scipy/stats/stats.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   from .qhull import *
E   ImportError: dlopen(/Users/runner/miniconda3/envs/test-environment/lib/python3.6/site-packages/scipy/spatial/qhull.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libopenblas.dylib
E     Referenced from: /Users/runner/miniconda3/envs/test-environment/lib/python3.6/site-packages/scipy/spatial/qhull.cpython-36m-darwin.so
E     Reason: image not found

../../../miniconda3/envs/test-environment/lib/python3.6/site-packages/scipy/spatial/__init__.py:98: ImportError

I'm parking this PR for now and I'm going to retest it after dropping Python 3.6

@mrocklin
Copy link
Member

mrocklin commented Feb 17, 2021 via email

@jakirkham
Copy link
Member

Would suggest not using @master as future changes could break this workflow. If we want to use this functionality, would suggest raising an issue on that repo asking for a new tag.

@xhochy
Copy link
Contributor

xhochy commented Feb 17, 2021

Raised this in conda-incubator/setup-miniconda#106 (comment)

@@ -16,9 +16,11 @@ jobs:
uses: actions/checkout@v2

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@master
Copy link
Contributor

Choose a reason for hiding this comment

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

If you want this now, you can pin this to a commit:

Suggested change
uses: conda-incubator/setup-miniconda@master
uses: conda-incubator/setup-miniconda@77b16ed746da28724c61e1f1ad23395a4b695ef5

and then make a follow up PR when a new version gets tagged.

Base automatically changed from master to main March 8, 2021 20:19
@crusaderky
Copy link
Collaborator Author

@crusaderky crusaderky changed the title WIP replace conda with mamba Replace conda with mamba Mar 12, 2021
@crusaderky crusaderky changed the title Replace conda with mamba Replace conda with mamba; bump numpy to >=1.16 Mar 12, 2021
@crusaderky
Copy link
Collaborator Author

mamba is broken on numpy 1.15 regardless of Python version; see above.

@crusaderky crusaderky marked this pull request as ready for review March 12, 2021 15:54
@crusaderky
Copy link
Collaborator Author

I've split out the bump to numpy 1.16 into a separate PR, which is now a dependency of this one: #7383

@crusaderky crusaderky changed the title Replace conda with mamba; bump numpy to >=1.16 Replace conda with mamba Mar 13, 2021
Comment on lines +12 to 14
# FIXME https://github.com/mamba-org/mamba/issues/412
# mamba uninstall --force numpy pandas
conda uninstall --force numpy pandas
Copy link
Member

Choose a reason for hiding this comment

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

@crusaderky
Copy link
Collaborator Author

@jrbourbeau ready for merge. Weirdly, unlike in dask/distributed I don't need to specify the channels in the workflow.

@jrbourbeau jrbourbeau merged commit cb34b29 into dask:main Mar 29, 2021
@crusaderky crusaderky deleted the mamba branch March 29, 2021 21:53
@wolfv
Copy link

wolfv commented Mar 30, 2021

@crusaderky cool to see this! Any info on what is broken with mamba / numpy 1.15? is it mamba or broken metadata or numpy? If there is something we can fix in mamba, please let us know!

@crusaderky
Copy link
Collaborator Author

crusaderky commented Mar 30, 2021

@wolfv https://github.com/dask/dask/runs/2101922250

>   import scipy.stats
>   from .stats import *
>   from scipy.spatial.distance import cdist
>   from .qhull import *
E   ImportError: dlopen(/Users/runner/miniconda3/envs/test-environment/lib/python3.7/site-packages/scipy/spatial/qhull.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libopenblas.dylib
E     Referenced from: /Users/runner/miniconda3/envs/test-environment/lib/python3.7/site-packages/scipy/spatial/qhull.cpython-37m-darwin.so
E     Reason: image not found

this happens on MacOSX only, and only on mamba. conda list output is linked above.

@wolfv
Copy link

wolfv commented Mar 30, 2021

Ok, looks like mixing defaults & conda-forge channels.
Any reason for keeping defaults in there?

Otherwise, at least using strict-channel priority should help (as recommended by conda-forge).

@crusaderky
Copy link
Collaborator Author

@wolfv the exact same environment file works fine with conda.
defaults are there as a fallback for the cases when there isn't a package in conda-forge

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.

7 participants