root/build-tools/build-wheels/docker/centos-dockerfile
Davlet Panech 2bdac9ac3b Build and use py2 wheels with py2 projects
Current build process can't handle python2-based projects because we
only build wheels based on Ussury (python3). This patch fixes this.

- build-wheels/docker/stable-wheels-py2.cfg
- build-wheels/docker/dev-wheels-py2.cfg
  Resurrected original cfg files from commit
  aa317323716a7f5bb844bb8867eeb8b01313b51e (before upgrade to Ussuri)
  and saved with -py2 suffix

- build-wheels/docker/centos-dockerfile
  Install python2 packages in addition to python3

- build-wheels/docker/docker-build-wheel.sh
  * Build with python3 or python2 depending on the environment
  * Suppress status message at the end because its better handled by the
    parent script (build-base-wheels.sh)

- build-wheels/build-base-wheels.sh
  * Generate 2 wheel directories, "base" and "base-py2" at each
    invocation
  * Use the same builder image and docker script (with different
    environment) to generate wheels based on different cfg files.
    Save python3 wheels in "base" and python2 wheels in "base-py2"

- build-wheels/build-wheel-tarball.sh
  * New command-line parameter --python2: generate *-wheels-py2.tar
    from "base-py2"
  * Use ussuri or train constraints depending on the presence of
    --python2

- build-docker-images/build-stx-images.sh
  * Use *-wheels-py2.tar for python2/loci projects
  * Fail early on missing --wheels/--wheels-py2
  * Fail if multiple projects use the same LABEL
  * Remove support for config files

- build-docker-images/docker-image-build-centos-dev.cfg
- build-docker-images/docker-image-build-centos-stable.cfg
  Removed

Change-Id: I2ca444f258a537ed2ba6f68206d32cf59e1802b4
Partial-Bug: 1891416
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
2021-04-13 16:18:51 -04:00

30 lines
1.1 KiB
Plaintext

ARG RELEASE=7.5.1804
FROM centos:${RELEASE}
ARG BUILD_STREAM=stable
# Install the necessary packages for building the python modules.
# Some of these are dependencies of the specific modules, and could
# instead be added to the wheels.cfg file in the future.
RUN set -ex ;\
sed -i '/\[main\]/ atimeout=120' /etc/yum.conf ;\
yum install -y epel-release centos-release-openstack-queens ;\
yum install -y git gcc zip bzip2 unzip \
python3 python3-pip python3-wheel python3-devel \
wget openldap-devel mariadb mariadb-devel \
libvirt libvirt-devel liberasurecode-devel nss-devel \
systemd-devel postgresql-devel ;\
# while setuptools is larger than 45.3, it no longer support "Features" in setup.py
python3 -m pip install --user setuptools==45.3 ;\
python3 -m pip install --user --upgrade wheel
COPY docker-build-wheel.sh /
COPY ${BUILD_STREAM}-wheels.cfg /wheels.cfg
# Python2 packages
RUN set -ex; \
yum -y install python python-devel ;\
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py ;\
python get-pip.py
COPY ${BUILD_STREAM}-wheels-py2.cfg /wheels-py2.cfg