Skip to content

Conversation

@jsquyres
Copy link
Member

@jsquyres jsquyres commented May 21, 2025

It was pointed out on the Open MPI packagers mailing list that RHEL 8 (and clones) has Python 3.6 inbox. If we only allow Open MPI to build with Python >= 3.7, we'll break all builds on RHEL 8 (etc.). That seems like a bad idea.

  • Update the git submodule for the pympistandard module to a version that is friendly to running with Python 3.6.
  • List the additional pip modules in docs/requirements.txt that are needed by pympistandard to be able to run with Python 3.6.

Fixes #13267

It was pointed out on the Open MPI packagers mailing list that RHEL 8
(and clones) has Python 3.6 inbox.  If we only allow Open MPI to build
with Python >= 3.7, we'll break all builds on RHEL 8 (etc.).  That
seems like a bad idea.

* Update the git submodule for the pympistandard module to a version
  that is friendly to running with Python 3.6.
* List the additional pip modules in docs/requirements.txt that are
  needed by pympistandard to be able to run with Python 3.6.

Signed-off-by: Jeff Squyres <[email protected]>
@hppritcha
Copy link
Member

The c/f08 bindings code needs python 3.7 or higher. Please add back in the check for the case that we're building from a git clone.

@hppritcha hppritcha self-requested a review May 21, 2025 14:26
Copy link
Member

@hppritcha hppritcha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR needs to include putting back in the check for python 3.7 or higher in the case where one is building from a git clone or using the config option to generated the 'c' and 'f08' binding code.

@edgargabriel
Copy link
Member

in that case, do we want to keep the minimum required version at 3.7, or is there still benefit of having some parts of the code require python 3.6 only?

@jsquyres jsquyres marked this pull request as draft May 21, 2025 14:58
@jsquyres
Copy link
Member Author

I converted this to draft so that we don't accidentally merge it before this is resolved.

The c/f08 bindings code needs python 3.7 or higher.

Are you sure?

I did the following:

  1. Got a fresh git clone of this PR (guarantee to force needing to generate the C/F source code)
  2. Built an Alma 8 container with the following Dockerfile:
    FROM almalinux:8
    RUN \
        dnf update && \
        dnf install -y gcc gcc-gfortran make flex \
        python3 autoconf automake libtool \
        emacs-nox git
  3. Ran that container, bind mounted to the fresh git clone I just got:
$ docker run --mount type=bind,source=`pwd`,target=/outside --rm -it jms-alma8 /bin/bash
[root@421e91838846 /]# cd /outside/
[root@421e91838846 outside]# python3 --version
Python 3.6.8
[root@421e91838846 outside]# ./autogen.pl
...lots of output...
[root@421e91838846 outside]# ./configure --prefix=/tmp/bogus --enable-mpi-fortran |& tee config.out
...lots of output...
[root@421e91838846 outside]# make -j 16 |& tee make.out
...lots of output...

It succeeded, including generating all the Fortran C/F code via the python scripts.

@hppritcha
Copy link
Member

i only know what was in the original PR for bigcount concerning python 3.7 requirement. but this seems to show that we can use 3.6. so in that case my concerns are allayed.

@rhc54
Copy link
Contributor

rhc54 commented May 21, 2025

I've been trying hard to test my Python dependencies against Py 3.6, but I'm having lots of problems with it. FWIW: the stock Alma 8 container image comes with Py 3.11 - and there is no package for Py 3.6 available for it.

I've been trying to hand-install Py 3.6 in that container, but it fails to build. So I'm reaching the point of agreeing with George - this is feeling like way too much effort, at least for my very limited resources. I will therefore likely stick with Py 3.7 as the minimum for PMIx/PRRTE.

@rhc54
Copy link
Contributor

rhc54 commented May 21, 2025

Oh - well, that's cute. The test for Py >= v3.7 passes even with Py = 3.6.8. So I guess it all is irrelevant from my end until I fix the configury.

FWIW: I did finally find a Py 3.6.8 package I could add to the container - had to do some hand mangling to make it active.

@jsquyres
Copy link
Member Author

@rhc54 I'm not sure which Alma 8 container you're using; the one I'm using comes with a dnf database with the upstream Alma Linux RPM repo that will install Python 3.6.8 when requested:

$ docker run --mount type=bind,source=`pwd`,target=/outside --rm -it almalinux:8 /bin/bash
Unable to find image 'almalinux:8' locally
8: Pulling from library/almalinux
de0f138ff263: Already exists 
Digest: sha256:86b0e1745d34c8577ae658aa0c8d57fb2cbdb21ee7ca9c19ab309c7cc510ac51
Status: Downloaded newer image for almalinux:8
[root@e9e298d53f65 /]# dnf update
AlmaLinux 8 - BaseOS                                  6.7 MB/s |  19 MB     00:02    
AlmaLinux 8 - AppStream                               1.7 MB/s |  16 MB     00:09    
AlmaLinux 8 - Extras                                   17 kB/s |  12 kB     00:00    
Dependencies resolved.
Nothing to do.
Complete!
[root@e9e298d53f65 /]# dnf install python3 -y
Last metadata expiration check: 0:00:08 ago on Wed May 21 17:27:34 2025.
Dependencies resolved.
======================================================================================
 Package             Arch    Version                                  Repo       Size
======================================================================================
Installing:
 python36            aarch64 3.6.8-39.module_el8.10.0+3769+3838165b   appstream  18 k
Installing dependencies:
 platform-python-pip noarch  9.0.3-24.el8                             baseos    1.6 M
 python3-pip         noarch  9.0.3-24.el8                             appstream  19 k
 python3-setuptools  noarch  39.2.0-8.el8_10                          baseos    162 k
Enabling module streams:
 python36                    3.6                                                     

Transaction Summary
======================================================================================
Install  4 Packages

Total download size: 1.8 M
Installed size: 7.0 M
Downloading Packages:
(1/4): python3-pip-9.0.3-24.el8.noarch.rpm             54 kB/s |  19 kB     00:00    
(2/4): python36-3.6.8-39.module_el8.10.0+3769+3838165 325 kB/s |  18 kB     00:00    
(3/4): python3-setuptools-39.2.0-8.el8_10.noarch.rpm  361 kB/s | 162 kB     00:00    
(4/4): platform-python-pip-9.0.3-24.el8.noarch.rpm    1.5 MB/s | 1.6 MB     00:01    
--------------------------------------------------------------------------------------
Total                                                 924 kB/s | 1.8 MB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                              1/1 
  Installing       : python3-setuptools-39.2.0-8.el8_10.noarch                    1/4 
  Installing       : platform-python-pip-9.0.3-24.el8.noarch                      2/4 
  Installing       : python36-3.6.8-39.module_el8.10.0+3769+3838165b.aarch64      3/4 
  Running scriptlet: python36-3.6.8-39.module_el8.10.0+3769+3838165b.aarch64      3/4 
  Installing       : python3-pip-9.0.3-24.el8.noarch                              4/4 
  Running scriptlet: python3-pip-9.0.3-24.el8.noarch                              4/4 
  Verifying        : platform-python-pip-9.0.3-24.el8.noarch                      1/4 
  Verifying        : python3-setuptools-39.2.0-8.el8_10.noarch                    2/4 
  Verifying        : python3-pip-9.0.3-24.el8.noarch                              3/4 
  Verifying        : python36-3.6.8-39.module_el8.10.0+3769+3838165b.aarch64      4/4 

Installed:
  platform-python-pip-9.0.3-24.el8.noarch                                             
  python3-pip-9.0.3-24.el8.noarch                                                     
  python3-setuptools-39.2.0-8.el8_10.noarch                                           
  python36-3.6.8-39.module_el8.10.0+3769+3838165b.aarch64                             

Complete!
[root@e9e298d53f65 /]# python3 --version
Python 3.6.8
[root@e9e298d53f65 /]# 

I can also dnf install python3.11 to install Python 3.11, but dnf install python3 installs Python 3.6.8 for me.

@rhc54
Copy link
Contributor

rhc54 commented May 21, 2025

Okay, I believe that the test by @jsquyres may in fact be bogus. Here is what I'm seeing in my configure output (modified to error out when showing the final Py result:

checking if we need Python... yes
checking for a Python interpreter with version >= 3.7... python3.11
checking for python3.11... /usr/bin/python3.11
checking for python3.11 version... 3.11
checking for python3.11 platform... linux
checking for python3.11 script directory... ${prefix}/lib/python3.11/site-packages
checking for python3.11 extension module directory... ${exec_prefix}/lib64/python3.11/site-packages
configure: WARNING: Python 3.11
configure: error: PYTHON Python 3.6.8  3.7

So here is what is going on. As I said above, Alma 8 now comes standard with Py 3.11. I then hand-install an old Py 3.6.8 version and set it to be the default python3. Great.

However, AM_PATH_PYTHON searches for all installed Python versions and picks the highest one that meets your min-version requirement. And so it finds the Py 3.11 installation. Since we use $PYTHON in our Makefiles, we build with the 3.11 version - even though the 3.6 version (a) is installed and set as the default Py, and (b) is the version you get when you execute python (as the error line shows).

Thus, I don't know that we actually have tested the build under Py < 3.7. I think we may just have a "false positive" outcome. When I have time, I may try to override the autoconf selection and see if it still works.

@jsquyres
Copy link
Member Author

As I said above, Alma 8 now comes standard with Py 3.11.

What Alma 8 image are you using? I'm using https://hub.docker.com/layers/library/almalinux/8/images/sha256-c8ce4bb54f674de7d65e9876d25eedb5046bd205cfdb0d3f5680cd5ec5e1253e.

@rhc54
Copy link
Contributor

rhc54 commented May 21, 2025

Okay, I managed to finagle this thing enough to actually build with Py 3.6. Confirmed that my dependencies are okay with that version.

@rhc54
Copy link
Contributor

rhc54 commented May 21, 2025

As I said above, Alma 8 now comes standard with Py 3.11.

What Alma 8 image are you using? I'm using https://hub.docker.com/layers/library/almalinux/8/images/sha256-c8ce4bb54f674de7d65e9876d25eedb5046bd205cfdb0d3f5680cd5ec5e1253e.

I simply spec'd "almalinux:8" in the dockerfile - and got Py 3.11. I do have to load dependencies to build, and so I imagine one of them could have pulled Py 3.11 down with it. Still, if you want to build my stuff, at least, it seems you end up that way. 🤷‍♂️

@jsquyres
Copy link
Member Author

FWIW: I used this Dockerfile to make an image that was able to build a fresh recursive clone of all of Open MPI, including the embedded OpenPMIx and PRTE:

FROM almalinux:8
RUN \
    dnf update && \
    dnf install -y gcc gcc-gfortran make flex \
    python3 autoconf automake libtool \
    emacs-nox git

That pulled down just Python 3.6.8, not Python 3.11 (I notably did not install the pip's needed to build the sphinx docs). For example:

$ docker run --mount type=bind,source=`pwd`,target=/outside --rm -it jms-alma8 /bin/bash
[root@22fda324d8e8 /]# rpm -qa | grep python3 | sort
python3-dnf-4.7.0-21.el8_10.alma.1.noarch
python3-gpg-1.13.1-12.el8.aarch64
python3-hawkey-0.63.0-21.el8_10.alma.1.aarch64
python3-libcomps-0.1.18-1.el8.aarch64
python3-libdnf-0.63.0-21.el8_10.alma.1.aarch64
python3-libs-3.6.8-69.el8_10.alma.1.aarch64
python3-pip-9.0.3-24.el8.noarch
python3-pip-wheel-9.0.3-24.el8.noarch
python3-rpm-4.14.3-32.el8_10.aarch64
python3-setuptools-39.2.0-8.el8_10.noarch
python3-setuptools-wheel-39.2.0-8.el8_10.noarch
python36-3.6.8-39.module_el8.10.0+3769+3838165b.aarch64
[root@22fda324d8e8 /]# python3 --version
Python 3.6.8
[root@0d833f6f3aed /]# python3.11 --version
bash: python3.11: command not found

Just to be triple sure, I hit <TAB> to see how python3 will complete:

[root@0d833f6f3aed /]# python3<TAB>
python3     python3.6   python3.6m  
[root@0d833f6f3aed /]#

FWIW: I'm guessing / assuming that the Open MPI main git submodules for pmix / prte are well behind whatever you're doing. So I did the following:

  1. Got a fresh recursive git clone of Open MPI
  2. Checked out this PR in that fresh git clone (i.e., to allow python 3.6)
  3. Replaced the OMPI 3rd-party git submodules for pmix and prte with the tip of master from both upstream repos
  4. pmix's VERSION already has a minimum Python version of 3.6
  5. Modify prte's VERSION to allow a minimum Python version of 3.6 (it was originally 3.7)
  6. In my Alma 8 container (with only Py 3.6, no Py 3.11):
    1. Ran autogen.pl across the whole tree
    2. Made a python virtual environment
    3. Ran pip install -r docs/requirements.txt (i.e., Open MPI's sphinx requirements file)
      • Do this to force the building of all Sphinx docs, etc.
    4. Ran ./configure --prefix=/tmp/bogus --enable-mpi-fortran --enable-sphinx
    5. Ran make -j 16

As far as I can tell, everything built ok.

I'm sure that's not 100% the same thing as building pmix / prte as standalone projects, but it was as close an approximation as I had time for to test today, and hopefully a reasonable-enough smoke test to sure that Py 3.6 is suitable...

@jsquyres
Copy link
Member Author

Based on my testing, I think this PR is ok.

@jsquyres jsquyres marked this pull request as ready for review May 22, 2025 13:28
@jsquyres jsquyres merged commit bf59a30 into open-mpi:main May 22, 2025
18 checks passed
@jsquyres jsquyres deleted the pr/support-python3.6 branch May 22, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need to support Python 3.6

4 participants