ReproNim / reproman

ReproMan (AKA NICEMAN, AKA ReproNim TRD3)
https://reproman.readthedocs.io
Other
24 stars 14 forks source link

CondaDistribution forms incorrect url for Conda installation #586

Closed asmacdo closed 1 year ago

asmacdo commented 1 year ago

https://github.com/ReproNim/reproman/blob/master/reproman/distributions/conda.py#L88-L89

For example

get_miniconda_url(python_version="3.8.2", sys.platform="linux") 
>> https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

Looking at the script...

    15 # Export variables to make installer metadata available to pre/post install scripts                                                                   
    16 # NOTE: If more vars are added, make sure to update the examples/scripts tests too                                                                    
    17 export INSTALLER_NAME="Miniconda3"                                                                                                                    
    18 export INSTALLER_VER="py310_22.11.1-1"                                                                                                                
    19 export INSTALLER_PLAT="linux-64"                                                                                                                      
    20 export INSTALLER_TYPE="SH"     

FWIW Miniconda3-latest-Linux-x86_64.sh has not been rebuilt since 2019

For python3.8 on linux, the correct installer should be: Miniconda3-py38_4.12.0-Linux-x86_64.sh

This appears to be the cause of this failure:

reproman/distributions/tests/test_conda.py::test_conda_init_install_and_detect
yarikoptic commented 1 year ago

FWIW Miniconda3-latest-Linux-x86_64.sh has not been rebuilt since 2019

interesting! that page lists it

Miniconda3-latest-Linux-x86_64.sh 69.0M 2022-12-22 16:32:36

so - updated recently... how did you get 2019?

NB there is indeed

Miniconda3-latest-Linux-x86.sh 62.7M 2019-01-02 10:05:14

though

asmacdo commented 1 year ago

Oops, thats correct, I was looking at x86. However this is not reliable because this does not differentiate between python versions. Since get_miniconda_url accepts a python version, the url should be formatted like https://repo.anaconda.com/miniconda/Miniconda3-py39_22.11.1-1-Linux-x86_64.sh

In our tests, Miniconda3-latest-Linux-x86_64.sh is returned when specifying Python3.8, however that script installs 3.10.

yarikoptic commented 1 year ago

yes ! Could you try on what would happen in you use that installer or even better https://repo.anaconda.com/miniconda/Miniconda3-py38_22.11.1-1-Linux-x86_64.sh and see if that test passes?

if so -- if python version is provided, ideally we should try using / downloading script with that version in URL, if absent -- then with latest. But since there is no https://repo.anaconda.com/miniconda/Miniconda3-py39_latest-Linux-x86_64.sh we would need to write a little helper which would download the index (https://repo.anaconda.com/miniconda/) locally and scrape for available versions per python. But again -- not sure how needed ATM. Let's may be just have ad-hoc custom mapping of hardcoded urls for those python versions we care about and otherwise use latest.

asmacdo commented 1 year ago

latest push uses the more descriptive URL and passes!

I still need to expand the unit tests for other architectures, particularly the 64/32 bit logic looks like it might break.

https://github.com/asmacdo/reproman/commit/03f00fd63be7174763a7bffd72e67aa33889e4e1#diff-cf5732a7eaba17cbcba0bc0d4e1edae44e267c473905d960f71b55c17f742014R90

asmacdo commented 1 year ago

@yarikoptic I'll look into "defaulting" to latest, but it seems like this will lead to unreproducible situations. Would it not be better to require python version?

asmacdo commented 1 year ago

Closed by https://github.com/ReproNim/reproman/pull/584