holoviz-topics / examples

Visualization-focused examples using HoloViz for specific topics
https://examples.holoviz.org
Creative Commons Attribution 4.0 International
84 stars 25 forks source link

anaconda-project generates different lock files on different systems #276

Closed sandhujasmine closed 1 month ago

sandhujasmine commented 1 year ago

This appears to be an issue with anaconda-project but logging it here since if effects this repo. Setting up the examples-gallery-manage environment per the docs gets version consistent version of anaconda-project on osx, and linux-64:

$ conda list anaconda-project
# packages in environment at /home/jsandhu/miniconda3/envs/examples-gallery-manage:
#
# Name                    Version                   Build  Channel
anaconda-project          0.11.1             pyhd8ed1ab_0    conda-forge

I generated a lock file on OSX, and two Linux boxes with 3 different results - specs below:

# OSX uname -a
Darwin Jasmines-MacBook-Pro.local 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000 arm64

# HP with GPUs - ubuntu 20.04:
Linux colo-hpz-01 5.8.0-48-generic #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

# Laptop running pop-os 22.04 (similar to ubuntu 22.04 AFAICT)
Linux pop-os 6.0.6-76060006-generic #202210290932~1667401208~22.04~d2df702 SMP PREEMPT_DYNAMIC Wed N x86_64 x86_64 x86_64 GNU/Linux
  1. Lock file generated on OSX: anaconda-project-lock-osx.yml.txt

  2. Lock file generated on HP Linux: anaconda-project-lock-hp-linux.yml.txt

  3. Lock file generated on linux laptop: anaconda-project-lock-linux.yml.txt

Prepare env on HP linux-64 using osx lock file from (1); similar to CI failures ``` $ anaconda-project prepare Collect all metadata (repodata.json): ...working... done Solving environment: ...working... failed LibMambaUnsatisfiableError: Encountered problems while solving: - nothing provides __osx needed by ipykernel-6.23.1-pyh736e0ef_0 - nothing provides __osx needed by terminado-0.17.1-pyhd1c38e8_0 - nothing provides __osx needed by ipython-8.14.0-pyhd1c38e8_0 - nothing provides __osx needed by ipykernel-6.23.1-pyh736e0ef_0 - nothing provides __osx needed by terminado-0.17.1-pyhd1c38e8_0 - nothing provides __osx needed by ipython-8.14.0-pyhd1c38e8_0 missing requirement to run this project: The project needs a Conda environment containing all required packages. '/home/jsandhu/examples/landsat/envs/default' doesn't look like it contains a Conda environment yet. (Use Ctrl+C to quit.) Value for DATA: ```
Prepare env on OSX using HP lock file from (2) ``` % anaconda-project prepare conda-forge/osx-arm64 Using cache conda-forge/noarch Using cache Collect all metadata (repodata.json): ...working... done Solving environment: ...working... failed LibMambaUnsatisfiableError: Encountered problems while solving: - nothing provides __linux needed by ipykernel-6.23.1-pyh210e3f2_0 - nothing provides __linux needed by ipython-8.14.0-pyh41d4057_0 - nothing provides __linux needed by send2trash-1.8.2-pyh41d4057_0 - nothing provides __linux needed by terminado-0.17.1-pyh41d4057_0 - nothing provides __linux needed by ipykernel-6.23.1-pyh210e3f2_0 - nothing provides __linux needed by ipython-8.14.0-pyh41d4057_0 - nothing provides __linux needed by send2trash-1.8.2-pyh41d4057_0 - nothing provides __linux needed by terminado-0.17.1-pyh41d4057_0 missing requirement to run this project: The project needs a Conda environment containing all required packages. '/Users/jasmine/projects/examples/landsat/envs/default' doesn't look like it contains a Conda environment yet. (Use Ctrl+C to quit.) Value for DATA: ```
AlbertDeFusco commented 1 year ago

You're using the landsat project, right? What does conda info return on each of these systems?

sandhujasmine commented 1 year ago

It is indeed the landsat project. The different versions of conda appears to be the culprit. Thank you @AlbertDeFusco I hadn't updated my conda versions and I see now that anaconda-project lock would use the base conda installation's API to do the solve, hence the difference, is that correct?

I updated conda to the latest on OSX, regenerated the lock file and it now passes on the CI linux instances, which is what was causing the odd failures for me previously.

Does it make sense to include a conda as a dependency in this env file: https://github.com/holoviz-topics/examples/blob/main/envs/environment.yml#L10 along with anaconda-project? Or would that lead to more issues and confusion? Or maybe document some troubleshooting tips to ensure conda version is the latest. End user should ideally use the same conda version that is being run on the CI system.

AlbertDeFusco commented 1 year ago

Interesting. 🤔 What version of conda was causing the problem on osx? Were you using an M1 or intel miniconda?

sandhujasmine commented 1 year ago

Aah - I'm sorry, I should've run conda info before trying things out. I do have the installers I used on OSX and the HP Linux system so I'll share the conda version from those

  1. Version on OSX: Miniconda3 py310_23.1.0-1
  2. On the HP: Miniconda3 py310_22.11.1-1
  3. On my linux-64 that built the previous lock file that worked on all 3 systems:

     (examples-gallery-manage) jasmine@pop-os:~/projects/examples/landsat$ conda info
    
         active environment : examples-gallery-manage
        active env location : /home/jasmine/miniconda3/envs/examples-gallery-manage
                shell level : 2
           user config file : /home/jasmine/.condarc
     populated config files : /home/jasmine/.condarc
              conda version : 22.9.0
        conda-build version : not installed
             python version : 3.9.13.final.0
           virtual packages : __linux=6.0.6=0
                              __glibc=2.35=0
                              __unix=0=0
                              __archspec=1=x86_64
           base environment : /home/jasmine/miniconda3  (writable)
          conda av data dir : /home/jasmine/miniconda3/etc/conda
      conda av metadata url : None
               channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                              https://conda.anaconda.org/conda-forge/noarch
                              https://repo.anaconda.com/pkgs/main/linux-64
                              https://repo.anaconda.com/pkgs/main/noarch
                              https://repo.anaconda.com/pkgs/r/linux-64
                              https://repo.anaconda.com/pkgs/r/noarch
              package cache : /home/jasmine/miniconda3/pkgs
                              /home/jasmine/.conda/pkgs
           envs directories : /home/jasmine/miniconda3/envs
                              /home/jasmine/.conda/envs
                   platform : linux-64
                 user-agent : conda/22.9.0 requests/2.31.0 CPython/3.9.13 Linux/6.0.6-76060006-generic pop/22.04 glibc/2.35
                    UID:GID : 1000:1000
                 netrc file : None
               offline mode : False
sandhujasmine commented 1 year ago

While the lock file that I generated on OSX w/ conda version 23.5.0 is able to create the env on linux-64 without an issue. I'm surprised to get slightly different packages when I use the same version of conda (see conda info output below) to generate lock file on the HP linux-64 machine vs OSX-M1.

Output of diff -y anaconda-project-lock-osx-latest-conda.yml anaconda-project-lock.yml: diff_osx-m1_hp-linux-64.txt

1. osx-m1 conda info after upgrade ``` (examples-gallery-manage-x) jasmine@Jasmines-MacBook-Pro landuse_classification % conda info active environment : examples-gallery-manage-x active env location : /Users/jasmine/miniconda3/envs/examples-gallery-manage-x shell level : 2 user config file : /Users/jasmine/.condarc populated config files : /Users/jasmine/.condarc conda version : 23.5.0 conda-build version : not installed python version : 3.10.9.final.0 virtual packages : __archspec=1=arm64 __osx=13.2.1=0 __unix=0=0 base environment : /Users/jasmine/miniconda3 (writable) conda av data dir : /Users/jasmine/miniconda3/etc/conda conda av metadata url : None channel URLs : https://conda.anaconda.org/pyviz/osx-arm64 https://conda.anaconda.org/pyviz/noarch https://repo.anaconda.com/pkgs/main/osx-arm64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/osx-arm64 https://repo.anaconda.com/pkgs/r/noarch https://conda.anaconda.org/conda-forge/osx-arm64 https://conda.anaconda.org/conda-forge/noarch package cache : /Users/jasmine/miniconda3/pkgs /Users/jasmine/.conda/pkgs envs directories : /Users/jasmine/miniconda3/envs /Users/jasmine/.conda/envs platform : osx-arm64 user-agent : conda/23.5.0 requests/2.29.0 CPython/3.10.9 Darwin/22.3.0 OSX/13.2.1 solver/libmamba conda-libmamba-solver/22.8.1 libmambapy/1.3.1 UID:GID : 502:20 netrc file : None offline mode : False ```
2. HP Linux-64 conda info after upgrade ``` (base) jsandhu@colo-hpz-01:~/examples/landsat$ conda info active environment : base active env location : /home/jsandhu/miniconda3 shell level : 2 user config file : /home/jsandhu/.condarc populated config files : /home/jsandhu/.condarc conda version : 23.5.0 conda-build version : not installed python version : 3.10.8.final.0 virtual packages : __archspec=1=x86_64 __cuda=11.7=0 __glibc=2.31=0 __linux=5.8.0=0 __unix=0=0 base environment : /home/jsandhu/miniconda3 (writable) conda av data dir : /home/jsandhu/miniconda3/etc/conda conda av metadata url : None channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/jsandhu/miniconda3/pkgs /home/jsandhu/.conda/pkgs envs directories : /home/jsandhu/miniconda3/envs /home/jsandhu/.conda/envs platform : linux-64 user-agent : conda/23.5.0 requests/2.29.0 CPython/3.10.8 Linux/5.8.0-48-generic ubuntu/20.04.2 glibc/2.31 solver/libmamba conda-libmamba-solver/22.8.1 libmambapy/1.1.0 UID:GID : 1007:1007 netrc file : None offline mode : False ```
maximlt commented 1 month ago

Closing as I'm pretty sure it was due to https://github.com/holoviz-topics/examples/issues/348