From c6bb04041867c242629c9becd83d47f2722b2432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 11 Apr 2018 09:18:59 +0200 Subject: [PATCH 1/6] Revert "Move ostree phase and pipelines for running phases" This reverts commit 660c04368ba1abed310f121d01f0fa029eea5f11. --- bin/pungi-koji | 54 +++++++++------- doc/_static/phases.svg | 162 +++++++++++++++++++++++++++++++++++------------ pungi/phases/__init__.py | 19 +++++- pungi/phases/weaver.py | 72 --------------------- tests/test_phase_base.py | 129 ++++++++----------------------------- 5 files changed, 198 insertions(+), 238 deletions(-) delete mode 100644 pungi/phases/weaver.py diff --git a/bin/pungi-koji b/bin/pungi-koji index b3b49de5..e797ce86 100755 --- a/bin/pungi-koji +++ b/bin/pungi-koji @@ -365,27 +365,41 @@ def run_compose(compose, create_latest_link=True, latest_link_status=None): # Store the password compose.conf["signing_key_password"] = signing_key_password + # INIT phase init_phase.start() init_phase.stop() + # PKGSET phase pkgset_phase.start() pkgset_phase.stop() - # WEAVER phase - launches other phases which can safely run in parallel - essentials_schema = ( - buildinstall_phase, - (gather_phase, extrafiles_phase, createrepo_phase), - (ostree_phase, ostree_installer_phase), - ) - essentials_phase = pungi.phases.WeaverPhase(compose, essentials_schema) - essentials_phase.start() - essentials_phase.stop() + # BUILDINSTALL phase - start, we can run gathering, extra files and + # createrepo while buildinstall is in progress. + buildinstall_phase.start() + + # If any of the following three phases fail, we must ensure that + # buildinstall is stopped. Otherwise the whole process will hang. + try: + gather_phase.start() + gather_phase.stop() + + extrafiles_phase.start() + extrafiles_phase.stop() + + createrepo_phase.start() + createrepo_phase.stop() + + finally: + buildinstall_phase.stop() if not buildinstall_phase.skip(): buildinstall_phase.copy_files() - productimg_phase.start() - productimg_phase.stop() + ostree_phase.start() + ostree_phase.stop() + + pungi.phases.run_all([productimg_phase, + ostree_installer_phase]) # write treeinfo before ISOs are created for variant in compose.get_variants(): @@ -401,17 +415,12 @@ def run_compose(compose, create_latest_link=True, latest_link_status=None): pungi.metadata.write_media_repo(compose, arch, variant, timestamp) # Start all phases for image artifacts - compose_images_schema = ( - createiso_phase, - extra_isos_phase, - liveimages_phase, - image_build_phase, - livemedia_phase, - osbs_phase, - ) - compose_images_phase = pungi.phases.WeaverPhase(compose, compose_images_schema) - compose_images_phase.start() - compose_images_phase.stop() + pungi.phases.run_all([createiso_phase, + extra_isos_phase, + liveimages_phase, + image_build_phase, + livemedia_phase, + osbs_phase]) image_checksum_phase.start() image_checksum_phase.stop() @@ -420,6 +429,7 @@ def run_compose(compose, create_latest_link=True, latest_link_status=None): compose.im.dump(compose.paths.compose.metadata("images.json")) osbs_phase.dump_metadata() + # TEST phase test_phase.start() test_phase.stop() diff --git a/doc/_static/phases.svg b/doc/_static/phases.svg index 7bbc5e1f..611eb06b 100644 --- a/doc/_static/phases.svg +++ b/doc/_static/phases.svg @@ -104,7 +104,87 @@ style="font-size:13.14787769px;line-height:1.25">Pkgset + + Buildinstall + + Gather + + ExtraFiles + + Createrepo + + ImageChecksum Test + transform="translate(2.318656,-80.47309)" + id="g3406"> Init + transform="translate(86.469501,49.471116)" + id="g3408"> Productimg + id="tspan3406" + style="font-size:13.14787769px;line-height:1.25">OSTree + id="g251" + transform="translate(0,42.1407)"> + id="g241"> + id="rect3350" + style="fill:#a40000;fill-rule:evenodd;stroke:none;stroke-width:1.10477591px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> Createrepo + y="847.65234" + x="403.15945" + id="tspan3382" + sodipodi:role="line">Productimg + transform="translate(-89.482556,-154.87768)" + id="g288"> + id="rect3428" + style="fill:#fcaf3e;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />