From 363e8cd6b847e818c3a59383fd681d183aadb109 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Mon, 4 Dec 2017 11:32:36 +1100 Subject: [PATCH] CentOS: Fix EPEL mirroring and RDO install on CI nodes CentOS tests have reverted to using upstream for EPEL rather than local mirrors, introducing some unnecessary instability. The root of the problem is that /etc/nodepool/provider disappeared with zuulv3, so we now always re-install the EPEL repo and overwrite the local EPEL .repos files that were made during test setup and point to local mirrors. The other change is that we stopped installing the RDO repositories on the testing nodes too. That we were incorrectly taking this path and reinstalling EPEL has hidden the removal of these packages from the base image in the test, since it ends up installing them too. Split the install into two parts -- epel and RDO. Check for /etc/ci/mirror_info.sh (the sourcable mirror script provided by base test setup) and if so, just enable EPEL so we get the CI-mirror version correctly. Install the RDO repositories (if not already installed) unconditionally. (Cherry-Picked from dc04b5aa24411b4081f0ad08021e0dc694c982e8) Change-Id: Iccb045a6695deb10da4d68a5694e1fa45ccbb810 --- stack.sh | 49 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/stack.sh b/stack.sh index ac2fc23c63..bf205f23fe 100755 --- a/stack.sh +++ b/stack.sh @@ -266,7 +266,7 @@ fi # Some distros need to add repos beyond the defaults provided by the vendor # to pick up required packages. -function _install_epel_and_rdo { +function _install_epel { # NOTE: We always remove and install latest -- some environments # use snapshot images, and if EPEL version updates they break # unless we update them to latest version. @@ -297,13 +297,28 @@ EOF yum_install epel-release || \ die $LINENO "Error installing EPEL repo, cannot continue" sudo rm -f /etc/yum.repos.d/epel-bootstrap.repo +} - # ... and also optional to be enabled +function _install_rdo { + # There are multiple options for this, including using CloudSIG + # repositories (centos-release-*), trunk versions, etc. Since + # we're not interested in the actual openstack distributions + # (since we're using git to run!) but only peripherial packages + # like kvm or ovs, this has been reliable. + + # TODO(ianw): figure out how to best mirror -- probably use infra + # mirror RDO reverse proxy. We could either have test + # infrastructure set it up disabled like EPEL, or fiddle it here. + # Per the point above, it's a bunch of repos so starts getting a + # little messy... + if ! is_package_installed rdo-release ; then + yum_install https://rdoproject.org/repos/rdo-release.rpm + fi + + # Also enable optional for RHEL7 proper. Note this is a silent + # no-op on other platforms. sudo yum-config-manager --enable rhel-7-server-optional-rpms - # install the lastest RDO - is_package_installed rdo-release || yum_install https://rdoproject.org/repos/rdo-release.rpm - if is_oraclelinux; then sudo yum-config-manager --enable ol7_optional_latest ol7_addons ol7_MySQL56 fi @@ -345,20 +360,22 @@ fi # to speed things up SKIP_EPEL_INSTALL=$(trueorfalse False SKIP_EPEL_INSTALL) -# If we have /etc/nodepool/provider assume we're on a OpenStack CI -# node, where EPEL is already pointing at our internal mirror and RDO -# is pre-installed. -if [[ -f /etc/nodepool/provider ]]; then - SKIP_EPEL_INSTALL=True - if is_fedora; then - # However, EPEL is not enabled by default. +if [[ $DISTRO == "rhel7" ]]; then + # If we have /etc/ci/mirror_info.sh assume we're on a OpenStack CI + # node, where EPEL is installed (but disabled) and already + # pointing at our internal mirror + if [[ -f /etc/ci/mirror_info.sh ]]; then + SKIP_EPEL_INSTALL=True sudo yum-config-manager --enable epel fi -fi -if is_fedora && [[ $DISTRO == "rhel7" ]] && \ - [[ ${SKIP_EPEL_INSTALL} != True ]]; then - _install_epel_and_rdo + if [[ ${SKIP_EPEL_INSTALL} != True ]]; then + _install_epel + fi + # Along with EPEL, CentOS (and a-likes) require some packages only + # available in RDO repositories (e.g. OVS, or later versions of + # kvm) to run. + _install_rdo fi # Ensure python is installed