From 6403dd594ebd17faa1db1aa548d6ecdf395235c4 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Tue, 21 Jul 2020 09:42:28 +0100 Subject: [PATCH] Remove Centos-7 support Ussuri is the last release that openstack-ansible supports Centos-7. Remove support for Centos-7 for Victoria. Depends-On: https://review.opendev.org/742166 Change-Id: I3e3cda925b9bf8361f2c3a8d6b2a226e50974001 --- Vagrantfile | 4 ++-- common-tasks/test-set-nodepool-vars.yml | 18 +----------------- run_tests.sh | 5 +---- run_tests_common.sh | 12 +++--------- test-ansible-functional.sh | 23 ++--------------------- zuul.d/jobs.yaml | 13 ++++--------- zuul.d/project-templates.yaml | 10 +++------- 7 files changed, 16 insertions(+), 69 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index bf2400c1..7691c3cc 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -31,8 +31,8 @@ Vagrant.configure(2) do |config| ./run_tests.sh SHELL - config.vm.define "centos7" do |centos7| - centos7.vm.box = "centos/7" + config.vm.define "centos8" do |centos8| + centos8.vm.box = "centos/8" end config.vm.define "debian8" do |debian8| diff --git a/common-tasks/test-set-nodepool-vars.yml b/common-tasks/test-set-nodepool-vars.yml index e2895758..cdf3c075 100644 --- a/common-tasks/test-set-nodepool-vars.yml +++ b/common-tasks/test-set-nodepool-vars.yml @@ -40,23 +40,7 @@ echo "nspawn_hosts_container_image_repo=${NODEPOOL_LXC_IMAGE_PROXY}" source /etc/os-release - if [[ $ID == 'centos' && VERSION_ID == '7' ]]; then - echo "lxc_centos_package_baseurl=http://${NODEPOOL_MIRROR_HOST}:8080/copr-lxc2/epel-7-x86_64/" - echo "lxc_centos_package_key=http://${NODEPOOL_MIRROR_HOST}:8080/copr-lxc2/pubkey.gpg" - - # NOTE(mnaser): We need to make sure we pull the latest RDO mirror - # which is hashed to avoid cache going stale during CI. - # TODO(mnaser): Share this with Puppet - # https://github.com/openstack/puppet-openstack-integration/blob/master/configure_facts.sh#L66-L71 - export DLRN_BASE=${DLRN_BASE:-centos7-master/puppet-passed-ci} - rdo_dlrn=`curl --silent ${NODEPOOL_RDO_PROXY}/${DLRN_BASE}/delorean.repo | grep baseurl | cut -d= -f2` - if [[ -z "$rdo_dlrn" ]]; then - echo "Failed to parse dlrn hash" - exit 1 - fi - RDO_MIRROR_HOST=${rdo_dlrn/https:\/\/trunk.rdoproject.org/$NODEPOOL_RDO_PROXY} - echo "openstack_hosts_rdo_repo_url=${RDO_MIRROR_HOST}"s - elif [[ $ID == 'centos' && VERSION_ID == '8' ]]; then + if [[ $ID == 'centos' && VERSION_ID == '8' ]]; then echo "openstack_hosts_rdo_mirror_url=${NODEPOOL_RDO_PROXY}" fi args: diff --git a/run_tests.sh b/run_tests.sh index 3129599c..93e91dde 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -51,13 +51,10 @@ fi # Source distribution information source /etc/os-release || source /usr/lib/os-release -# Prefer dnf over yum for CentOS. -which dnf &>/dev/null && RHT_PKG_MGR='dnf' || RHT_PKG_MGR='yum' - # Figure out the appropriate package install command case ${ID,,} in *suse*) pkg_mgr_cmd="zypper -n in" ;; - centos|rhel|fedora) pkg_mgr_cmd="${RHT_PKG_MGR} install -y" ;; + centos|rhel|fedora) pkg_mgr_cmd="dnf install -y" ;; ubuntu|debian) pkg_mgr_cmd="apt-get install -y" ;; # Gentoo needs to have version set since it's rolling gentoo) pkg_mgr_cmd="emerge --jobs=4"; VERSION="rolling" ;; diff --git a/run_tests_common.sh b/run_tests_common.sh index f8da5668..76651505 100755 --- a/run_tests_common.sh +++ b/run_tests_common.sh @@ -51,11 +51,7 @@ case "${ID,,}" in pkg_list="ca-certificates-mozilla python-devel python-xml lsb-release ${extra_suse_deps:-}" ;; amzn|centos|rhel) - # NOTE(jrosser) on centos7 we ensure that the distro version of virtualenv is present to avoid - # tox later installing virtualenv as a dependancy with pip, and breaking later tests with - # openstack_hosts which correctly install the python-virtualenv distro package - [[ "${VERSION_ID}" == "7" ]] && extra_redhat_deps="python-virtualenv" - pkg_list="python3-devel redhat-lsb-core yum-utils ${extra_redhat_deps:-}" + pkg_list="python3-devel redhat-lsb-core" ;; fedora) pkg_list="python3-devel redhat-lsb-core redhat-rpm-config yum-utils" @@ -82,9 +78,7 @@ if ! which pip3 &>/dev/null; then fi # Install bindep and tox -if [[ "${ID,,}" == "centos" ]] && [[ ${VERSION_ID} == "7" ]]; then - sudo pip3 install 'bindep>=2.4.0' 'tox<=3.14.0' -elif [[ "${ID,,}" == "centos" ]] && [[ ${VERSION_ID} == "8" ]]; then +if [[ "${ID,,}" == "centos" ]] && [[ ${VERSION_ID} == "8" ]]; then sudo alternatives --set python /usr/bin/python3 sudo pip3 install 'bindep>=2.4.0' tox else @@ -110,7 +104,7 @@ if [[ ${#BINDEP_PKGS} > 0 ]]; then sudo zypper -n in ${BINDEP_PKGS} ;; centos|fedora) - sudo "${RHT_PKG_MGR}" install -y ${BINDEP_PKGS} + sudo dnf install -y ${BINDEP_PKGS} ;; ubuntu|debian) sudo apt-get update diff --git a/test-ansible-functional.sh b/test-ansible-functional.sh index 5e3dcc7a..e6f80c6d 100755 --- a/test-ansible-functional.sh +++ b/test-ansible-functional.sh @@ -84,26 +84,7 @@ function execute_ansible_playbook { } ## Main ---------------------------------------------------------------------- - -# NOTE(mhayden): CentOS images in the gate have several slow mirrors enabled -# by default. This step ensures that only the base and updates -# repositories are enabled. -# -# NOTE(logan): Due to the way Ansible's yum module works, we should leave all -# except these two repos globally disabled. See the link below for more info: -# https://github.com/ansible/ansible/issues/26995#issuecomment-392288700 -# -# Rather than enabling repos globally, we can use the yum repository module to -# selectively pull in packages from other repos (ie. extras, EPEL, RDO, etc.) -# on an as-needed basis in the roles where they are required using includepkgs. -# See the example here: -# https://opendev.org/openstack/openstack-ansible-lxc_hosts/src/commit/a6cae27fa3e6d03b48ba34468df4af90c77f4880/tasks/lxc_install_yum.yml#L46-L58 source /etc/os-release -if [[ -x /usr/bin/yum-config-manager ]] && [[ -e /etc/centos-release ]] && [[ ${VERSION_ID} == '7' ]] ; then - sudo yum-config-manager --disable \* > /dev/null - sudo yum-config-manager --enable base > /dev/null - sudo yum-config-manager --enable updates > /dev/null -fi # Check if SELinux is present and which mode is currently set. if [[ -x /usr/sbin/getenforce ]]; then @@ -113,10 +94,10 @@ else fi echo "Current SELinux status: ${SELINUX_STATUS}" -# NOTE(mhayden): SELinux policies for CentOS 7 are still incomplete. Ensure +# NOTE(mhayden): SELinux policies for CentOS are still incomplete. Ensure # SELinux is not in enforcing mode during tests. if [ "${SELINUX_STATUS}" == "Enforcing" ]; then - echo "NOTE: CentOS 7 SELinux policies are incomplete." + echo "NOTE: CentOS SELinux policies are incomplete." echo "Switching SELinux mode from Enforcing to Permissive." sudo /usr/sbin/setenforce 0 fi diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 4518161c..f47aa81e 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -173,25 +173,20 @@ vars: tox_env: distro_install -- job: - name: openstack-ansible-functional-centos-7 - parent: openstack-ansible-functional - nodeset: centos-7 - - job: name: openstack-ansible-functional-centos-8 parent: openstack-ansible-functional nodeset: centos-8 - job: - name: openstack-ansible-upgrade-centos-7 + name: openstack-ansible-upgrade-centos-8 parent: openstack-ansible-upgrade - nodeset: centos-7 + nodeset: centos-8 - job: - name: openstack-ansible-functional-distro_install-centos-7 + name: openstack-ansible-functional-distro_install-centos-8 parent: openstack-ansible-functional - nodeset: centos-7 + nodeset: centos-8 vars: tox_env: distro_install diff --git a/zuul.d/project-templates.yaml b/zuul.d/project-templates.yaml index 2cbf41ca..39cfb537 100644 --- a/zuul.d/project-templates.yaml +++ b/zuul.d/project-templates.yaml @@ -14,7 +14,6 @@ jobs: - openstack-ansible-linters - openstack-ansible-functional-debian-buster - - openstack-ansible-functional-centos-7 - openstack-ansible-functional-centos-8 - openstack-ansible-functional-ubuntu-bionic - openstack-ansible-functional-ubuntu-focal @@ -22,7 +21,6 @@ jobs: - openstack-ansible-linters - openstack-ansible-functional-debian-buster - - openstack-ansible-functional-centos-7 - openstack-ansible-functional-ubuntu-bionic experimental: jobs: @@ -34,12 +32,10 @@ name: openstack-ansible-upgrade check: jobs: - - openstack-ansible-upgrade-centos-7 - openstack-ansible-upgrade-ubuntu-bionic gate: jobs: - - openstack-ansible-upgrade-centos-7 - openstack-ansible-upgrade-ubuntu-bionic + - openstack-ansible-upgrade-ubuntu-bionic experimental: jobs: - openstack-ansible-upgrade-opensuse-15 @@ -49,10 +45,10 @@ name: openstack-ansible-role-distro_install-jobs check: jobs: - - openstack-ansible-functional-distro_install-centos-7 + - openstack-ansible-functional-distro_install-centos-8 gate: jobs: - - openstack-ansible-functional-distro_install-centos-7 + - openstack-ansible-functional-distro_install-centos-8 experimental: jobs: # NOTE(hwoarang) SUSE and Ubuntu distro jobs remain non-voting