From be54999eb14b7d3fb83fc4515b0e61645b217105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Thu, 13 Jun 2019 13:38:34 +0200 Subject: [PATCH] Make SKIPPED_IMAGES more flexible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With introduction of new architectures, it seems reasonable to allow skipping of images based on their architecture. Additionally, the existing framework had unneccessary duplication. This commit makes the feature more flexible and cleaner. Existing skips have been programmatically rewritten. Change-Id: I34c002a0ee605ca121d9d923b256e4fe1ea3d9aa Signed-off-by: Radosław Piliszek --- kolla/image/build.py | 123 ++++++------------ ...xible-image-skipping-8e1320ed78976026.yaml | 5 + 2 files changed, 48 insertions(+), 80 deletions(-) create mode 100644 releasenotes/notes/more-flexible-image-skipping-8e1320ed78976026.yaml diff --git a/kolla/image/build.py b/kolla/image/build.py index d4dbf447c4..4e37677d32 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -76,9 +76,15 @@ STATUS_SKIPPED = 'skipped' STATUS_ERRORS = (STATUS_CONNECTION_ERROR, STATUS_PUSH_ERROR, STATUS_ERROR, STATUS_PARENT_ERROR) - +# The dictionary of skipped 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. SKIPPED_IMAGES = { - 'centos+binary': [ + 'source': { + "tripleoclient", + }, + 'binary': { "almanach-base", "bifrost-base", "blazar-base", @@ -90,115 +96,65 @@ SKIPPED_IMAGES = { "monasca-base", "monasca-thresh", "nova-mksproxy", - "ovsdpdk", "qinling-base", "searchlight-base", "solum-base", "vmtp", "zun-base", - ], - 'centos+source': [ + }, + + 'centos': { "ovsdpdk", - "tripleoclient", - ], - 'ubuntu+binary': [ - "almanach-base", - "bifrost-base", - "blazar-base", + }, + 'oraclelinux': { + "ovsdpdk", + }, + 'debian': { + "sensu-base", + }, + 'ubuntu': { + "qdrouterd", # There is no qdrouterd package for ubuntu bionic + }, + + 'debian+binary': { "cloudkitty-base", "congress-base", - "cyborg-base", - "dragonflow-base", "ec2-api", - "freezer-base", "heat-all", "ironic-neutron-agent", - "karbor-base", - "kuryr-base", "mistral-event-engine", - "monasca-base", - "monasca-thresh", - "nova-mksproxy", "novajoin-base", "octavia-base", - # There is no qdrouterd package for ubuntu bionic - "qdrouterd", - "qinling-base", - "searchlight-base", - "solum-base", "tacker-base", "tripleoclient", "vitrage-base", - "vmtp", "zaqar", - "zun-base", - ], - 'ubuntu+source': [ + }, + 'debian+source': { "cyborg-base", - # There is no qdrouterd package for ubuntu bionic - "qdrouterd", - "tripleoclient", - ], - 'debian+binary': [ - "almanach-base", + }, + + 'oraclelinux+source': { "bifrost-base", - "blazar-base", + }, + + 'ubuntu+binary': { "cloudkitty-base", "congress-base", - "cyborg-base", - "dragonflow-base", "ec2-api", - "freezer-base", "heat-all", "ironic-neutron-agent", - "karbor-base", - "kuryr-base", "mistral-event-engine", - "monasca-base", - "monasca-thresh", - "nova-mksproxy", "novajoin-base", "octavia-base", - "qinling-base", - "searchlight-base", - "sensu-base", - "solum-base", "tacker-base", "tripleoclient", "vitrage-base", - "vmtp", "zaqar", - "zun-base" - ], - 'debian+source': [ + }, + 'ubuntu+source': { "cyborg-base", - "sensu-base", - "tripleoclient", - ], - 'oraclelinux+binary': [ - "almanach-base", - "bifrost-base", - "blazar-base", - "cyborg-base", - "dragonflow-base", - "freezer-base", - "karbor-base", - "kuryr-base", - "monasca-base", - "monasca-thresh", - "nova-mksproxy", - "ovsdpdk", - "qinling-base", - "searchlight-base", - "solum-base", - "vmtp", - "zun-base" - ], - 'oraclelinux+source': [ - "bifrost-base", - "ovsdpdk", - "tripleoclient", - ] + }, } @@ -1035,8 +991,15 @@ class KollaWorker(object): for image in self.images: image.status = STATUS_MATCHED - skipped_images = SKIPPED_IMAGES.get('%s+%s' % (self.base, - self.install_type)) + # Unmatch (skip) unsupported images + tag_element = r'(%s|%s|%s)' % (self.base, + self.install_type, + self.base_arch) + tag_re = re.compile(r'^%s(\+%s)*$' % (tag_element, tag_element)) + skipped_images = set() + for set_tag in SKIPPED_IMAGES: + if tag_re.match(set_tag): + skipped_images.update(SKIPPED_IMAGES[set_tag]) if skipped_images: for image in self.images: if image.name in skipped_images: diff --git a/releasenotes/notes/more-flexible-image-skipping-8e1320ed78976026.yaml b/releasenotes/notes/more-flexible-image-skipping-8e1320ed78976026.yaml new file mode 100644 index 0000000000..1bf0a09c97 --- /dev/null +++ b/releasenotes/notes/more-flexible-image-skipping-8e1320ed78976026.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Kolla skipped images feature is now more flexible, allowing filtering + based on used image distribution, installation type and processor architecture.