Remove centos7 job, python2 support

This change does the following:
- Removes the centos7 job, it uses python2 even though python2 was
  dropped from IPA in 2019.
  (see Ifd0e0b99bb82a7d7e82d6c14309468196f5734fc)
- Allow 60-ironic-python-agent-ramdisk-install to assume python3 and
  the venv module, the remaining centos7-python3 job will also test this
- Replaces the pip-and-virtualenv element with ensure-venv.
  pip-and-virtualenv exists to install virtualenv for python2
  environments, and it is unmaintained and mostly technical debt.

Change-Id: I9b6e03f50a4eb2484a04748e51d7348401b6ca04
This commit is contained in:
Steve Baker 2022-01-20 09:51:11 +13:00
parent 811d9ff9e5
commit 66206d0b27
7 changed files with 19 additions and 55 deletions

View File

@ -3,7 +3,7 @@ dhcp-all-interfaces
ibft-interfaces
install-static
package-installs
pip-and-virtualenv
ensure-venv
pkg-map
source-repositories
svc-map

View File

@ -1,5 +1,5 @@
# TODO(dtantsur): verify if opensuse can be added here
if [[ $DISTRO_NAME =~ (fedora|centos|centos7|rhel|rhel7) ]]; then
if [[ $DISTRO_NAME =~ (fedora|centos|rhel) ]]; then
export IPA_DISTRO_FAMILY=rh
else
export IPA_DISTRO_FAMILY=other

View File

@ -14,34 +14,10 @@ IRLIBDIR=/tmp/ironic-lib
UPPER_CONSTRAINTS=/tmp/requirements/upper-constraints.txt
VENVDIR=/opt/ironic-python-agent
IPA_PYTHON_VERSION=$DIB_PYTHON_VERSION
IPA_PYTHON="$DIB_PYTHON"
case "$DISTRO_NAME" in
centos7|rhel7)
# NOTE(dtantsur): C.UTF-8 doesn't seem to exist in CentOS 7
export LC_ALL=en_US.UTF-8
if grep -q 'Python :: 3 :: Only' $IPADIR/setup.cfg; then
echo "WARNING: using Python 3 on CentOS 7, this is not recommended"
${YUM:-yum} install -y python3 python3-devel
IPA_PYTHON=python3
IPA_PYTHON_VERSION=3
fi
;;
esac
# create the virtual environment using the default python
if [ $IPA_PYTHON_VERSION == 3 ]; then
$IPA_PYTHON -m venv $VENVDIR
REQUIRED_PIP_STR="21.3.1"
REQUIRED_PIP_TUPLE="(21, 3, 1)"
else
$IPA_PYTHON -m virtualenv $VENVDIR
# NOTE(rpittau) pip 20.3.4 is the last version to support Python 2.x
REQUIRED_PIP_STR="20.3.4"
REQUIRED_PIP_TUPLE="(20, 3, 4)"
fi
python3 -m venv $VENVDIR
REQUIRED_PIP_STR="21.3.1"
REQUIRED_PIP_TUPLE="(21, 3, 1)"
HAS_PIP=$($VENVDIR/bin/python -c \
"import pip; print(tuple(map(int, pip.__version__.split('.'))) >= $REQUIRED_PIP_TUPLE)")
@ -54,7 +30,7 @@ fi
# NOTE(rpittau): if we want to keep compatibility with Python 2.x, we need to
# upgrade setuptools in the virtualenv as the default installed has issues
# when parsing requirements.
if [ "$DISTRO_NAME" == "opensuse" ] || [ $IPA_PYTHON_VERSION == 2 ]; then
if [ "$DISTRO_NAME" == "opensuse" ]; then
$VENVDIR/bin/pip install -U setuptools
fi

View File

@ -21,7 +21,7 @@ done
# TODO(dtantsur): implement the same for debian-based systems
case "$DISTRO_NAME" in
fedora|centos|centos7|rhel|rhel7)
fedora|centos|rhel)
${YUM:-yum} remove -y postfix gcc make
${YUM:-yum} clean all
# Rebuilding the rpm database after removing packages will reduce

View File

@ -0,0 +1,10 @@
---
upgrade:
- |
Support for python2 in ironic-python-agent was dropped in the Ussuri release
however it was still possible to build (non-functional) python2 images for
CentOS 7. This python2 support is now dropped from the image build also. As
part of this change, the `pip-and-virtualenv` element is not longer a
dependency, so any custom elements which depend on this element will need to
either include it explicitly or migrate to the recommended `ensure-venv`
element.

View File

@ -19,16 +19,6 @@
vars:
image_type: 'tinyipa'
- job:
name: ironic-python-agent-build-image-dib-centos7
parent: ironic-python-agent-build-image-base
override-branch: stable/train
required-projects:
- openstack/diskimage-builder
vars:
image_type: 'dib'
image_distro: 'centos7'
- job:
name: ironic-python-agent-build-image-dib-centos8
parent: ironic-python-agent-build-image-base
@ -78,16 +68,6 @@
vars:
image_type: 'tinyipa'
- job:
name: ironic-python-agent-check-image-dib-centos7
parent: ironic-python-agent-check-image-base
override-branch: stable/train
required-projects:
- openstack/diskimage-builder
vars:
image_type: 'dib'
image_distro: 'centos7'
- job:
name: ironic-python-agent-check-image-dib-centos7-python3
parent: ironic-python-agent-check-image-base

View File

@ -11,13 +11,11 @@
- ironic-python-agent-check-image-tinyipa
- ironic-python-agent-check-image-dib-centos8
- ironic-python-agent-check-image-dib-centos8-extra
- ironic-python-agent-check-image-dib-centos7
- ironic-python-agent-check-image-dib-centos7-python3
- ironic-python-agent-check-image-dib-debian
- ironic-python-agent-check-image-dib-debian-arm64
- ironic-python-agent-check-image-dib-debian-extra
# Non-voting jobs
- ironic-python-agent-check-image-dib-centos7-python3:
voting: false
- ironic-python-agent-check-image-dib-ubuntu:
voting: false
- ironic-python-agent-check-image-dib-opensuse:
@ -38,7 +36,7 @@
- ironic-python-agent-check-image-tinyipa
- ironic-python-agent-check-image-dib-centos8
- ironic-python-agent-check-image-dib-centos8-extra
- ironic-python-agent-check-image-dib-centos7
- ironic-python-agent-check-image-dib-centos7-python3
- ironic-python-agent-check-image-dib-debian
- ironic-python-agent-check-image-dib-debian-arm64
- ironic-python-agent-check-image-dib-debian-extra