diff options
| author | Jason <jasonanderson@uchicago.edu> | 2019-01-04 13:22:37 -0600 |
|---|---|---|
| committer | Jason Anderson <jasonanderson@uchicago.edu> | 2019-06-05 10:32:15 -0500 |
| commit | 8c3cb6b4d29ac386297af5c1a6d67b1f031df3c8 (patch) | |
| tree | 29cdcc1e31a58271f8b5ecfc67168928fc97afc8 | |
| parent | f46b1c3b084c15757a93d61d9a4b95be9edb8672 (diff) | |
| download | kolla-8c3cb6b4d29ac386297af5c1a6d67b1f031df3c8.tar.gz kolla-8c3cb6b4d29ac386297af5c1a6d67b1f031df3c8.zip | |
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
| -rwxr-xr-x | kolla/image/build.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kolla/image/build.py b/kolla/image/build.py index 9ab3f68df..1416f3b80 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) |
