Improve build images role for CentOS8

* Below is the list of improvements, it adds
- replace rhel_image_source to tripleo_image_source by maintaining
  backward compatibility
- Reset dib set_facts for RHEL and CentOS-8
- Run pathfix_repos.sh script only for few files
- Set DIB_NAME and DIB_PYTHON_VERSION for centos-8 and RHEL-8
  as the Image stills have python2 content or getting pulled by
  something else.
- Added the centos jobs to respective places
- Install pyyaml for centos-8
- Copy tripleo-centos-* repo when dib_yum_repo_conf is not defined

Change-Id: Ibcf1cbb7e3fa669e926392f3dd2c122cabb889e9
Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
This commit is contained in:
Chandan Kumar (raukadah) 2020-02-19 15:19:37 +05:30 committed by Ronelle Landy
parent caa96846dd
commit d485912d98
6 changed files with 91 additions and 12 deletions

View File

@ -17,7 +17,7 @@
shell: bash build_images.sh > {{ workspace }}/logs/script_build.log 2> {{ workspace }}/logs/script_build-err.log
changed_when: true
- when: rhel_image_source is defined
- when: tripleo_image_source is defined
block:
- name: check if overcloud images were built
stat:

View File

@ -1,20 +1,43 @@
---
- when: rhel_image_source is defined
# In order to make this role distro agnostic, it replaces
# rhel_image_source with tripleo_image_source, will be removed
# in future.
- name: Set tripleo_image_source
set_fact:
tripleo_image_source: "{{ rhel_image_source }}"
when:
- rhel_image_source is defined
- ansible_distribution == 'RedHat'
- ansible_distribution_major_version is version(8, '>=')
- when: tripleo_image_source is defined
block:
- name: Set dib_local_image and other facts used by tripleo-ci build-image role build template
- name: Set dib related facts used by tripleo-ci build-image role build template
set_fact:
dib_local_image: "{{ workspace }}/{{ rhel_image_source | urlsplit('path') | basename }}"
dib_node_dist: "rhel"
dib_local_image: "{{ workspace }}/{{ tripleo_image_source | urlsplit('path') | basename }}"
dib_node_dist: >-
{% if ansible_distribution == 'RedHat' and ansible_distribution_major_version is version(8, '>=') -%}
"rhel"
{%- else -%}
"centos"
{%- endif %}
dib_release: "8"
dib_yum_repo_conf: >-
/etc/yum.repos.d/delorean.repo
{% if ansible_distribution == 'RedHat' and ansible_distribution_major_version is version(8, '>=') -%}
/etc/yum.repos.d/delorean-rhel8-{{ release|default('master') }}-deps.repo
/etc/yum.repos.d/rh-cloud.repo
{%- else -%}
/etc/yum.repos.d/delorean-{{ release|default('master') }}-testing.repo
/etc/yum.repos.d/tripleo-centos-powertools.repo
/etc/yum.repos.d/tripleo-centos-highavailability.repo
{%- endif %}
cacheable: true
- name: Download rhel source image
- name: Download TripleO source image
get_url:
url: "{{ rhel_image_source }}"
url: "{{ tripleo_image_source }}"
dest: "{{ dib_local_image }}"
# get python_v fact used with vars/common.yaml to get
@ -22,7 +45,7 @@
- name: Get python_v fact for py2 or py3 common vars
include_tasks: check_set_py3.yaml
- name: Install pip and virtualenv
- name: Install pip pyyaml and virtualenv
become: true
package:
name: "{{ item }}"
@ -30,6 +53,7 @@
loop:
- "{{ python_version[python_v] }}-pip"
- "{{ python_version[python_v] }}-virtualenv"
- "{{ python_version[python_v] }}-pyyaml"
- when: python_v == "py3"
block:

View File

@ -26,7 +26,7 @@ fi
{% if dib_local_image is defined %}
# this is only set in rhel8 jobs dib_rhel_image -> DIB_LOCAL_IMAGE
# this is only set in rhel/centos-8 jobs dib_rhel_image -> DIB_LOCAL_IMAGE
export DIB_LOCAL_IMAGE={{ dib_local_image }}
{% endif %}
@ -34,7 +34,8 @@ export DIB_LOCAL_IMAGE={{ dib_local_image }}
{% if dib_node_dist is defined %}
export NODE_DIST={{ dib_node_dist }}
export DISTRO_NAME={{ dib_node_dist }}
export DIB_PYTHON_VERSION=3
{% endif %}
{% if dib_release is defined %}
@ -47,8 +48,11 @@ export DIB_RELEASE={{ dib_release }}
export DIB_YUM_REPO_CONF='{{ dib_yum_repo_conf }}'
{% else %}
{% elif ansible_distribution == 'CentOS' and ansible_distribution_major_version is version(8, '>=') %}
export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean* /etc/yum.repos.d/tripleo-centos*"
{% else %}
export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean*"
{% endif %}

View File

@ -565,6 +565,8 @@
post-run: playbooks/tripleo-buildimages/post.yaml
timeout: 4200
nodeset: single-centos-8-node
vars:
tripleo_image_os: centos8
required-projects:
- opendev.org/openstack/diskimage-builder
- opendev.org/openstack/heat-agents

View File

@ -7,17 +7,56 @@
check:
jobs:
- tripleo-buildimage-overcloud-full-centos-7
- tripleo-buildimage-overcloud-full-centos-8
gate:
jobs:
- tripleo-buildimage-overcloud-full-centos-7
- tripleo-buildimage-overcloud-full-centos-8
experimental:
jobs:
- tripleo-buildimage-ironic-python-agent-centos-7
- tripleo-buildimage-overcloud-hardened-full-centos-7
- tripleo-buildimage-ironic-python-agent-centos-8
- tripleo-buildimage-overcloud-hardened-full-centos-8
# CentOS 8 Image Build Jobs
- job:
name: tripleo-buildimage-ironic-python-agent-centos-8
parent: tripleo-build-images-base-centos-8
branches: ^(?!stable/(newton|ocata|pike|queens|rocky|stein|train)).*$
vars:
tripleo_image_type: ironic-python-agent
voting: false
irrelevant-files:
- ^.*\.rst$
- ^releasenotes/.*$
- job:
name: tripleo-buildimage-overcloud-full-centos-8
parent: tripleo-build-images-base-centos-8
branches: ^(?!stable/(newton|ocata|pike|queens|rocky|stein|train)).*$
vars:
tripleo_image_type: overcloud-full
irrelevant-files:
- ^.*\.rst$
- ^releasenotes/.*$
- job:
name: tripleo-buildimage-overcloud-hardened-full-centos-8
parent: tripleo-build-images-base-centos-8
branches: ^(?!stable/(newton|ocata|pike|queens|rocky|stein|train)).*$
vars:
tripleo_image_type: overcloud-hardened-full
voting: false
irrelevant-files:
- ^.*\.rst$
- ^releasenotes/.*$
# CentOS 7 Image Build Jobs
- job:
name: tripleo-buildimage-ironic-python-agent-centos-7
parent: tripleo-build-images-base
branches: ^(stable/(pike|queens|rocky|stein|train)).*$
vars:
tripleo_image_type: ironic-python-agent
tripleo_image_os: centos7
@ -29,6 +68,7 @@
- job:
name: tripleo-buildimage-overcloud-full-centos-7
parent: tripleo-build-images-base
branches: ^(stable/(pike|queens|rocky|stein|train)).*$
vars:
tripleo_image_type: overcloud-full
tripleo_image_os: centos7
@ -39,6 +79,7 @@
- job:
name: tripleo-buildimage-overcloud-hardened-full-centos-7
parent: tripleo-build-images-base
branches: ^(stable/(pike|queens|rocky|stein|train)).*$
vars:
tripleo_image_type: overcloud-hardened-full
tripleo_image_os: centos7

View File

@ -28,10 +28,16 @@
- ^setup.cfg$
- ^setup.py$
- ^tox.ini$
- tripleo-buildimage-overcloud-full-centos-7:
- tripleo-buildimage-overcloud-full-centos-8:
files: &build_images_files
- ^playbooks/tripleo-buildimages/.*$
- ^roles/oooci-build-images/.*$
- tripleo-buildimage-ironic-python-agent-centos-8:
files: *build_images_files
- tripleo-buildimage-overcloud-hardened-full-centos-8:
files: *build_images_files
- tripleo-buildimage-overcloud-full-centos-7:
files: *build_images_files
- tripleo-buildimage-ironic-python-agent-centos-7:
files: *build_images_files
- tripleo-buildimage-overcloud-hardened-full-centos-7:
@ -67,6 +73,8 @@
files: *py_files
- tripleo-buildimage-overcloud-full-centos-7:
files: *build_images_files
- tripleo-buildimage-overcloud-full-centos-8:
files: *build_images_files
- tripleo-ci-centos-7-standalone-upgrade-train:
branches: master
- tripleo-ci-centos-7-standalone-upgrade-stein: