Replace CentOS 7 images with CentOS 8

CentOS 7 uses Python 2. Although it's possible to install Python 3
on it, it not trivial with DIB. We should rather switch to
a distribution where Python 3 is the default version.

As a nice side effect, the CentOS 8 images seem smaller.

The CentOS 7 job definitions are kept around since they're used
on stable/train.

Change-Id: I6b23da21eab19c69f7b070adff76b35e1752bf8d
This commit is contained in:
Dmitry Tantsur 2019-11-27 19:29:47 +01:00
parent a6c0f2ce63
commit 3c78c29e94
5 changed files with 46 additions and 10 deletions

View File

@ -29,6 +29,17 @@
image_type: 'dib'
image_distro: 'centos7'
- job:
name: ironic-python-agent-build-image-dib-centos8
parent: ironic-python-agent-build-image-base
required-projects:
# NOTE(dtantsur): used for bindep only
- openstack/diskimage-builder
vars:
image_type: 'dib'
image_distro: 'centos-minimal'
image_release: 8
- job:
name: ironic-python-agent-check-image-base
parent: base
@ -122,9 +133,7 @@
- ipa-tempest-wholedisk-bios-ipmi-direct-tinyipa-src
- ipa-tempest-wholedisk-bios-ipmi-iscsi-tinyipa-src
- ironic-python-agent-check-image-tinyipa
- ironic-python-agent-check-image-dib-centos7
- ironic-python-agent-check-image-dib-centos8:
voting: false
- ironic-python-agent-check-image-dib-centos8
- ironic-python-agent-check-image-dib-fedora:
voting: false
- ironic-python-agent-check-image-dib-ubuntu:
@ -144,9 +153,9 @@
- ipa-tempest-wholedisk-bios-ipmi-direct-tinyipa-src
- ipa-tempest-wholedisk-bios-ipmi-iscsi-tinyipa-src
- ironic-python-agent-check-image-tinyipa
- ironic-python-agent-check-image-dib-centos7
- ironic-python-agent-check-image-dib-centos8
post:
jobs:
- publish-openstack-python-branch-tarball
- ironic-python-agent-build-image-tinyipa
- ironic-python-agent-build-image-dib-centos7
- ironic-python-agent-build-image-dib-centos8

View File

@ -20,13 +20,13 @@ You can add other diskimage-builder_ elements via the ``-e`` flag:
.. code-block:: shell
ironic-python-agent-builder -e <extra-element> centos7
ironic-python-agent-builder -e <extra-element> --release 8 centos-minimal
You can specify the base name of the target images:
.. code-block:: shell
ironic-python-agent-builder -o my-ipa centos7
ironic-python-agent-builder -o my-ipa --release 8 centos-minimal
You can specify the arch of the target image by setting ``ARCH`` environment
variable (default is amd64):
@ -65,8 +65,9 @@ for example:
.. code-block:: shell
export DIB_RELEASE=8
disk-image-create -o ironic-python-agent \
ironic-python-agent-ramdisk centos7 dhcp-all-interfaces
ironic-python-agent-ramdisk centos-minimal
To use a specific branch of ironic-python-agent, use:

View File

@ -0,0 +1,11 @@
---
deprecations:
- |
Building images for CentOS 7 and other distribution releases that default
to Python 2 is deprecated.
other:
- |
Since ironic-python-agent has removed support for Python 2, CentOS 8 images
are now built and published on https://tarballs.openstack.org instead of
CentOS 7 ones. The CentOS 7 images should not be used for Ussuri and later
releases.

View File

@ -1,5 +1,6 @@
image_distro: centos7
image_distro: centos-minimal
image_release:
image_target_name:
ipa_branch_path: '{{ zuul.branch | replace("/", "-") }}'
ipa_source_path: '{{ ansible_user_dir }}/src/opendev.org/openstack/ironic-python-agent'
requirements_path: '{{ ansible_user_dir }}/src/opendev.org/openstack/requirements'

View File

@ -1,6 +1,20 @@
- name: Default to CentOS 8
set_fact:
image_release: 8
when:
- image_distro == "centos-minimal"
- not image_release
- name: Generate a nice target name for CentOS
set_fact:
image_target_name: centos{{ image_release }}
when:
- image_distro == "centos-minimal"
- not image_target_name
- name: Generate image name
set_fact:
image_name: ipa-{{ image_distro }}-{{ ipa_branch_path }}
image_name: ipa-{{ image_target_name | default(image_distro, true) }}-{{ ipa_branch_path }}
- name: Build a DIB image
command: |