Use centos-8 stream for molecule jobs

This patch migrates all the molecule jobs for using CentOS-8 Stream
instead UBI8 images.

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: Ied32122e5ec042a141a21c8cc3b43f7e0ef65da8
(cherry picked from commit dd088d7a77)
This commit is contained in:
Gael Chamoulaud (Strider) 2021-11-24 13:10:42 +01:00
parent 3cb81f4300
commit 986047960b
No known key found for this signature in database
GPG Key ID: 4119D0305C651D66
17 changed files with 50 additions and 44 deletions

View File

@ -21,15 +21,17 @@ FROM {{ item.registry.url }}/{{ item.image }}
FROM {{ item.image }} FROM {{ item.image }}
{% endif %} {% endif %}
RUN dnf makecache && dnf install -y sudo python*-devel python*-dnf bash {{ item.pkg_extras | default('') }} RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
# TODO(gchamoul): find a better to get always the latest version of those rpms elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install sudo python*-devel python*-dnf bash epel-release {{ item.pkg_extras | default('') }} && dnf clean all; \
# below from the centos mirror elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl python-setuptools bash {{ item.pkg_extras | default('') }} && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
RUN dnf install -y http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-2.el8.noarch.rpm elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml {{ item.pkg_extras | default('') }} && zypper clean -a; \
RUN dnf install -y http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-repos-8-2.el8.noarch.rpm && dnf install -y epel-release && dnf clean all elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates {{ item.pkg_extras | default('') }}; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates {{ item.pkg_extras | default('') }} && xbps-remove -O; fi
{% for pkg in item.easy_install | default([]) %} {% for pkg in item.easy_install | default([]) %}
# install pip for centos where there is no python-pip rpm in default repos # install pip for centos where there is no python-pip rpm in default repos
RUN easy_install {{ pkg }} RUN easy_install {{ pkg }}
{% endfor %} {% endfor %}
CMD ["sh", "-c", "while true; do sleep 10000; done"] CMD ["sh", "-c", "while true; do sleep 10000; done"]

View File

@ -12,9 +12,9 @@
# you will have to redefine them completely in your molecule.yml (at the role # you will have to redefine them completely in your molecule.yml (at the role
# level) and add your extra configuration! # level) and add your extra configuration!
# #
# For instance, if you need to add an extra package in your ubi8 container, you # For instance, if you need to add an extra package in your CentOS 8 Stream
# will have to add the entire "platforms" key into your molecule.yml file and # container, you will have to add the entire "platforms" key into your
# add your package name in the pkg_extras key. # molecule.yml file and add your package name in the pkg_extras key.
# #
# No merge will happen between your molecule.yml and this config.yml # No merge will happen between your molecule.yml and this config.yml
# files. That's why you will have to redefine them completely. # files. That's why you will have to redefine them completely.
@ -25,11 +25,11 @@ driver:
log: true log: true
platforms: platforms:
- name: ubi8 - name: centos
hostname: ubi8 hostname: centos
image: ubi8/ubi-init image: centos/centos:stream8
registry: registry:
url: registry.access.redhat.com url: quay.io
dockerfile: ../../../../.config/molecule/Dockerfile dockerfile: ../../../../.config/molecule/Dockerfile
pkg_extras: python*-setuptools python*-pyyaml pkg_extras: python*-setuptools python*-pyyaml
volumes: volumes:
@ -47,7 +47,7 @@ provisioner:
hosts: hosts:
all: all:
hosts: hosts:
ubi8: centos:
ansible_python_interpreter: /usr/bin/python3 ansible_python_interpreter: /usr/bin/python3
log: true log: true
options: options:

View File

@ -2,4 +2,5 @@
collections: collections:
- containers.podman - containers.podman
- community.general - community.general
- community.crypto
- ansible.posix - ansible.posix

View File

@ -25,6 +25,13 @@
virtualenv_command: "{{ ensure_pip_virtualenv_command }}" virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
virtualenv_site_packages: true virtualenv_site_packages: true
- name: Set containers module to 3.0
become: true
shell: |
dnf module disable container-tools:rhel8 -y
dnf module enable container-tools:3.0 -y
dnf clean metadata
- name: Run bindep - name: Run bindep
shell: |- shell: |-
. {{ ansible_user_dir }}/test-python/bin/activate . {{ ansible_user_dir }}/test-python/bin/activate

View File

@ -579,10 +579,7 @@ Molecule.
driver to delegate the task of creating instances. driver to delegate the task of creating instances.
* The ``Platforms`` definitions: Molecule relies on this to know which instances * The ``Platforms`` definitions: Molecule relies on this to know which instances
to create, name and to which group each instance to create, name and to which group each instance
belongs. ``Tripleo-validations`` uses ``Universal Base Images (UBI8)`` which belongs. ``Tripleo-validations`` uses ``CentOS 8 Stream image``.
are container images based on a foundation of Red Hat Enterprise Linux
software. See `Using Red Hat Universal Base Images`_ for details on using Red
Hat UBI container images.
* The ``Provisioner``: Molecule only provides an Ansible provisioner. Ansible * The ``Provisioner``: Molecule only provides an Ansible provisioner. Ansible
manages the life cycle of the instance based on this configuration. manages the life cycle of the instance based on this configuration.
* The ``Scenario`` definition: Molecule relies on this configuration to control * The ``Scenario`` definition: Molecule relies on this configuration to control
@ -591,8 +588,6 @@ Molecule.
to write specific stat checking tests (such as deployment smoke tests) on the to write specific stat checking tests (such as deployment smoke tests) on the
target instance. target instance.
.. _Using Red Hat Universal Base Images: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/building_running_and_managing_containers/index/#using_red_hat_universal_base_images_standard_minimal_and_runtimes
Local testing of new roles Local testing of new roles
-------------------------- --------------------------

View File

@ -3,11 +3,11 @@
# To override default values, please take a look at the config.yml. # To override default values, please take a look at the config.yml.
platforms: platforms:
- name: ubi8 - name: centos
hostname: ubi8 hostname: centos
image: ubi8/ubi-init image: centos/centos:stream8
registry: registry:
url: registry.access.redhat.com url: quay.io
dockerfile: ../../../../.config/molecule/Dockerfile dockerfile: ../../../../.config/molecule/Dockerfile
pkg_extras: python*setuptools python*-pyyaml iputils pkg_extras: python*setuptools python*-pyyaml iputils
volumes: volumes:

View File

@ -46,7 +46,7 @@
include_role: include_role:
name: check_uc_hostname name: check_uc_hostname
vars: vars:
check_uc_hostname_inventory_host: ubi8 check_uc_hostname_inventory_host: centos
- name: Working 2 - openstack multiple entry in list - name: Working 2 - openstack multiple entry in list
copy: copy:
@ -83,7 +83,7 @@
include_role: include_role:
name: check_uc_hostname name: check_uc_hostname
vars: vars:
check_uc_hostname_inventory_host: ubi8 check_uc_hostname_inventory_host: centos
- name: Working 3 - openstack multiple entry in list - name: Working 3 - openstack multiple entry in list
copy: copy:
@ -117,7 +117,7 @@
include_role: include_role:
name: check_uc_hostname name: check_uc_hostname
vars: vars:
check_uc_hostname_inventory_host: ubi8 check_uc_hostname_inventory_host: centos
- name: Working 4 - openstack multiple entry in list - name: Working 4 - openstack multiple entry in list
copy: copy:
@ -149,7 +149,7 @@
include_role: include_role:
name: check_uc_hostname name: check_uc_hostname
vars: vars:
check_uc_hostname_inventory_host: ubi8 check_uc_hostname_inventory_host: centos
- name: Failing 1 - we fail if DockerInsecureRegistryAddress is not found - name: Failing 1 - we fail if DockerInsecureRegistryAddress is not found
copy: copy:
@ -176,7 +176,7 @@
- include_role: - include_role:
name: check_uc_hostname name: check_uc_hostname
vars: vars:
check_uc_hostname_inventory_host: ubi8 check_uc_hostname_inventory_host: centos
rescue: rescue:
- name: Clear host errors - name: Clear host errors
@ -219,7 +219,7 @@
- include_role: - include_role:
name: check_uc_hostname name: check_uc_hostname
vars: vars:
check_uc_hostname_inventory_host: ubi8 check_uc_hostname_inventory_host: centos
rescue: rescue:
- name: Clear host errors - name: Clear host errors

View File

@ -8,7 +8,7 @@ provisioner:
hosts: hosts:
all: all:
hosts: hosts:
ubi8: centos:
ansible_python_interpreter: /usr/bin/python3 ansible_python_interpreter: /usr/bin/python3
vars: vars:
plan: qe-Cloud-0 plan: qe-Cloud-0

View File

@ -3,11 +3,11 @@
# To override default values, please take a look at the config.yml. # To override default values, please take a look at the config.yml.
platforms: platforms:
- name: ubi8 - name: centos
hostname: ubi8 hostname: centos
image: ubi8/ubi-init image: centos/centos:stream8
registry: registry:
url: registry.access.redhat.com url: quay.io
etc_hosts: etc_hosts:
undercloud.ctlplane.mydomain.tld: "127.0.0.1" undercloud.ctlplane.mydomain.tld: "127.0.0.1"
dockerfile: ../../../../.config/molecule/Dockerfile dockerfile: ../../../../.config/molecule/Dockerfile

View File

@ -11,7 +11,7 @@ provisioner:
hosts: hosts:
all: all:
hosts: hosts:
ubi8: centos:
ansible_python_interpreter: /usr/bin/python3 ansible_python_interpreter: /usr/bin/python3
log: true log: true
env: env:

View File

@ -11,7 +11,7 @@ provisioner:
hosts: hosts:
all: all:
hosts: hosts:
ubi8: centos:
ansible_python_interpreter: /usr/bin/python3 ansible_python_interpreter: /usr/bin/python3
log: true log: true
env: env:

View File

@ -11,7 +11,7 @@ provisioner:
hosts: hosts:
all: all:
hosts: hosts:
ubi8: centos:
ansible_python_interpreter: /usr/bin/python3 ansible_python_interpreter: /usr/bin/python3
overcloud_keystone_url: http://127.0.0.1:8080 overcloud_keystone_url: http://127.0.0.1:8080
overcloud_admin_password: hello overcloud_admin_password: hello

View File

@ -11,7 +11,7 @@ provisioner:
hosts: hosts:
all: all:
hosts: hosts:
ubi8: centos:
ansible_python_interpreter: /usr/bin/python3 ansible_python_interpreter: /usr/bin/python3
overcloud_keystone_url: http://127.0.0.1:8080 overcloud_keystone_url: http://127.0.0.1:8080
overcloud_admin_password: hello overcloud_admin_password: hello

View File

@ -11,7 +11,7 @@ provisioner:
hosts: hosts:
all: all:
hosts: hosts:
ubi8: centos:
ansible_python_interpreter: /usr/bin/python3 ansible_python_interpreter: /usr/bin/python3
overcloud_keystone_url: http://127.0.0.1:8080 overcloud_keystone_url: http://127.0.0.1:8080
overcloud_admin_password: hello overcloud_admin_password: hello

View File

@ -3,11 +3,11 @@
# To override default values, please take a look at the config.yml. # To override default values, please take a look at the config.yml.
platforms: platforms:
- name: ubi8 - name: centos
hostname: ubi8 hostname: centos
image: ubi8/ubi-init image: centos/centos:stream8
registry: registry:
url: registry.access.redhat.com url: quay.io
dockerfile: ../../../../.config/molecule/Dockerfile dockerfile: ../../../../.config/molecule/Dockerfile
pkg_extras: python*-setuptools python*-pyyaml krb5-workstation pkg_extras: python*-setuptools python*-pyyaml krb5-workstation
volumes: volumes:

View File

@ -64,6 +64,7 @@ fi
PS1="[\u@\h \W]\$" source "${HOME}/test-python/bin/activate" PS1="[\u@\h \W]\$" source "${HOME}/test-python/bin/activate"
source "${PROJECT_DIR}/ansible-test-env.rc" source "${PROJECT_DIR}/ansible-test-env.rc"
export ANSIBLE_ROLES_PATH="${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" export ANSIBLE_ROLES_PATH="${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles"
ansible-galaxy install -fr "${PROJECT_DIR}/ansible-collections-requirements.yml"
ansible-playbook -i "${PROJECT_DIR}/tests/hosts.ini" \ ansible-playbook -i "${PROJECT_DIR}/tests/hosts.ini" \
-e "tripleo_src=$(realpath --relative-to="${HOME}" "${PROJECT_DIR}")" \ -e "tripleo_src=$(realpath --relative-to="${HOME}" "${PROJECT_DIR}")" \
-e "tripleo_validations_role_name=${ROLE_NAME}" \ -e "tripleo_validations_role_name=${ROLE_NAME}" \

View File

@ -2,7 +2,7 @@
- job: - job:
description: Base tripleo-validations job description: Base tripleo-validations job
name: tripleo-validations-centos-8-base name: tripleo-validations-centos-8-base
nodeset: centos-8 nodeset: centos-8-stream
parent: base parent: base
success-url: "reports.html" success-url: "reports.html"
failure-url: "reports.html" failure-url: "reports.html"