WIP: Use python 3.9 with opt-out option on centos8

Change-Id: Id41fd6aba60ccf9f14c332a82de533546d25b518
This commit is contained in:
Jay Faulkner 2023-12-21 08:28:17 -08:00
parent cc72fbb89d
commit 71fb1bc279
3 changed files with 19 additions and 1 deletions

View File

@ -9,6 +9,14 @@ if [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE%-stream} > 7 ]]; then
export DIB_DHCP_NETWORK_MANAGER_AUTO=${DIB_DHCP_NETWORK_MANAGER_AUTO:-true}
fi
# note(JayF): Recent downstream security updates for CentOS Stream8 / RHEL8
# to python3.6 have broken IPA (specifically, eventlet). On these versions, use
# a newer python version, but allow an opt-opt for operators who need the old
# behavior.
if [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE%-stream} == 8 ]]; then
export DIB_IPA_USE_PYTHON39=${DIB_IPA_USE_PYTHON39:-true}
fi
# NOTE(rpittau) force Python version to 3 for debian
if [[ $DISTRO_NAME =~ debian ]]; then
DIB_PYTHON_VERSION=3

View File

@ -15,7 +15,12 @@ UPPER_CONSTRAINTS=/tmp/requirements/upper-constraints.txt
VENVDIR=/opt/ironic-python-agent
# create the virtual environment using the default python
python3 -m venv $VENVDIR
if $DIB_IPA_USE_PYTHON39; then
python39 -m venv $VENVDIR
else
python3 -m venv $VENVDIR
fi
REQUIRED_PIP_STR="21.3.1"
REQUIRED_PIP_TUPLE="(21, 3, 1)"

View File

@ -37,6 +37,11 @@ libssl-dev:
python-dev:
build-only: true
python39:
when: DIB_IPA_USE_PYTHON39 = true
python39-devel:
when: DIB_IPA_USE_PYTHON39 = true
# The base minimum element uninstalls firmware, but it's needed for bare metal.
linux-firmware:
phase: post-install.d