Browse Source

Merge "Use centos-8 stream for molecule jobs" into stable/train

changes/75/825275/1
Zuul 4 months ago committed by Gerrit Code Review
parent
commit
c6d8b572fa
  1. 12
      .config/molecule/Dockerfile
  2. 16
      .config/molecule/config.yml
  3. 7
      doc/source/contributing/developer_guide.rst
  4. 8
      roles/check_network_gateway/molecule/default/molecule.yml
  5. 12
      roles/check_uc_hostname/molecule/default/converge.yml
  6. 2
      roles/check_uc_hostname/molecule/default/molecule.yml
  7. 8
      roles/image_serve/molecule/default/molecule.yml
  8. 2
      roles/oslo_config_validator/molecule/default/molecule.yml
  9. 2
      roles/oslo_config_validator/molecule/mocked_failure/molecule.yml
  10. 2
      roles/overcloud_service_status/molecule/default/molecule.yml
  11. 2
      roles/overcloud_service_status/molecule/deprecated_services/molecule.yml
  12. 2
      roles/overcloud_service_status/molecule/down_services/molecule.yml
  13. 8
      roles/tls_everywhere/molecule/default/molecule.yml
  14. 16
      scripts/run-local-test
  15. 2
      zuul.d/base.yaml
  16. 7
      zuul.d/playbooks/pre.yml

12
.config/molecule/Dockerfile

@ -21,15 +21,17 @@ FROM {{ item.registry.url }}/{{ item.image }}
FROM {{ item.image }}
{% endif %}
RUN dnf makecache && dnf install -y sudo python*-devel python*-dnf bash {{ item.pkg_extras | default('') }}
# TODO(gchamoul): find a better to get always the latest version of those rpms
# below from the centos mirror
RUN dnf install -y http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-2.el8.noarch.rpm
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
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
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; \
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; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml {{ item.pkg_extras | default('') }} && zypper clean -a; \
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([]) %}
# install pip for centos where there is no python-pip rpm in default repos
RUN easy_install {{ pkg }}
{% endfor %}
CMD ["sh", "-c", "while true; do sleep 10000; done"]

16
.config/molecule/config.yml

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

7
doc/source/contributing/developer_guide.rst

@ -579,10 +579,7 @@ Molecule.
driver to delegate the task of creating instances.
* The ``Platforms`` definitions: Molecule relies on this to know which instances
to create, name and to which group each instance
belongs. ``Tripleo-validations`` uses ``Universal Base Images (UBI8)`` which
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.
belongs. ``Tripleo-validations`` uses ``CentOS 8 Stream image``.
* The ``Provisioner``: Molecule only provides an Ansible provisioner. Ansible
manages the life cycle of the instance based on this configuration.
* 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
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
--------------------------

8
roles/check_network_gateway/molecule/default/molecule.yml

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

12
roles/check_uc_hostname/molecule/default/converge.yml

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

2
roles/check_uc_hostname/molecule/default/molecule.yml

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

8
roles/image_serve/molecule/default/molecule.yml

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

2
roles/oslo_config_validator/molecule/default/molecule.yml

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

2
roles/oslo_config_validator/molecule/mocked_failure/molecule.yml

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

2
roles/overcloud_service_status/molecule/default/molecule.yml

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

2
roles/overcloud_service_status/molecule/deprecated_services/molecule.yml

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

2
roles/overcloud_service_status/molecule/down_services/molecule.yml

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

8
roles/tls_everywhere/molecule/default/molecule.yml

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

16
scripts/run-local-test

@ -65,11 +65,11 @@ PS1="[\u@\h \W]\$" source "${HOME}/test-python/bin/activate"
source "${PROJECT_DIR}/ansible-test-env.rc"
export ANSIBLE_ROLES_PATH="${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles"
ansible-playbook -i "${PROJECT_DIR}/tests/hosts.ini" \
-e "tripleo_src=$(realpath --relative-to="${HOME}" "${PROJECT_DIR}")" \
-e "tripleo_validations_role_name=${ROLE_NAME}" \
-e "tripleo_job_ansible_args='${TRIPLEO_JOB_ANSIBLE_ARGS}'" \
-e "ansible_user=${USER}" \
-e "ansible_user_dir=${HOME}" \
"${PROJECT_DIR}/tests/prepare-test-host.yml" \
"${PROJECT_DIR}/ci/playbooks/run-local.yml" \
-v
-e "tripleo_src=$(realpath --relative-to="${HOME}" "${PROJECT_DIR}")" \
-e "tripleo_validations_role_name=${ROLE_NAME}" \
-e "tripleo_job_ansible_args='${TRIPLEO_JOB_ANSIBLE_ARGS}'" \
-e "ansible_user=${USER}" \
-e "ansible_user_dir=${HOME}" \
"${PROJECT_DIR}/tests/prepare-test-host.yml" \
"${PROJECT_DIR}/ci/playbooks/run-local.yml" \
-v

2
zuul.d/base.yaml

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

7
zuul.d/playbooks/pre.yml

@ -25,6 +25,13 @@
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
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
shell: |-
. {{ ansible_user_dir }}/test-python/bin/activate

Loading…
Cancel
Save