diff --git a/.zuul.d/centos.yaml b/.zuul.d/centos.yaml index 9910aade01..7d528275fc 100644 --- a/.zuul.d/centos.yaml +++ b/.zuul.d/centos.yaml @@ -4,6 +4,8 @@ jobs: - kolla-build-centos-binary - kolla-build-centos-source + - kolla-build-centos8-binary + - kolla-build-centos8-source - kolla-ansible-centos-source - kolla-ansible-centos-binary - kolla-ansible-centos-source-upgrade @@ -33,6 +35,7 @@ queue: kolla jobs: - kolla-build-centos-source + - kolla-build-centos8-source - kolla-ansible-centos-source - kolla-ansible-centos-source-upgrade - tripleo-build-containers-centos-7: @@ -48,10 +51,14 @@ jobs: - kolla-publish-centos-source - kolla-publish-centos-binary + - kolla-publish-centos8-source + - kolla-publish-centos8-binary release: jobs: - kolla-publish-centos-source - kolla-publish-centos-binary + - kolla-publish-centos8-source + - kolla-publish-centos8-binary - job: name: kolla-build-centos-binary @@ -63,6 +70,12 @@ base_distro: centos install_type: binary +- job: + name: kolla-build-centos8-binary + parent: kolla-build-centos-binary + vars: + base_tag: 8 + - job: name: kolla-publish-centos-binary parent: kolla-build-centos-binary @@ -72,6 +85,12 @@ secrets: - kolla_dockerhub_creds +- job: + name: kolla-publish-centos8-binary + parent: kolla-publish-centos-binary + vars: + base_tag: 8 + - job: name: kolla-build-centos-source parent: kolla-base @@ -81,6 +100,12 @@ base_distro: centos install_type: source +- job: + name: kolla-build-centos8-source + parent: kolla-build-centos-source + vars: + base_tag: 8 + - job: name: kolla-publish-centos-source parent: kolla-build-centos-source @@ -89,3 +114,9 @@ publisher: true secrets: - kolla_dockerhub_creds + +- job: + name: kolla-publish-centos8-source + parent: kolla-publish-centos-source + vars: + base_tag: 8 diff --git a/kolla/image/build.py b/kolla/image/build.py index 6d78245387..0bdcfb5e33 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -143,6 +143,12 @@ UNBUILDABLE_IMAGES = { 'centos': { "ovsdpdk", }, + + # NOTE(mgoddard): Mark all images unbuildable for CentOS 8. + 'centos8': { + "base", + }, + 'debian': { "bifrost-base", # tries to install 'mysql-server' which is not in # Debian 'buster' @@ -1043,7 +1049,15 @@ class KollaWorker(object): filter_ += self.conf.profiles[profile] # mark unbuildable images and their children - tag_element = r'(%s|%s|%s)' % (self.base, + + # NOTE(mgoddard): Use a base of centos8 to allow a different set of + # unbuildable images for CentOS 8. + # TODO(mgoddard): Remove this after CentOS 8 transition. + base = self.base + if base == 'centos' and self.distro_package_manager == 'dnf': + base = 'centos8' + + tag_element = r'(%s|%s|%s)' % (base, self.install_type, self.base_arch) tag_re = re.compile(r'^%s(\+%s)*$' % (tag_element, tag_element)) diff --git a/tests/playbooks/run.yml b/tests/playbooks/run.yml index cd2f5ca8c0..6ccd38f995 100644 --- a/tests/playbooks/run.yml +++ b/tests/playbooks/run.yml @@ -33,6 +33,6 @@ dest: /etc/kolla/template_overrides.j2 - name: Run tox - command: tox -e {{ action }}-{{ base_distro }}-{{ install_type }} + command: tox -e {{ action }}-{{ base_distro }}{{ base_tag | default('') }}-{{ install_type }} args: chdir: "{{ zuul.project.src_dir }}" diff --git a/tests/test_build.py b/tests/test_build.py index 57e8a0b9a5..6fdb4288ca 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -79,6 +79,30 @@ class BuildTestCentosSource(BuildTest, base.BaseTestCase): "--type", "source"]) +class BuildTestCentos8Binary(BuildTest, base.BaseTestCase): + + def setUp(self): + super(BuildTestCentos8Binary, self).setUp() + # TODO(mgoddard): Remove --base-tag and --tag arguments when CentOS 8 + # is the default. + self.build_args.extend(["--base", "centos", + "--base-tag", "8", + "--tag", "master-centos8", + "--type", "binary"]) + + +class BuildTestCentos8Source(BuildTest, base.BaseTestCase): + + def setUp(self): + super(BuildTestCentos8Source, self).setUp() + # TODO(mgoddard): Remove --base-tag and --tag arguments when CentOS 8 + # is the default. + self.build_args.extend(["--base", "centos", + "--base-tag", "8", + "--tag", "master-centos8", + "--type", "source"]) + + class BuildTestUbuntuBinary(BuildTest, base.BaseTestCase): def setUp(self): diff --git a/tox.ini b/tox.ini index 9bb7e0e834..89ccf3a2cf 100644 --- a/tox.ini +++ b/tox.ini @@ -103,6 +103,26 @@ commands = bash -c "if [ ! -d .stestr ]; then stestr init; fi" stestr run test_build.BuildTestCentosSource +[testenv:build-centos8-binary] +whitelist_externals = find + bash +setenv = + DOCKER_BUILD_TEST=1 +commands = + find . -type f -name "*.py[c|o]" -delete -o -type l -name "*.py[c|o]" -delete + bash -c "if [ ! -d .stestr ]; then stestr init; fi" + stestr run test_build.BuildTestCentos8Binary + +[testenv:build-centos8-source] +whitelist_externals = find + bash +setenv = + DOCKER_BUILD_TEST=1 +commands = + find . -type f -name "*.py[c|o]" -delete -o -type l -name "*.py[c|o]" -delete + bash -c "if [ ! -d .stestr ]; then stestr init; fi" + stestr run test_build.BuildTestCentos8Source + [testenv:build-ubuntu-binary] whitelist_externals = find bash