From 3f60e62ea86a3180b45290102d3519347cf8788a 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/3] Revert "Move ostree phase and pipelines for running phases" This reverts commit 660c04368ba1abed310f121d01f0fa029eea5f11. --- bin/pungi-koji | 52 +++++--- doc/_static/phases.svg | 339 ++++++++++++++++++++++------------------------- pungi/phases/__init__.py | 19 ++- pungi/phases/weaver.py | 72 ---------- tests/test_phase_base.py | 129 ++++-------------- 5 files changed, 230 insertions(+), 381 deletions(-) delete mode 100644 pungi/phases/weaver.py diff --git a/bin/pungi-koji b/bin/pungi-koji index 2a62a125..e5d31084 100755 --- a/bin/pungi-koji +++ b/bin/pungi-koji @@ -358,27 +358,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(): @@ -394,16 +408,11 @@ 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, - 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, + liveimages_phase, + image_build_phase, + livemedia_phase, + osbs_phase]) image_checksum_phase.start() image_checksum_phase.stop() @@ -412,6 +421,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 66184b15..072e5dd2 100644 --- a/doc/_static/phases.svg +++ b/doc/_static/phases.svg @@ -14,7 +14,7 @@ viewBox="0 0 839.33334 220.33335" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92+devel unknown" sodipodi:docname="phases.svg" inkscape:export-filename="/home/lsedlar/repos/pungi/doc/_static/phases.png" inkscape:export-xdpi="90" @@ -26,16 +26,16 @@ borderopacity="1.0" inkscape:pageopacity="1" inkscape:pageshadow="2" - inkscape:zoom="1.6532468" - inkscape:cx="337.4932" - inkscape:cy="70.825454" + inkscape:zoom="0.8266234" + inkscape:cx="226.63066" + inkscape:cy="201.60264" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="1920" - inkscape:window-height="1020" - inkscape:window-x="1920" - inkscape:window-y="31" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" inkscape:window-maximized="1" units="px" inkscape:document-rotation="0" @@ -67,7 +67,7 @@ image/svg+xml - + @@ -100,7 +100,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 + d="M 100.90864,859.8891 H 712.42335" + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.23489845px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" /> + 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" /> Buildinstall - - - - Gather - - - - - - ExtraFiles - - - - 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" /> OSTree - - - - - OSTreeInstaller - + x="492.642" + sodipodi:role="line" + id="tspan283">OSTreeInstaller + transform="translate(0,42.1407)"> @@ -367,8 +343,7 @@ y="971.54041" x="422.99252" style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve" - sodipodi:linespacing="0%">