setup-miniconda
setup-miniconda copied to clipboard
Handle: Bundled Miniconda not found! and provide a warning and default installation
hi! congrats for this package - it's really helpful.
we are using it in kornia
for building our CI pipeline and we are facing some issues with the setup for a self-hosted device.
In particular we have the following error:
https://github.com/kornia/kornia/runs/1448438566?check_suite_focus=true
The .yml
used to define this workflow can be found here:
https://github.com/kornia/kornia/blob/master/.github/workflows/tests_cuda.yml
Thanks in advance,
Hi @edgarriba, thanks for the kind words and the report :)
So Github runners come with a bundled miniconda already installed on different locations (depending on the OS system) so your self hosted runners should have a miniconda available at the $CONDA
environment variable.
In the meantime you could define an specific version of miniconda to use to force the download and install of miniconda (will take a bit longer, but it should solve the issue)
Something like:
with:
miniconda-version: "latest"
Could you please check?
This is a very specific use case, but maybe we could check for existence and then download if not found what do you @conda-incubator/setup-miniconda-team think?
Not sure about the automated download. Which one would we default to? latest
? Or should we try to provide the same as bundled?
The safest thing would be error + suggestion, I think? Like:
"Oops, $CONDA does not exist! Is this a self-hosted runner? You might want to use
miniconda-version: "latest"
option to automatically download and install latest one."
@goanpeca worked like a charm - thanks so much for the help :)
Glad to be of help @edgarriba.
Will open just to continue the discussion of what could be a good option for these cases :)
Not sure about the automated download. Which one would we default to? latest? Or should we try to provide the same as bundled?
Good question... I guess we could raise a warning, like,
Bundled CONDA not found, downloading latest miniconda, if you want an specific version of miniconda, please use the
miniconda-version: ...
key.
The warning ensure they can either specifiy a version (which is a better solution) but be aware that something is out of the ordinary. But we can still function gracefully :)
Wanna work on this one @jaimergp :) ?
Sure. I'll wait until #107 et al are merged though!
I encountered the same problem, and fixed it by supplying the CONDA
env var, though I'd share. So part of the actions yaml looks like:
...
- name: Setup Conda dependencies
uses: conda-incubator/setup-miniconda@v2
env:
CONDA: /home/your_name/miniconda3
with:
activate-environment: your_conda
environment-file: environment.yml
python-version: 3.9.1
auto-activate-base: false
...
Hi @kengz thanks for sharing!