Davlet Panech 075b71dcf9 debian: build-wheels: partial debian support
Add debian support to wheels scripts. Note: this solution is not fully
functional. Remaining issues will be addressed in separate commits. See
FIXME file in this patch.

* build-wheels: move OS-specific files to subdirectories
  {dev,stable}-wheels.cfg
  {dev,stable}-wheels-py2.cfg
  openstack.cfg
  Dockerfile

* added a copy of openstack/ussuri requirements files under
  debian/openstack-requirements/ussuri/upstream for reference

* added a patched version of openstack/ussuri requirements files based
  on above. Changes:
  - added lines for python3.9
  - disabled some packages that don't compile on debian (nss, thrift);
    these will be installed as DEB files into the base image

* build-base-wheels.sh:
  - auto-detect OS & version by default
  - add local build repo to docker file
  - define CPUCOUNT=2 when building wheels. Otherwise some wheels run
    out of RAM when building.

* build-wheel-tarball.sh:
  - auto-detect OS & version
  - new option: --keep-image
  - allow openstack URL to be a local file name
  - assume DEB wheel packages may install wheels at any level, not just
    under "/wheels". It's not consistent with CentOS, but many DEB
    packages do it that way now.

* get-stx-wheels.sh:
  - auto-detect OS & version defaults
  - debian: don't scan 3rd-party libraries for wheels. They don't exist
    as files within the POD, but only in the repomgr repo. To be
    addressed later.
  - debian: don't scan for lower layer wheels. Layered builds are not
    supported by Debian right now. To be addressed later.
  - debian: extarct wheels from DEB files

CHANGES TO DEBIAN WHEEL VERSIONS COMPARED TO CENTOS
===================================================

* Python 3 (stable-wheels.cfg):
  - libvirt_python 4.7.0 upgraded to 7.0.0. Original version doesn't
    compile on debian/bullseye. New version matches the SO package
    included with bullseye
  - python_nss: removed. This module doesn't compile on bullseye as-is.
    A patched version is compiled as a DEB package as part of STX [1]
  - thriftpy: removed. This module doesn't compile on bullseye as-is. A
    patched version is provided by Debian [2]

* Python2 (stable-wheels-py2.cfg):
  - python-nss: removed. This module doesn't compile on bullseye as-is.
    A patched version is compiled as a DEB package as part of STX, which
    also provides the wheel [1]

TESTS
=====

- Build py2 & py3 wheels on debian & centos

REFERENCES
==========
[1] Import python-nss package to debian:
    https://review.opendev.org/c/starlingx/integ/+/837399

[2] Add additional packages to download lists:
    https://review.opendev.org/c/starlingx/tools/+/837904

Story: 2009897
Task: 44694

Depends-On: https://review.opendev.org/c/starlingx/integ/+/837399
Depends-On: https://review.opendev.org/c/starlingx/tools/+/837904

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: I0889118b9f0125888fb661e58ff41579da7eb3b4
2022-04-14 16:02:01 -04:00

47 lines
2.1 KiB
Docker

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 makecache ;\
# nss>3.53.1 causes compile errors with some wheels
nss_rpms=$(echo nss nss-util nss-tools nss-sysinit nss-softokn \
nss-softokn-devel nss-softokn-freebl nss-devel \
nss-util-devel nss-softokn-freebl-devel) ;\
# install/upgrade all NSS packages @ v3.53.1
yum install -y $(echo $nss_rpms | awk -v RS=' ' '{print $1 "-3.53.1"}') ;\
# add "exclude=$nss_rpms" to the CentOS repo file
sed -i -r -e "/^\\s*[[]updates[]]/a exclude=$nss_rpms" /etc/yum.repos.d/CentOS-Base.repo ;\
# install required packages
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 ;\
# pip<19.2.3 doesn't ignore yanked packages from pypi.org
python3 -m pip install pip==19.2.3 ;\
# setuptools-scm's maintainers keep publishing and yanking new versions.
# Pin it to latest version known to work
python3 -m pip install setuptools-scm==6.0.1 ;\
# 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-common/docker-build-wheel.sh /
COPY centos/${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 centos/${BUILD_STREAM}-wheels-py2.cfg /wheels-py2.cfg
# root CA cert expired on October 1st, 2021
RUN yum update -y ca-certificates