]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
cephadm: update the build.py script to work on multiple distros
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 1 Nov 2023 22:14:34 +0000 (18:14 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Fri, 3 Nov 2023 18:30:40 +0000 (14:30 -0400)
commit742dadb285eefe90aab1995a2b3a657390fe221c
tree15736a00e7014a2592f2910226f3848debb8014d
parenta375e5d9aa87c0409940388bda382252a81e4936
cephadm: update the build.py script to work on multiple distros

Unfortunately, a single simple call to pip does not work on all the
distributions that ceph is built on. In particular, Ubuntu 20.04 and
Ubuntu 22.04 come with pip versions that can not correctly handle
disabling wheels and installing Jinja2 (it tries to use the markupsafe
dependency before it is installed). This can be worked around by using a
virtual env and updating pip before proceeding. However, this is not
enough because CentOS/RHEL 8 uses python 3.6 and there is no version of
pip that supports 3.6 that we can update to that is new enough to  fix
the issue with disabling wheels. The workaround in this case is to
install each dependency one at a time through multiple calls to pip.

Because of this extra complexity is it simpler to eschew the use of a
requirements.txt file in build.py entirely. Thus the zipapp is built
using build.py only. Requirements files for cephadm are for setting up
the tox environments *only*.

For completeness a new option is added that gives the caller control
over when build.py uses a virtualenv or not. Thus the build.py script
requires at least one of: a working pip that handles disabling wheels;
or, a virtualenv (venv) and the ability to update to a working version
of pip. If the list of distros ceph supports (and the python versions
they use) ever becomes simpler/newer some of this complexity could be
removed from the build.py script.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/build.py