From 9c7f558684b1f8b0464b44f24bb5ae49caba5144 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Wed, 9 Oct 2019 07:58:40 -0500 Subject: [PATCH] Update config to support RHEL/CENT8 This change updates our bindep configurations and local test runner to ensure it works with RHEL/CENT8. Change-Id: I5585fa8b6e2094132596073e6c441267a18aea90 Signed-off-by: Kevin Carter --- bindep.txt | 9 ++++--- scripts/run-local-test | 24 +++++++++++++++---- .../roles/test_deps/vars/redhat-8.yml | 23 ++++++++++++++++++ zuul.d/playbooks/pre.yml | 9 +++++++ 4 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 tripleo_ansible/roles/test_deps/vars/redhat-8.yml diff --git a/bindep.txt b/bindep.txt index 2f260196c..f24d053cd 100644 --- a/bindep.txt +++ b/bindep.txt @@ -18,12 +18,15 @@ gcc-c++ [platform:rpm] git [platform:rpm] libffi-devel [platform:rpm] openssl-devel [platform:rpm] -python-devel [platform:rpm] +python-devel [platform:rpm !platform:rhel-8] +python3-devel [platform:rpm !platform:centos-7] python2-dnf [platform:fedora] # For SELinux -libselinux-python [platform:rpm] -libsemanage-python [platform:redhat] +libselinux-python [platform:rpm !platform:rhel-8] +libsemanage-python [platform:redhat !platform:rhel-8] +libselinux-python3 [platform:rpm !platform:centos-7] +libsemanage-python3 [platform:redhat !platform:rhel-7] # Required for compressing collected log files in CI gzip diff --git a/scripts/run-local-test b/scripts/run-local-test index b2777698e..25912e9eb 100755 --- a/scripts/run-local-test +++ b/scripts/run-local-test @@ -26,6 +26,15 @@ export PROJECT_DIR="$(dirname $(readlink -f ${BASH_SOURCE[0]}))/../" export ROLE_NAME="${ROLE_NAME:-$1}" export TRIPLEO_JOB_ANSIBLE_ARGS=${TRIPLEO_JOB_ANSIBLE_ARGS:-"-v"} +## Functions ----------------------------------------------------------------- + +function run_pip { + "${HOME}/test-python/bin/pip" install \ + -r "${PROJECT_DIR}/requirements.txt" \ + -r "${PROJECT_DIR}/test-requirements.txt" \ + -r "${PROJECT_DIR}/molecule-requirements.txt" ${@:-} +} + ## Main ---------------------------------------------------------------------- # Source distribution information @@ -36,7 +45,7 @@ PYTHON_EXEC=$(command -v python3 || command -v python) # Install the one requirement we need to run any local test case "${ID,,}" in amzn|rhel|centos|fedora) - sudo "${RHT_PKG_MGR}" install -y python*-virtualenv + sudo "${RHT_PKG_MGR}" install -y gcc python*-virtualenv ;; esac @@ -51,10 +60,15 @@ esac if [[ -d "${HOME}/.cache/pip/wheels" ]]; then rm -rf "${HOME}/.cache/pip/wheels" fi -"${HOME}/test-python/bin/pip" install \ - -r "${PROJECT_DIR}/requirements.txt" \ - -r "${PROJECT_DIR}/test-requirements.txt" \ - -r "${PROJECT_DIR}/molecule-requirements.txt" +run_pip + +# NOTE(cloudnull): In some cases ansible will not be installed due to wheel +# building issues, caused by pip. If this happens we +# re-install the packages with the force flag, which will +# ensure everything is rebuilt and installed correctly. +if [ ! -f "${HOME}/test-python/bin/ansible" ]; then + run_pip --force +fi # Run local test PS1="[\u@\h \W]\$" source "${HOME}/test-python/bin/activate" diff --git a/tripleo_ansible/roles/test_deps/vars/redhat-8.yml b/tripleo_ansible/roles/test_deps/vars/redhat-8.yml new file mode 100644 index 000000000..fd85ec84e --- /dev/null +++ b/tripleo_ansible/roles/test_deps/vars/redhat-8.yml @@ -0,0 +1,23 @@ +--- +# Copyright 2019 Red Hat, Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +test_deps_repo: https://trunk.rdoproject.org/fedora/current +test_deps_selinux_packages: + - python3-libselinux +test_deps_tripleo_packages: + - python3-tripleoclient +test_deps_tripleo_repos: current-tripleo diff --git a/zuul.d/playbooks/pre.yml b/zuul.d/playbooks/pre.yml index 594df6a11..0bb536321 100644 --- a/zuul.d/playbooks/pre.yml +++ b/zuul.d/playbooks/pre.yml @@ -35,6 +35,15 @@ requirements: "{{ tripleo_ansible_project_path }}/molecule-requirements.txt" virtualenv: "{{ ansible_user_dir }}/test-python" virtualenv_site_packages: true + # NOTE(cloudnull): This is being done because docker is not supported on RHEL-8 + # and tests within this repo still require docker. + - name: Manual install container.io + become: true + package: + name: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm + when: + - (ansible_os_family | lower) == "redhat" + - (ansible_distribution_major_version | int) >= 8 tasks: - name: Get Ansible Galaxy roles command: >-