From 0483f914c4e138cf629c8e3642efc6780cee5ac2 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 11 Oct 2024 11:18:48 -0700 Subject: [PATCH] Don't block main image build phase on ostree_install phase I did a time map of a Fedora compose today, and noticed that we spend about an hour waiting for the ostree_install phase to complete before we start up the compose_images_phase which does all the other image builds. This is unnecessary. Nothing else depends on ostree_install; it should be fine to start up the extra_phase (which contains compose_images_phase) while the ostree stuff is still running. This implements that by splitting the ostree phases out of the essentials_phase which contains the real precursors to the extra_phase. We start the essentials and ostree phases together, but only wait for the essentials phase to complete before kicking off extra_phase, so it can start while the ostree phase is still running. One tweak we have to make to accommodate this is to move image_checksum_phase out of extra_phase, to avoid it potentially running before all ostree installer images are built. The checksum phase is quite fast - it takes about five minutes - and any time benefit of running it in parallel with the osbs and repoclosure phases seems like it must be smaller than the time loss of waiting for ostree_install before kicking off extra. Merges: https://pagure.io/pungi/pull-request/1790 Signed-off-by: Adam Williamson (cherry picked from commit 18bda22fcb842c00a606e5f357aeb9f3d02aa626) --- pungi/scripts/pungi_koji.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pungi/scripts/pungi_koji.py b/pungi/scripts/pungi_koji.py index 299c6a3d..a0fd7561 100644 --- a/pungi/scripts/pungi_koji.py +++ b/pungi/scripts/pungi_koji.py @@ -482,11 +482,15 @@ def run_compose( buildinstall_phase, (gather_phase, createrepo_phase), extrafiles_phase, + ) + ostree_schema = ( (ostree_phase, ostree_installer_phase), ostree_container_phase, ) essentials_phase = pungi.phases.WeaverPhase(compose, essentials_schema) + ostree_phase = pungi.phases.WeaverPhase(compose, ostree_schema) essentials_phase.start() + ostree_phase.start() essentials_phase.stop() # write treeinfo before ISOs are created @@ -513,12 +517,9 @@ def run_compose( osbuild_phase, kiwibuild_phase, ) - post_image_phase = pungi.phases.WeaverPhase( - compose, (image_checksum_phase, image_container_phase) - ) compose_images_phase = pungi.phases.WeaverPhase(compose, compose_images_schema) extra_phase_schema = ( - (compose_images_phase, post_image_phase), + (compose_images_phase, image_container_phase), osbs_phase, repoclosure_phase, ) @@ -526,6 +527,12 @@ def run_compose( extra_phase.start() extra_phase.stop() + # wait for ostree phase here too - it can happily run in parallel + # with all of the other stuff + ostree_phase.stop() + # now we do checksums as all images are done + image_checksum_phase.start() + image_checksum_phase.stop() pungi.metadata.write_compose_info(compose) if not (