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
(cherry picked from commit 66206d0b27
)
This commit is contained in:
parent
f9e763008a
commit
e51c210861
@ -3,7 +3,7 @@ dhcp-all-interfaces
|
||||
ibft-interfaces
|
||||
install-static
|
||||
package-installs
|
||||
pip-and-virtualenv
|
||||
ensure-venv
|
||||
pkg-map
|
||||
source-repositories
|
||||
svc-map
|
||||
|
@ -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
|
||||
|
@ -13,33 +13,11 @@ IPADIR=/tmp/ironic-python-agent
|
||||
IRLIBDIR=/tmp/ironic-lib
|
||||
UPPER_CONSTRAINTS=/tmp/requirements/upper-constraints.txt
|
||||
VENVDIR=/opt/ironic-python-agent
|
||||
# 19.1.1 is required for cryptography.
|
||||
REQUIRED_PIP_STR="19.1.1"
|
||||
REQUIRED_PIP_TUPLE="(19, 1, 1)"
|
||||
|
||||
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
|
||||
else
|
||||
$IPA_PYTHON -m virtualenv $VENVDIR
|
||||
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)")
|
||||
@ -52,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
|
||||
|
||||
|
@ -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
|
||||
|
10
releasenotes/notes/python2-removal-dee895550b1959af.yaml
Normal file
10
releasenotes/notes/python2-removal-dee895550b1959af.yaml
Normal 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.
|
@ -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
|
||||
|
@ -11,12 +11,10 @@
|
||||
- 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-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:
|
||||
@ -37,7 +35,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-extra
|
||||
post:
|
||||
|
Loading…
Reference in New Issue
Block a user