-
Notifications
You must be signed in to change notification settings - Fork 11
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
Mamba #2
Comments
It's not so straightforward, there could be problems with installation and availability on different platforms. |
I suggest the following approach:
The happy path for creating an environment (without error handling) would look like this: "$CONDA_ROOT"/condabin/conda install mamba -n base -c conda-forge
"$CONDA_ROOT"/condabin/mamba install -f "$ENVIRONMENT_FILE" I just made up the Line 62 in 1c132b1
Let me know if you would accept a Pull Request implementing this design. Or if you would prefer a different design. Thanks. |
Thanks a lot for your input! One question (because I don't remember how things work exactly): if the user already has a global |
Thanks for writing these rules!
Yes, I tested it manually just to be sure. I have bazel aliased to $ cd path/to/my/bazel/repo/that/uses/rules_conda
$ bazel build //... # install local conda
$ conda env list # find the bazel conda root using my existing conda install
$ /var/tmp/gabrield_bazel_root/6886cfff64e6893fa4f77ca8f6b3d57a/external/conda/conda/condabin/conda install mamba -n base -c conda-forge
$ file /var/tmp/gabrield_bazel_root/6886cfff64e6893fa4f77ca8f6b3d57a/external/conda/conda/condabin/mamba
# outputs:
/var/tmp/gabrield_bazel_root/6886cfff64e6893fa4f77ca8f6b3d57a/external/conda/conda/condabin/mamba: symbolic link to `../bin/mamba' So mamba gets installed to the bazel cache. |
Alright, great, so that's not an issue. However, I see another one: we are setting up This complicates things because I don't remember any way of passing info between rules. The only workaround that comes to my mind is making a symlink with a constant name (let's say |
The only alternative I can think of is to have USE_MAMBA = True
load_conda(
install_mamba = USE_MAMBA,
mamba_version = "0.17.0",
quiet = False, # use True to hide conda output
version = "4.10.3", # optional, defaults to 4.10.3
)
conda_create(
name = "my_env",
use_mamba = USE_MAMBA,
timeout = 600, # each execute action can take up to 600 seconds
clean = False, # use True if you want to clean conda cache (less space taken, but slower subsequent builds)
environment = "@//:environment.yml", # label pointing to environment.yml file
quiet = False, # use True to hide conda output
) Pros:
Cons:
|
Ok, fine, let's do it that way. So:
If If Sounds good? |
Sorry for the late reply, I was sick. Yes, that sounds like a good plan. I will begin work on this sometime this week. I will open a PR when I have something to show. |
No problem, hope you are feeling better now. Matter of fact, I was sick too D:
Great, looking forward to it. No pressure though, as there is not much going on anyway, so it's done when it's done. And while you are at it, take a look at this: mamba-org/mamba#633. It might be that we need a little workaround to benefit from |
I recently discovered mamba as well and man is it fast! Related - perhaps this should be a separate issue - any interest in adding support for installing using miniforge and/or mambaforge? |
This is interesting. For now, let's keep the current flow (as |
Think about using
mamba
instead ofconda
. That might speed things up.The text was updated successfully, but these errors were encountered: