conda-forge / mpi-feedstock

A conda-smithy repository for mpi.
BSD 3-Clause "New" or "Revised" License
0 stars 8 forks source link

InvalidSpec: The package "conda-forge/noarch::mpi==1.0=openmpi" is not available for the specified platform #17

Open swryan opened 2 months ago

swryan commented 2 months ago

Solution to issue cannot be found in the documentation.

Issue

We started getting this error on our CI workflows within the last 12 hours.

InvalidSpec: The package "conda-forge/noarch::mpi==1.0=openmpi" is not available for the specified platform

Tried with mpich and got a similar error:

conda.exceptions.InvalidSpec: The package "conda-forge/noarch::mpi==1.0=mpich" is not available for the specified platform

The output below is from my local workstation.. but we see the same issues on GitHub images.

Appreciate any info/suggestions. Thanks!

$ conda create -n mpi python=3 numpy scipy cython swig
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

==> WARNING: A newer version of conda exists. <==
    current version: 24.5.0
    latest version: 24.7.1

Please update conda by running

    $ conda update -n base -c conda-forge conda

## Package Plan ##

  environment location: /home/swryan/miniconda3/envs/mpi

  added / updated specs:
    - cython
    - numpy
    - python=3
    - scipy
    - swig

The following NEW packages will be INSTALLED:

  _libgcc_mutex      conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge
  _openmp_mutex      conda-forge/linux-64::_openmp_mutex-4.5-2_gnu
  bzip2              conda-forge/linux-64::bzip2-1.0.8-h4bc722e_7
  ca-certificates    conda-forge/linux-64::ca-certificates-2024.8.30-hbcca054_0
  cython             conda-forge/linux-64::cython-3.0.11-py312h8fd2918_3
  ld_impl_linux-64   conda-forge/linux-64::ld_impl_linux-64-2.43-h712a8e2_1
  libblas            conda-forge/linux-64::libblas-3.9.0-24_linux64_openblas
  libcblas           conda-forge/linux-64::libcblas-3.9.0-24_linux64_openblas
  libexpat           conda-forge/linux-64::libexpat-2.6.3-h5888daf_0
  libffi             conda-forge/linux-64::libffi-3.4.2-h7f98852_5
  libgcc             conda-forge/linux-64::libgcc-14.1.0-h77fa898_1
  libgcc-ng          conda-forge/linux-64::libgcc-ng-14.1.0-h69a702a_1
  libgfortran        conda-forge/linux-64::libgfortran-14.1.0-h69a702a_1
  libgfortran-ng     conda-forge/linux-64::libgfortran-ng-14.1.0-h69a702a_1
  libgfortran5       conda-forge/linux-64::libgfortran5-14.1.0-hc5f4f2c_1
  libgomp            conda-forge/linux-64::libgomp-14.1.0-h77fa898_1
  liblapack          conda-forge/linux-64::liblapack-3.9.0-24_linux64_openblas
  libnsl             conda-forge/linux-64::libnsl-2.0.1-hd590300_0
  libopenblas        conda-forge/linux-64::libopenblas-0.3.27-pthreads_hac2b453_1
  libsqlite          conda-forge/linux-64::libsqlite-3.46.1-hadc24fc_0
  libstdcxx          conda-forge/linux-64::libstdcxx-14.1.0-hc0a3c3a_1
  libstdcxx-ng       conda-forge/linux-64::libstdcxx-ng-14.1.0-h4852527_1
  libuuid            conda-forge/linux-64::libuuid-2.38.1-h0b41bf4_0
  libxcrypt          conda-forge/linux-64::libxcrypt-4.4.36-hd590300_1
  libzlib            conda-forge/linux-64::libzlib-1.3.1-h4ab18f5_1
  ncurses            conda-forge/linux-64::ncurses-6.5-he02047a_1
  numpy              conda-forge/linux-64::numpy-2.1.1-py312h58c1407_0
  openssl            conda-forge/linux-64::openssl-3.3.2-hb9d3cd8_0
  pcre2              conda-forge/linux-64::pcre2-10.44-hba22ea6_2
  pip                conda-forge/noarch::pip-24.2-pyh8b19718_1
  python             conda-forge/linux-64::python-3.12.6-hc5c86c4_1_cpython
  python_abi         conda-forge/linux-64::python_abi-3.12-5_cp312
  readline           conda-forge/linux-64::readline-8.2-h8228510_1
  scipy              conda-forge/linux-64::scipy-1.14.1-py312h7d485d2_0
  setuptools         conda-forge/noarch::setuptools-75.1.0-pyhd8ed1ab_0
  swig               conda-forge/linux-64::swig-4.2.1-hfb18ccb_1
  tk                 conda-forge/linux-64::tk-8.6.13-noxft_h4845f30_101
  tzdata             conda-forge/noarch::tzdata-2024a-h8827d51_1
  wheel              conda-forge/noarch::wheel-0.44.0-pyhd8ed1ab_0
  xz                 conda-forge/linux-64::xz-5.2.6-h166bdaf_0

Proceed ([y]/n)?

Downloading and Extracting Packages:

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate mpi
#
# To deactivate an active environment, use
#
#     $ conda deactivate

$ conda activate mpi
$ conda install cython compilers openmpi-mpicc
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

==> WARNING: A newer version of conda exists. <==
    current version: 24.5.0
    latest version: 24.7.1

Please update conda by running

    $ conda update -n base -c conda-forge conda

## Package Plan ##

  environment location: /home/swryan/miniconda3/envs/mpi

  added / updated specs:
    - compilers
    - cython
    - openmpi-mpicc

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    binutils-2.43              |       h4852527_1          33 KB  conda-forge
    binutils_impl_linux-64-2.43|       h4bf12b8_1         5.9 MB  conda-forge
    binutils_linux-64-2.43     |       h4852527_1          34 KB  conda-forge
    gcc-12.4.0                 |       h236703b_1          53 KB  conda-forge
    gcc_impl_linux-64-12.4.0   |       hb2e57f8_1        59.2 MB  conda-forge
    gcc_linux-64-12.4.0        |       h6b7512a_4          31 KB  conda-forge
    gfortran-12.4.0            |       h236703b_1          52 KB  conda-forge
    gfortran_impl_linux-64-12.4.0|       hc568b83_1        14.7 MB  conda-forge
    gfortran_linux-64-12.4.0   |       hd748a6a_4          30 KB  conda-forge
    gxx-12.4.0                 |       h236703b_1          52 KB  conda-forge
    gxx_impl_linux-64-12.4.0   |       h613a52c_1        12.1 MB  conda-forge
    gxx_linux-64-12.4.0        |       h8489865_4          30 KB  conda-forge
    kernel-headers_linux-64-3.10.0|      he073ed8_17         923 KB  conda-forge
    libgcc-devel_linux-64-12.4.0|     ha4f9413_101         2.4 MB  conda-forge
    libsanitizer-12.4.0        |       h46f95d5_1         3.8 MB  conda-forge
    libstdcxx-devel_linux-64-12.4.0|     ha4f9413_101        11.3 MB  conda-forge
    mpi-1.0                    |          openmpi           6 KB  conda-forge
    sysroot_linux-64-2.17      |      h4a8ded7_17        14.4 MB  conda-forge
    ------------------------------------------------------------
                                           Total:       125.1 MB

The following NEW packages will be INSTALLED:

  binutils           conda-forge/linux-64::binutils-2.43-h4852527_1
  binutils_impl_lin~ conda-forge/linux-64::binutils_impl_linux-64-2.43-h4bf12b8_1
  binutils_linux-64  conda-forge/linux-64::binutils_linux-64-2.43-h4852527_1
  c-compiler         conda-forge/linux-64::c-compiler-1.7.0-hd590300_1
  compilers          conda-forge/linux-64::compilers-1.7.0-ha770c72_1
  cxx-compiler       conda-forge/linux-64::cxx-compiler-1.7.0-h00ab1b0_1
  fortran-compiler   conda-forge/linux-64::fortran-compiler-1.7.0-heb67821_1
  gcc                conda-forge/linux-64::gcc-12.4.0-h236703b_1
  gcc_impl_linux-64  conda-forge/linux-64::gcc_impl_linux-64-12.4.0-hb2e57f8_1
  gcc_linux-64       conda-forge/linux-64::gcc_linux-64-12.4.0-h6b7512a_4
  gfortran           conda-forge/linux-64::gfortran-12.4.0-h236703b_1
  gfortran_impl_lin~ conda-forge/linux-64::gfortran_impl_linux-64-12.4.0-hc568b83_1
  gfortran_linux-64  conda-forge/linux-64::gfortran_linux-64-12.4.0-hd748a6a_4
  gxx                conda-forge/linux-64::gxx-12.4.0-h236703b_1
  gxx_impl_linux-64  conda-forge/linux-64::gxx_impl_linux-64-12.4.0-h613a52c_1
  gxx_linux-64       conda-forge/linux-64::gxx_linux-64-12.4.0-h8489865_4
  icu                conda-forge/linux-64::icu-75.1-he02047a_0
  kernel-headers_li~ conda-forge/noarch::kernel-headers_linux-64-3.10.0-he073ed8_17
  libevent           conda-forge/linux-64::libevent-2.1.12-hf998b51_1
  libgcc-devel_linu~ conda-forge/noarch::libgcc-devel_linux-64-12.4.0-ha4f9413_101
  libhwloc           conda-forge/linux-64::libhwloc-2.9.3-default_h554bfaf_1009
  libiconv           conda-forge/linux-64::libiconv-1.17-hd590300_2
  libnl              conda-forge/linux-64::libnl-3.10.0-h4bc722e_0
  libsanitizer       conda-forge/linux-64::libsanitizer-12.4.0-h46f95d5_1
  libstdcxx-devel_l~ conda-forge/noarch::libstdcxx-devel_linux-64-12.4.0-ha4f9413_101
  libxml2            conda-forge/linux-64::libxml2-2.12.7-he7c6b58_4
  mpi                conda-forge/noarch::mpi-1.0-openmpi
  openmpi            conda-forge/linux-64::openmpi-5.0.1-hb0ee255_100
  openmpi-mpicc      conda-forge/linux-64::openmpi-mpicc-5.0.1-hd590300_100
  sysroot_linux-64   conda-forge/noarch::sysroot_linux-64-2.17-h4a8ded7_17

Proceed ([y]/n)?

Downloading and Extracting Packages:

Preparing transaction: done
Verifying transaction: done
Executing transaction: /
On Linux, Open MPI is built with UCX support but it is disabled by default.
To enable it, first install UCX (conda install -c conda-forge ucx).
Afterwards, set the environment variables
OMPI_MCA_pml=ucx OMPI_MCA_osc=ucx
before launching your MPI processes.
Equivalently, you can set the MCA parameters in the command line:
mpiexec --mca pml ucx --mca osc ucx ...

On Linux, Open MPI is built with CUDA awareness but it is disabled by default.
To enable it, please set the environment variable
OMPI_MCA_opal_cuda_support=true
before launching your MPI processes.
Equivalently, you can set the MCA parameter in the command line:
mpiexec --mca opal_cuda_support 1 ...
Note that you might also need to set UCX_MEMTYPE_CACHE=n for CUDA awareness via
UCX. Please consult UCX documentation for further details.

done
$ conda install mpi4py
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: failed

InvalidSpec: The package "conda-forge/noarch::mpi==1.0=openmpi" is not available for the specified platform

Installed packages

$ conda list
# packages in environment at /home/swryan/miniconda3/envs/mpi:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
binutils                  2.43                 h4852527_1    conda-forge
binutils_impl_linux-64    2.43                 h4bf12b8_1    conda-forge
binutils_linux-64         2.43                 h4852527_1    conda-forge
bzip2                     1.0.8                h4bc722e_7    conda-forge
c-compiler                1.7.0                hd590300_1    conda-forge
ca-certificates           2024.8.30            hbcca054_0    conda-forge
compilers                 1.7.0                ha770c72_1    conda-forge
cxx-compiler              1.7.0                h00ab1b0_1    conda-forge
cython                    3.0.11          py312h8fd2918_3    conda-forge
fortran-compiler          1.7.0                heb67821_1    conda-forge
gcc                       12.4.0               h236703b_1    conda-forge
gcc_impl_linux-64         12.4.0               hb2e57f8_1    conda-forge
gcc_linux-64              12.4.0               h6b7512a_4    conda-forge
gfortran                  12.4.0               h236703b_1    conda-forge
gfortran_impl_linux-64    12.4.0               hc568b83_1    conda-forge
gfortran_linux-64         12.4.0               hd748a6a_4    conda-forge
gxx                       12.4.0               h236703b_1    conda-forge
gxx_impl_linux-64         12.4.0               h613a52c_1    conda-forge
gxx_linux-64              12.4.0               h8489865_4    conda-forge
icu                       75.1                 he02047a_0    conda-forge
kernel-headers_linux-64   3.10.0              he073ed8_17    conda-forge
ld_impl_linux-64          2.43                 h712a8e2_1    conda-forge
libblas                   3.9.0           24_linux64_openblas    conda-forge
libcblas                  3.9.0           24_linux64_openblas    conda-forge
libevent                  2.1.12               hf998b51_1    conda-forge
libexpat                  2.6.3                h5888daf_0    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc                    14.1.0               h77fa898_1    conda-forge
libgcc-devel_linux-64     12.4.0             ha4f9413_101    conda-forge
libgcc-ng                 14.1.0               h69a702a_1    conda-forge
libgfortran               14.1.0               h69a702a_1    conda-forge
libgfortran-ng            14.1.0               h69a702a_1    conda-forge
libgfortran5              14.1.0               hc5f4f2c_1    conda-forge
libgomp                   14.1.0               h77fa898_1    conda-forge
libhwloc                  2.9.3           default_h554bfaf_1009    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
liblapack                 3.9.0           24_linux64_openblas    conda-forge
libnl                     3.10.0               h4bc722e_0    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libopenblas               0.3.27          pthreads_hac2b453_1    conda-forge
libsanitizer              12.4.0               h46f95d5_1    conda-forge
libsqlite                 3.46.1               hadc24fc_0    conda-forge
libstdcxx                 14.1.0               hc0a3c3a_1    conda-forge
libstdcxx-devel_linux-64  12.4.0             ha4f9413_101    conda-forge
libstdcxx-ng              14.1.0               h4852527_1    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libxml2                   2.12.7               he7c6b58_4    conda-forge
libzlib                   1.3.1                h4ab18f5_1    conda-forge
mpi                       1.0                     openmpi    conda-forge
ncurses                   6.5                  he02047a_1    conda-forge
numpy                     2.1.1           py312h58c1407_0    conda-forge
openmpi                   5.0.1              hb0ee255_100    conda-forge
openmpi-mpicc             5.0.1              hd590300_100    conda-forge
openssl                   3.3.2                hb9d3cd8_0    conda-forge
pcre2                     10.44                hba22ea6_2    conda-forge
pip                       24.2               pyh8b19718_1    conda-forge
python                    3.12.6          hc5c86c4_1_cpython    conda-forge
python_abi                3.12                    5_cp312    conda-forge
readline                  8.2                  h8228510_1    conda-forge
scipy                     1.14.1          py312h7d485d2_0    conda-forge
setuptools                75.1.0             pyhd8ed1ab_0    conda-forge
swig                      4.2.1                hfb18ccb_1    conda-forge
sysroot_linux-64          2.17                h4a8ded7_17    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tzdata                    2024a                h8827d51_1    conda-forge
wheel                     0.44.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge

Environment info

$ conda info

     active environment : mpi
    active env location : /home/swryan/miniconda3/envs/mpi
            shell level : 1
       user config file : /home/swryan/.condarc
 populated config files : /home/swryan/.condarc
          conda version : 24.5.0
    conda-build version : 24.3.0
         python version : 3.10.13.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=skylake
                          __conda=24.5.0=0
                          __cuda=12.6=0
                          __glibc=2.31=0
                          __linux=5.15.153.1=0
                          __unix=0=0
       base environment : /home/swryan/miniconda3  (writable)
      conda av data dir : /home/swryan/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
          package cache : /home/swryan/miniconda3/pkgs
                          /home/swryan/.conda/pkgs
       envs directories : /home/swryan/miniconda3/envs
                          /home/swryan/.conda/envs
               platform : linux-64
             user-agent : conda/24.5.0 requests/2.31.0 CPython/3.10.13 Linux/5.15.153.1-microsoft-standard-WSL2 ubuntu/20.04.2 glibc/2.31 solver/libmamba conda-libmamba-solver/23.11.1 libmambapy/1.5.4
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False
leofang commented 2 months ago

@minrk I assume this is related to https://github.com/conda-forge/mpi-feedstock/pull/14?

@swryan what if we do mpi==1.0.*=openmpi? Would it work?

swryan commented 2 months ago

I had the same suspicion wrt #14...

@leofang I don't know how to evaluate your suggestion, is there a way we could test it?

Also note that we see a similar issue with mpich:

Tried with mpich and got a similar error:

conda.exceptions.InvalidSpec: The package "conda-forge/noarch::mpi==1.0=mpich" is not available for the specified platform

leofang commented 2 months ago

Perhaps try conda install -c conda-forge openmpi mpi==1.0.*=openmpi?

If it works, I am thinking we should issue a migrator to rebuild all MPI providers and pin to

run:
  - mpi 1.0.* {{ mpi_flavor }}

@minrk WDYT?

swryan commented 2 months ago

that command line is not working for me:

$ conda install -c conda-forge openmpi mpi==1.0.*=openmpi
WARNING conda.models.version:get_matcher(563): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.0.*, but conda is ignoring the .* and treating it as 1.0
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: failed

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/home/swryan/miniconda3/lib/python3.10/site-packages/conda/models/version.py", line 44, in __call__
        return cls._cache_[arg]
    KeyError: '===1.0'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/home/swryan/miniconda3/lib/python3.10/site-packages/conda/models/match_spec.py", line 75, in __call__
        return super().__call__(**kwargs)
      File "/home/swryan/miniconda3/lib/python3.10/site-packages/conda/models/match_spec.py", line 190, in __init__
        self._match_components = self._build_components(**kwargs)
      File "/home/swryan/miniconda3/lib/python3.10/site-packages/conda/models/match_spec.py", line 425, in _build_components
        return frozendict(_make_component(key, value) for key, value in kwargs.items())
      File "/home/swryan/miniconda3/lib/python3.10/site-packages/conda/models/match_spec.py", line 425, in <genexpr>
        return frozendict(_make_component(key, value) for key, value in kwargs.items())
      File "/home/swryan/miniconda3/lib/python3.10/site-packages/conda/models/match_spec.py", line 439, in _make_component
        matcher = _implementors[field_name](value)
      File "/home/swryan/miniconda3/lib/python3.10/site-packages/conda/models/version.py", line 46, in __call__
        val = cls._cache_[arg] = super().__call__(arg)
      File "/home/swryan/miniconda3/lib/python3.10/site-packages/conda/models/version.py", line 523, in __init__
        vspec_str, matcher, is_exact = self.get_matcher(vspec)
      File "/home/swryan/miniconda3/lib/python3.10/site-packages/conda/models/version.py", line 552, in get_matcher
        raise InvalidVersionSpec(vspec_str, "invalid operator")
    conda.exceptions.InvalidVersionSpec: Invalid version '===1.0': invalid operator
minrk commented 2 months ago

I'm sure this is related to #14, sorry about that. I don't understand how that could happen or what's producing the illegal spec (it should be mpi=1.0=openmpi not mpi==1.0=openmpi, which is invalid). We can mark the noarch builds as invalid.

This appears to be a bug in conda's handling of noarch packages with only x.y version, because mamba install mpi4py works in this same situation.

minrk commented 2 months ago

https://github.com/conda-forge/admin-requests/pull/1094 marks the 1.0 builds broken, then we can do the 1.0.* migrator

minrk commented 2 months ago

Actually, I think we can fix this here by publishing a 1.0.0 build, which I've tested locally.

minrk commented 2 months ago

I think #18 might be the easiest path to a fix

minrk commented 2 months ago

The 1.0 builds are marked broken, so this should be fixed now for future installs. We can start looking into the 1.0.* migration.