diff options
Diffstat (limited to 'kolla')
| -rwxr-xr-x | kolla/common/config.py | 19 | ||||
| -rwxr-xr-x | kolla/image/build.py | 25 | ||||
| -rw-r--r-- | kolla/template/methods.py | 12 | ||||
| -rw-r--r-- | kolla/template/repos.yaml | 26 | ||||
| -rw-r--r-- | kolla/tests/test_build.py | 29 | ||||
| -rw-r--r-- | kolla/tests/test_methods.py | 18 |
6 files changed, 25 insertions, 104 deletions
diff --git a/kolla/common/config.py b/kolla/common/config.py index c086b6b15..2746fddea 100755 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -13,7 +13,6 @@ import itertools import os -from distutils.version import LooseVersion from oslo_config import cfg from oslo_config import types @@ -34,17 +33,12 @@ DISTRO_RELEASE = { 'debian': '10', 'ubuntu': '18.04', } -# NOTE(mgoddard): The default release is set to 'train' for CentOS/RHEL 7 due -# to master dropping support for Python 2. OPENSTACK_RELEASE = 'master' # This is noarch repository so we will use it on all architectures -DELOREAN = \ - "https://trunk.rdoproject.org/centos7/current-passed-ci/delorean.repo" -DELOREAN_DEPS = "https://trunk.rdoproject.org/centos7/delorean-deps.repo" -DELOREAN_CENTOS8 = "https://trunk.rdoproject.org/centos8-master/" \ +DELOREAN = "https://trunk.rdoproject.org/centos8-master/" \ "consistent/delorean.repo" -DELOREAN_DEPS_CENTOS8 = "https://trunk.rdoproject.org/centos8-master/" \ +DELOREAN_DEPS = "https://trunk.rdoproject.org/centos8-master/" \ "delorean-deps.repo" INSTALL_TYPE_CHOICES = ['binary', 'source', 'rdo', 'rhos'] @@ -1242,15 +1236,6 @@ def parse(conf, args, usage=None, prog=None, # NOTE(jeffrey4l): set the default base tag based on the # base option conf.set_default('base_tag', DEFAULT_BASE_TAGS.get(conf.base)) - # TODO(mgoddard): Remove this 'if' when CentOS 7 is no longer supported. - if conf.base in ['centos', 'rhel']: - if LooseVersion(conf.base_tag) >= LooseVersion('8'): - # Use CentOS 8 Delorean repos. - conf.set_default('rpm_setup_config', [DELOREAN_CENTOS8, - DELOREAN_DEPS_CENTOS8]) - else: - # Use Train packages on CentOS 7 due to python 2 drop. - conf.set_default('openstack_release', 'train') prefix = '' if conf.openstack_release == 'master' else 'stable-' openstack_branch = '{}{}'.format(prefix, conf.openstack_release) conf.set_default('openstack_branch', openstack_branch) diff --git a/kolla/image/build.py b/kolla/image/build.py index b13ff5cab..7f5c833e4 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -28,7 +28,6 @@ import tempfile import threading import time -from distutils.version import LooseVersion from distutils.version import StrictVersion import docker import git @@ -135,12 +134,7 @@ UNBUILDABLE_IMAGES = { }, 'centos': { - "ovsdpdk", - }, - - # NOTE(mgoddard): Mark images with missing dependencies as unbuildable for - # CentOS 8. - 'centos8': { + "cyborg-base", # package only for CentOS 7 "elasticsearch", # Missing elasticsearch repo "hacluster-pcs", # Missing crmsh package "kibana", # Missing elasticsearch repo @@ -152,7 +146,7 @@ UNBUILDABLE_IMAGES = { "tgtd", # Not supported on CentOS 8 }, - 'centos8+source': { + 'centos+source': { "cyborg-agent", # opae-sdk does not support CentOS 8 }, @@ -732,9 +726,7 @@ class KollaWorker(object): deb_base = ['ubuntu', 'debian'] deb_type = ['source', 'binary'] - if self.base in rh_base and self.base_tag.startswith('7'): - self.conf.distro_python_version = "2.7" - elif self.base in rh_base and self.base_tag.startswith('8'): + if self.base in rh_base: self.conf.distro_python_version = "3.6" elif self.base in ['debian']: self.conf.distro_python_version = "3.7" @@ -747,10 +739,7 @@ class KollaWorker(object): if self.conf.distro_package_manager is not None: package_manager = self.conf.distro_package_manager elif self.base in rh_base: - if LooseVersion(self.base_tag) >= LooseVersion('8'): - package_manager = 'dnf' - else: - package_manager = 'yum' + package_manager = 'dnf' elif self.base in deb_base: package_manager = 'apt' self.distro_package_manager = package_manager @@ -1057,13 +1046,7 @@ class KollaWorker(object): filter_ += self.conf.profiles[profile] # mark unbuildable images and their children - - # 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, diff --git a/kolla/template/methods.py b/kolla/template/methods.py index fb470a65f..19fcf4e22 100644 --- a/kolla/template/methods.py +++ b/kolla/template/methods.py @@ -100,11 +100,6 @@ def handle_repos(context, reponames, mode): base_package_type = context.get('base_package_type') base_distro = context.get('base_distro') base_arch = context.get('base_arch') - distro_package_manager = context.get('distro_package_manager') - - # TODO(mgoddard): Remove this when CentOS 7 support is no longer present. - if base_distro == 'centos' and distro_package_manager == 'dnf': - base_distro = 'centos8' commands = '' @@ -130,11 +125,8 @@ def handle_repos(context, reponames, mode): if base_package_type == 'rpm' and commands: # NOTE(hrw): if commands is empty then no repos are enabled # otherwise we need to add command to handle repositories - if distro_package_manager == 'yum': - commands = 'yum-config-manager %s' % commands - elif distro_package_manager == 'dnf': - # NOTE(hrw) dnf errors out if we enable unknown repo - commands = 'dnf config-manager %s || true' % commands + # NOTE(hrw) dnf errors out if we enable unknown repo + commands = 'dnf config-manager %s || true' % commands elif base_package_type == 'deb': # NOTE(hrw): Debian commands end with '&&' commands = commands[0:-4] diff --git a/kolla/template/repos.yaml b/kolla/template/repos.yaml index e3cb9cbbb..1ed325141 100644 --- a/kolla/template/repos.yaml +++ b/kolla/template/repos.yaml @@ -1,56 +1,44 @@ --- -# TODO(mgoddard): Remove this when CentOS 7 support is no longer present. +# TODO(mnasiadka): Rework the repo list once Ceph Octopus is released centos: ceph: "centos-ceph-nautilus" elasticsearch: "elasticsearch-kibana-logstash-6.x" epel: "epel" + epel-modular: "epel-modular" erlang: "rabbitmq_rabbitmq-erlang" extras: "extras" grafana: "grafana" - hacluster: "network_ha-clustering_Stable" + hacluster: "HighAvailability" influxdb: "influxdb" kibana: "elasticsearch-kibana-logstash-6.x" nfs-ganesha: "centos-nfs-ganesha28" - opendaylight: "opendaylight" opstools: "centos-release-opstools" rabbitmq: "rabbitmq_rabbitmq-server" td-agent: "treasuredata" -# TODO(mgoddard): Remove this when CentOS 7 support is no longer present. centos-aarch64: ceph: "centos-ceph-nautilus" elasticsearch: "elasticsearch-kibana-logstash-6.x" epel: "epel" + epel-modular: "epel-modular" erlang: "rabbitmq_rabbitmq-erlang" extras: "extras" grafana: "grafana" + hacluster: "HighAvailability" nfs-ganesha: "centos-nfs-ganesha28" - opendaylight: "opendaylight" opstools: "centos-release-opstools" rabbitmq: "rabbitmq_rabbitmq-server" -# TODO(mgoddard): Remove this when CentOS 7 support is no longer present. centos-ppc64le: ceph: "centos-ceph-nautilus" elasticsearch: "elasticsearch-kibana-logstash-6.x" epel: "epel" - extras: "extras" - nfs-ganesha: "centos-nfs-ganesha28" - opstools: "centos-release-opstools" - rabbitmq: "rabbitmq_rabbitmq-server" - -# TODO(mnasiadka): Rework the repo list once Ceph Octopus is released -centos8: - ceph: "centos-ceph-nautilus" epel-modular: "epel-modular" - epel: "epel" - erlang: "rabbitmq_rabbitmq-erlang" - grafana: "grafana" + extras: "extras" hacluster: "HighAvailability" - influxdb: "influxdb" nfs-ganesha: "centos-nfs-ganesha28" + opstools: "centos-release-opstools" rabbitmq: "rabbitmq_rabbitmq-server" - td-agent: "treasuredata" # NOTE(hrw): empty dict to avoid TypeError rhel: {} diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py index 1b633de4c..ad5e47600 100644 --- a/kolla/tests/test_build.py +++ b/kolla/tests/test_build.py @@ -551,19 +551,12 @@ class KollaWorkerTest(base.TestCase): kolla = build.KollaWorker(self.conf) self.assertEqual('3.6', kolla.distro_python_version) - def test_build_distro_python_version_centos7(self): - """check distro_python_version for CentOS 7.6.1810""" + def test_build_distro_python_version_centos(self): + """check distro_python_version for CentOS 8.0.1905""" self.conf.set_override('base', 'centos') - self.conf.set_override('base_tag', '7.6.1810') + self.conf.set_override('base_tag', '8.0.1905') kolla = build.KollaWorker(self.conf) - self.assertEqual('2.7', kolla.distro_python_version) - - def test_build_distro_python_version_rhel7(self): - """check distro_python_version for RHEL7""" - self.conf.set_override('base', 'rhel') - self.conf.set_override('base_tag', '7') - kolla = build.KollaWorker(self.conf) - self.assertEqual('2.7', kolla.distro_python_version) + self.assertEqual('3.6', kolla.distro_python_version) def test_build_distro_package_manager(self): """check distro_package_manager conf value is taken""" @@ -585,20 +578,6 @@ class KollaWorkerTest(base.TestCase): kolla = build.KollaWorker(self.conf) self.assertEqual('dnf', kolla.distro_package_manager) - def test_build_distro_package_manager_rhel7(self): - """check distro_package_manager yum for rhel7""" - self.conf.set_override('base', 'rhel') - self.conf.set_override('base_tag', '7') - kolla = build.KollaWorker(self.conf) - self.assertEqual('yum', kolla.distro_package_manager) - - def test_build_distro_package_manager_rhel7_minor(self): - """check distro_package_manager yum for rhel7""" - self.conf.set_override('base', 'rhel') - self.conf.set_override('base_tag', '7.6.1801') - kolla = build.KollaWorker(self.conf) - self.assertEqual('yum', kolla.distro_package_manager) - def test_build_distro_package_manager_debian(self): """check distro_package_manager apt for debian""" self.conf.set_override('base', 'debian') diff --git a/kolla/tests/test_methods.py b/kolla/tests/test_methods.py index bc2021a98..0a1c5bd5a 100644 --- a/kolla/tests/test_methods.py +++ b/kolla/tests/test_methods.py @@ -27,7 +27,6 @@ class MethodsTest(base.TestCase): 'base_arch': 'x86_64', 'base_distro': 'rhel', 'base_package_type': 'rpm', - 'distro_package_manager': 'yum' } result = methods.handle_repos(template_vars, ['grafana'], 'enable') @@ -39,11 +38,10 @@ class MethodsTest(base.TestCase): 'base_arch': 'x86_64', 'base_distro': 'centos', 'base_package_type': 'rpm', - 'distro_package_manager': 'yum' } result = methods.handle_repos(template_vars, ['grafana'], 'enable') - expectCmd = 'RUN yum-config-manager --enable grafana' + expectCmd = 'RUN dnf config-manager --enable grafana || true' self.assertEqual(expectCmd, result) def test_enable_repos_centos_missing_repo(self): @@ -51,7 +49,6 @@ class MethodsTest(base.TestCase): 'base_arch': 'x86_64', 'base_distro': 'centos', 'base_package_type': 'rpm', - 'distro_package_manager': 'yum' } result = methods.handle_repos(template_vars, ['missing_repo'], @@ -64,13 +61,12 @@ class MethodsTest(base.TestCase): 'base_arch': 'x86_64', 'base_distro': 'centos', 'base_package_type': 'rpm', - 'distro_package_manager': 'yum' } result = methods.handle_repos(template_vars, ['grafana', 'ceph'], 'enable') - expectCmd = 'RUN yum-config-manager --enable grafana ' - expectCmd += '--enable centos-ceph-nautilus' + expectCmd = 'RUN dnf config-manager --enable grafana ' + expectCmd += '--enable centos-ceph-nautilus || true' self.assertEqual(expectCmd, result) def test_enable_repos_debian(self): @@ -118,11 +114,10 @@ class MethodsTest(base.TestCase): 'base_arch': 'x86_64', 'base_distro': 'centos', 'base_package_type': 'rpm', - 'distro_package_manager': 'yum' } result = methods.handle_repos(template_vars, ['grafana'], 'disable') - expectCmd = 'RUN yum-config-manager --disable grafana' + expectCmd = 'RUN dnf config-manager --disable grafana || true' self.assertEqual(expectCmd, result) def test_disable_repos_centos_multiple(self): @@ -130,13 +125,12 @@ class MethodsTest(base.TestCase): 'base_arch': 'x86_64', 'base_distro': 'centos', 'base_package_type': 'rpm', - 'distro_package_manager': 'yum' } result = methods.handle_repos(template_vars, ['grafana', 'ceph'], 'disable') - expectCmd = 'RUN yum-config-manager --disable grafana ' - expectCmd += '--disable centos-ceph-nautilus' + expectCmd = 'RUN dnf config-manager --disable grafana ' + expectCmd += '--disable centos-ceph-nautilus || true' self.assertEqual(expectCmd, result) # NOTE(hrw): there is no disabling of repos for Debian/Ubuntu |
