From 8c3cb6b4d29ac386297af5c1a6d67b1f031df3c8 Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 4 Jan 2019 13:22:37 -0600 Subject: [PATCH] Allow building images if parent was skipped This fixes a bug where if an image had a parent that was skipped, it would never get built. Normally when a parent finishes building it triggers the build of its children. This process is kicked off by Kolla finding the grandparents that have no parents above them. However, sometimes parents should be skipped, and in this case they would never get scheduled, and so their children would never build, producing a strange error without much information. Fix is to allow building an image if its parent is explicitly marked as having been skipped. The use-case for this is when you want to iterate on building an image without going through the cost of re-running the parent builds. In particular, if your builds are using Git sources, which break Docker caches, the cost of parent builds is high and the feedback loop during development has a much higher latency. Allowing some way for images to be rebuilt in a targeted manner is helpful when in the development phase. Change-Id: I6b6897d20626825bcd235b9a85859644effbd222 Closes-Bug: #1810979 --- kolla/image/build.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kolla/image/build.py b/kolla/image/build.py index 9ab3f68df1..1416f3b802 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -1247,7 +1247,9 @@ class KollaWorker(object): # were not matched in the first place... (not worth the # effort to run them, if they won't be used anyway). continue - if image.parent is None: + # Build all root nodes, where a root is defined as having no parent + # or having a parent that is explicitly being skipped. + if image.parent is None or image.parent.status == STATUS_SKIPPED: queue.put(BuildTask(self.conf, image, push_queue)) LOG.info('Added image %s to queue', image.name)