diff --git a/.zuul.d/centos.yaml b/.zuul.d/centos.yaml index cf47791986..9f8a1f4e97 100644 --- a/.zuul.d/centos.yaml +++ b/.zuul.d/centos.yaml @@ -57,7 +57,6 @@ nodeset: kolla-centos8-stream vars: base_distro: centos - install_type: source - job: name: kolla-build-centos8s-aarch64 @@ -93,4 +92,3 @@ nodeset: kolla-centos8-stream vars: base_distro: centos - install_type: source diff --git a/.zuul.d/debian.yaml b/.zuul.d/debian.yaml index 7903bcc3d6..acfac01ea2 100644 --- a/.zuul.d/debian.yaml +++ b/.zuul.d/debian.yaml @@ -35,7 +35,6 @@ nodeset: kolla-debian-bullseye vars: base_distro: debian - install_type: source - job: name: kolla-build-debian-aarch64 @@ -92,4 +91,3 @@ nodeset: kolla-debian-bullseye vars: base_distro: debian - install_type: source diff --git a/.zuul.d/ubuntu.yaml b/.zuul.d/ubuntu.yaml index 20dc92e7d8..19702db4da 100644 --- a/.zuul.d/ubuntu.yaml +++ b/.zuul.d/ubuntu.yaml @@ -55,7 +55,6 @@ nodeset: kolla-ubuntu-focal vars: base_distro: ubuntu - install_type: source - job: name: kolla-build-ubuntu-aarch64 @@ -91,4 +90,3 @@ nodeset: kolla-ubuntu-focal vars: base_distro: ubuntu - install_type: source diff --git a/doc/source/admin/kolla_api.rst b/doc/source/admin/kolla_api.rst index b366de6962..4555782125 100644 --- a/doc/source/admin/kolla_api.rst +++ b/doc/source/admin/kolla_api.rst @@ -168,5 +168,3 @@ scripts: * **KOLLA_BASE_DISTRO**: ``base_distro`` used to build the image (e.g. centos, ubuntu) -* **KOLLA_INSTALL_TYPE**: ``install_type`` used to build the image (binary, - source) diff --git a/kolla/common/config.py b/kolla/common/config.py index 6443036cf7..dda2e2010d 100755 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -202,10 +202,11 @@ _CLI_OPTS = [ help='Format to write the final results in'), cfg.StrOpt('tarballs-base', default=TARBALLS_BASE, help='Base url to OpenStack tarballs'), + # NOTE(hrw): deprecate argument in Zed, remove in A-cycle cfg.StrOpt('type', short='t', default='source', choices=INSTALL_TYPE_CHOICES, dest='install_type', - help=('The method of the OpenStack install.')), + help=('Ignored, kept for script compatibility.')), cfg.IntOpt('threads', short='T', default=8, min=1, help=('The number of threads to use while building.' ' (Note: setting to one will allow real time' diff --git a/kolla/image/build.py b/kolla/image/build.py index 4a6ecd4955..7d80916826 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -75,9 +75,9 @@ STATUS_ERRORS = (Status.CONNECTION_ERROR, Status.PUSH_ERROR, LOG = utils.make_a_logger() # The dictionary of unbuildable images supports keys in the format: -# '++' where each component is optional -# and can be omitted along with the + separator which means that component -# is irrelevant. Otherwise all must match for skip to happen. +# '+' where each component is optional and can be omitted along +# with the + separator which means that component is irrelevant. Otherwise all +# must match for skip to happen. UNBUILDABLE_IMAGES = { 'aarch64': { "bifrost-base", # someone need to get upstream working first @@ -478,27 +478,26 @@ class BuildTask(DockerTask): if image.status in STATUS_ERRORS: return - if self.conf.install_type == 'source': - try: - plugins_am = make_an_archive(image.plugins, 'plugins') - except ArchivingError: - self.logger.error( - "Failed turning any plugins into a plugins archive") - return - else: - self.logger.debug( - "Turned %s plugins into plugins archive", - plugins_am) - try: - additions_am = make_an_archive(image.additions, 'additions') - except ArchivingError: - self.logger.error( - "Failed turning any additions into a additions archive") - return - else: - self.logger.debug( - "Turned %s additions into additions archive", - additions_am) + try: + plugins_am = make_an_archive(image.plugins, 'plugins') + except ArchivingError: + self.logger.error( + "Failed turning any plugins into a plugins archive") + return + else: + self.logger.debug( + "Turned %s plugins into plugins archive", + plugins_am) + try: + additions_am = make_an_archive(image.additions, 'additions') + except ArchivingError: + self.logger.error( + "Failed turning any additions into a additions archive") + return + else: + self.logger.debug( + "Turned %s additions into additions archive", + additions_am) # Pull the latest image for the base distro only pull = self.conf.pull if image.parent is None else False @@ -610,7 +609,6 @@ class KollaWorker(object): self.base = conf.base self.use_dumb_init = conf.use_dumb_init self.base_tag = conf.base_tag - self.install_type = conf.install_type self.tag = conf.tag self.base_arch = conf.base_arch self.debian_arch = self.base_arch @@ -649,7 +647,8 @@ class KollaWorker(object): self.clean_package_cache = self.conf.clean_package_cache - self.image_prefix = self.base + '-' + self.install_type + '-' + # TODO(hrw): to remove "source-" in a later patch + self.image_prefix = self.base + '-source-' self.regex = conf.regex self.image_statuses_bad = dict() @@ -834,7 +833,6 @@ class KollaWorker(object): 'docker_healthchecks': self.docker_healthchecks, 'supported_distro_name': supported_distro_name, 'image_prefix': self.image_prefix, - 'install_type': self.install_type, 'namespace': self.namespace, 'openstack_release': self.openstack_release, 'tag': self.tag, @@ -924,9 +922,7 @@ class KollaWorker(object): # mark unbuildable images and their children base = self.base - tag_element = r'(%s|%s|%s)' % (base, - self.install_type, - self.base_arch) + tag_element = r'(%s|%s)' % (base, self.base_arch) tag_re = re.compile(r'^%s(\+%s)*$' % (tag_element, tag_element)) unbuildable_images = set() @@ -1159,41 +1155,40 @@ class KollaWorker(object): logger=utils.make_a_logger(self.conf, image_name), docker_client=self.dc) - if self.install_type == 'source': - # NOTE(jeffrey4l): register the opts if the section didn't - # register in the kolla/common/config.py file - if image.name not in self.conf._groups: - self.conf.register_opts(common_config.get_source_opts(), - image.name) - image.source = process_source_installation(image, image.name) - for plugin in [match.group(0) for match in - (re.search('^{}-plugin-.+'.format(image.name), - section) for section in - all_sections) if match]: - try: - self.conf.register_opts( - common_config.get_source_opts(), - plugin - ) - except cfg.DuplicateOptError: - LOG.debug('Plugin %s already registered in config', - plugin) - image.plugins.append( - process_source_installation(image, plugin)) - for addition in [ - match.group(0) for match in - (re.search('^{}-additions-.+'.format(image.name), - section) for section in all_sections) if match]: - try: - self.conf.register_opts( - common_config.get_source_opts(), - addition - ) - except cfg.DuplicateOptError: - LOG.debug('Addition %s already registered in config', - addition) - image.additions.append( - process_source_installation(image, addition)) + # NOTE(jeffrey4l): register the opts if the section didn't + # register in the kolla/common/config.py file + if image.name not in self.conf._groups: + self.conf.register_opts(common_config.get_source_opts(), + image.name) + image.source = process_source_installation(image, image.name) + for plugin in [match.group(0) for match in + (re.search('^{}-plugin-.+'.format(image.name), + section) for section in + all_sections) if match]: + try: + self.conf.register_opts( + common_config.get_source_opts(), + plugin + ) + except cfg.DuplicateOptError: + LOG.debug('Plugin %s already registered in config', + plugin) + image.plugins.append( + process_source_installation(image, plugin)) + for addition in [ + match.group(0) for match in + (re.search('^{}-additions-.+'.format(image.name), + section) for section in all_sections) if match]: + try: + self.conf.register_opts( + common_config.get_source_opts(), + addition + ) + except cfg.DuplicateOptError: + LOG.debug('Addition %s already registered in config', + addition) + image.additions.append( + process_source_installation(image, addition)) self.images.append(image) diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py index 0dac5ecb69..78be9c7751 100644 --- a/kolla/tests/test_build.py +++ b/kolla/tests/test_build.py @@ -373,9 +373,6 @@ class KollaWorkerTest(base.TestCase): build.KollaWorker(self.conf) def test_build_image_list_adds_plugins(self): - - self.conf.set_override('install_type', 'source') - kolla = build.KollaWorker(self.conf) kolla.setup_working_dir() kolla.find_dockerfiles() @@ -401,8 +398,6 @@ class KollaWorkerTest(base.TestCase): self.fail('Can not find the expected neutron arista plugin') def test_build_image_list_skips_disabled_plugins(self): - - self.conf.set_override('install_type', 'source') self.conf.set_override('enabled', False, 'neutron-base-plugin-networking-baremetal') @@ -426,8 +421,6 @@ class KollaWorkerTest(base.TestCase): def test_build_image_list_plugin_parsing(self): """Ensure regex used to parse plugins adds them to the correct image""" - self.conf.set_override('install_type', 'source') - kolla = build.KollaWorker(self.conf) kolla.setup_working_dir() kolla.find_dockerfiles() @@ -443,7 +436,6 @@ class KollaWorkerTest(base.TestCase): self.fail('Expected to find the base image in this test') def test_set_time(self): - self.conf.set_override('install_type', 'source') kolla = build.KollaWorker(self.conf) kolla.setup_working_dir() kolla.set_time() @@ -543,7 +535,6 @@ class KollaWorkerTest(base.TestCase): def test_build_distro_python_version_debian(self): """check distro_python_version for Debian""" self.conf.set_override('base', 'debian') - self.conf.set_override('install_type', 'source') kolla = build.KollaWorker(self.conf) self.assertEqual('3.9', kolla.distro_python_version) @@ -569,7 +560,6 @@ class KollaWorkerTest(base.TestCase): def test_build_distro_package_manager_debian(self): """check distro_package_manager apt for debian""" self.conf.set_override('base', 'debian') - self.conf.set_override('install_type', 'source') kolla = build.KollaWorker(self.conf) self.assertEqual('apt', kolla.distro_package_manager) @@ -588,7 +578,6 @@ class KollaWorkerTest(base.TestCase): def test_base_package_type_debian(self): """check base_package_type deb for debian""" self.conf.set_override('base', 'debian') - self.conf.set_override('install_type', 'source') kolla = build.KollaWorker(self.conf) self.assertEqual('deb', kolla.base_package_type) diff --git a/releasenotes/notes/deprecate-install-type-argument-709bb37ded2b6aee.yaml b/releasenotes/notes/deprecate-install-type-argument-709bb37ded2b6aee.yaml new file mode 100644 index 0000000000..0dab528e45 --- /dev/null +++ b/releasenotes/notes/deprecate-install-type-argument-709bb37ded2b6aee.yaml @@ -0,0 +1,6 @@ +--- +deprecations: + - | + Use of ``install_type`` argument is now deprecated. We no longer support + other values than ``source`` therefore handling of argument was dropped. + Please update your scripts as it will be removed in A-cycle.