diff --git a/dib/ironic-python-agent-ramdisk/element-deps b/dib/ironic-python-agent-ramdisk/element-deps index 2b7162c..10ac6bd 100644 --- a/dib/ironic-python-agent-ramdisk/element-deps +++ b/dib/ironic-python-agent-ramdisk/element-deps @@ -3,7 +3,7 @@ dhcp-all-interfaces ibft-interfaces install-static package-installs -pip-and-virtualenv +ensure-venv pkg-map source-repositories svc-map diff --git a/dib/ironic-python-agent-ramdisk/environment.d/20-ipa-distro-family.bash b/dib/ironic-python-agent-ramdisk/environment.d/20-ipa-distro-family.bash index 048066c..5b9151e 100644 --- a/dib/ironic-python-agent-ramdisk/environment.d/20-ipa-distro-family.bash +++ b/dib/ironic-python-agent-ramdisk/environment.d/20-ipa-distro-family.bash @@ -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 diff --git a/dib/ironic-python-agent-ramdisk/install.d/ironic-python-agent-ramdisk-source-install/60-ironic-python-agent-ramdisk-install b/dib/ironic-python-agent-ramdisk/install.d/ironic-python-agent-ramdisk-source-install/60-ironic-python-agent-ramdisk-install index e863b1b..c39c6cf 100755 --- a/dib/ironic-python-agent-ramdisk/install.d/ironic-python-agent-ramdisk-source-install/60-ironic-python-agent-ramdisk-install +++ b/dib/ironic-python-agent-ramdisk/install.d/ironic-python-agent-ramdisk-source-install/60-ironic-python-agent-ramdisk-install @@ -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 diff --git a/dib/ironic-python-agent-ramdisk/post-install.d/99-remove-extra-packages b/dib/ironic-python-agent-ramdisk/post-install.d/99-remove-extra-packages index 25e0674..18fd69f 100755 --- a/dib/ironic-python-agent-ramdisk/post-install.d/99-remove-extra-packages +++ b/dib/ironic-python-agent-ramdisk/post-install.d/99-remove-extra-packages @@ -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 diff --git a/releasenotes/notes/python2-removal-dee895550b1959af.yaml b/releasenotes/notes/python2-removal-dee895550b1959af.yaml new file mode 100644 index 0000000..1e4ffb5 --- /dev/null +++ b/releasenotes/notes/python2-removal-dee895550b1959af.yaml @@ -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. \ No newline at end of file diff --git a/zuul.d/ironic-python-agent-builder-jobs.yaml b/zuul.d/ironic-python-agent-builder-jobs.yaml index 9d3bb66..94af59f 100644 --- a/zuul.d/ironic-python-agent-builder-jobs.yaml +++ b/zuul.d/ironic-python-agent-builder-jobs.yaml @@ -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 diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 146f72e..eeb3e02 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -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