diff --git a/pkg/arvo/gen/hood/rein.hoon b/pkg/arvo/gen/hood/rein.hoon new file mode 100644 index 000000000..d3477ec5e --- /dev/null +++ b/pkg/arvo/gen/hood/rein.hoon @@ -0,0 +1,16 @@ +/- hood +:- %say +|= $: [now=@da eny=@uvJ bec=beak] + $: =desk + arg=(list [? dude:gall]) + == + liv=_& + == +:- %kiln-rein +:- desk +%+ roll arg +=| =rein:hood +|: [*[on=? =dude:gall] rein(liv liv)] +?: on + rein(add (~(put in add.rein) dude)) +rein(sub (~(put in sub.rein) dude)) diff --git a/pkg/arvo/gen/hood/uninstall.hoon b/pkg/arvo/gen/hood/uninstall.hoon index 0fe0ff245..f4a3db893 100644 --- a/pkg/arvo/gen/hood/uninstall.hoon +++ b/pkg/arvo/gen/hood/uninstall.hoon @@ -2,4 +2,4 @@ |= $: [now=@da eny=@uvJ bec=beak] [[=desk ~] ~] == -[%kiln-revive desk] +[%kiln-uninstall desk] diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 8b049d1c2..05f8f71e3 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -282,6 +282,7 @@ -- ++ pass |% + ++ pyre |=(=tang [%pass /kiln/vats %arvo %d %pyre tang]) ++ find (warp %find [%sing %y ud+1 /]) ++ sync-da (warp %sync [%sing %w da+now /]) ++ sync-ud (warp %sync [%sing %w ud+aeon.rak /]) @@ -326,8 +327,8 @@ |= lac=desk ^+ kiln ?: =(%base lac) - ~> %slog.0^leaf/"kiln: |uninstall: %base cannot be uninstalled" - !! + =/ mes "kiln: |uninstall: %base cannot be uninstalled" + (^emit (pyre:pass leaf/mes ~)) ?. (~(has by ark) lac) ~> %slog.0^leaf/"kiln: |uninstall: {} not installed, ignoring" kiln @@ -365,8 +366,8 @@ ^+ vats =/ got (~(get by ark) lac) ?: =(%base lac) - ~> %slog.0^leaf/"kiln: suspend: %base cannot be suspended" - !! + =/ mes "kiln: suspend: %base cannot be suspended" + (emit (pyre:pass leaf/mes ~)) ?. (~(has by ark) lac) ~> %slog.0^leaf/"kiln: suspend: {} not installed, ignoring" vats @@ -383,6 +384,19 @@ =. liv.rein.rak & =. vats (update-running-apps (get-apps-diff our loc now rein.rak)) (emit (diff:give %revive loc rak)) + :: +set-rein: adjust which agents are forced on or off + :: + ++ set-rein + |= [lac=desk new=rein] + ^+ vats + =. vats (abed lac) + =^ old rein.rak [rein.rak new] + ?+ [liv.old liv.new] !! + [%| %|] vats + [%| %&] (revive lac) + [%& %|] (suspend lac) + [%& %&] (update-running-apps (get-apps-diff our loc now rein.rak)) + == :: +bump: handle kernel kelvin upgrade :: :: Apply merges to revive faded agents on all paused desks. @@ -391,16 +405,32 @@ |= except=(set desk) ^+ kiln =/ kel=weft [%zuse zuse] + =. except (~(put in except) %base) =/ ded (~(dif in (get-blockers kel)) except) ?. =(~ ded) - ~> %slog.0^leaf/"kiln: desks blocked upgrade {}" - !! - =/ liv (skip ~(tap by ark) |=([d=desk *] (~(has in except) d))) + =/ mes "kiln: desks blocked upgrade to {<[- +]:kel>}: {}" + (^emit (pyre:pass leaf/mes ~)) + =/ liv (skip ~(tap in ~(key by ark)) ~(has in except)) ~> %slog.0^leaf/"kiln: bump {}" =< kiln |- ^+ vats ?~ liv vats - $(liv t.liv, vats (emit merge-main:pass(loc p.i.liv, rak q.i.liv))) + =. vats (abed i.liv) + :: skip to first commit at new kelvin + :: + =/ yon + =* nex next.rak + |- ^- (unit aeon) + ?~ nex ~ + ?: =(kel weft.i.nex) + `aeon.i.nex + $(nex t.nex) + ?~ yon + =/ mes "kiln: {here} killed upgrade to {<[- +]:kel>}" + (emit (pyre:pass leaf/mes ~)) + =. next.rak (crank-next u.yon) + =. vats (emit merge-main:pass) + $(liv t.liv) :: +stop-agents: internal helper to suspend agents on .loc :: :: Will not shut down %hood or %dojo. @@ -475,6 +505,7 @@ =/ =diff [%block loc rak new-weft blockers=(sy %base ~)] (emil sync-ud:pass (diff:give diff) ~) ~> %slog.0^leaf/"kiln: merging into {here}" + =. next.rak (crank-next (dec aeon.rak)) (emil ~[merge-main sync-ud]:pass) :: =/ blockers @@ -484,9 +515,11 @@ :: ?. =(~ blockers) ~> %slog.0^leaf/"kiln: OTA blocked on {}" + =. next.rak (snoc next.rak [(dec aeon.rak) new-weft]) =/ =diff [%block loc rak new-weft blockers] (emil sync-ud:pass (diff:give diff) ~) ~> %slog.0^leaf/"kiln: applying OTA to {here}, kelvin: {}" + =. next.rak (crank-next (dec aeon.rak)) (emil ~[merge-main sync-ud]:pass) :: ++ take-merge-main @@ -505,7 +538,8 @@ vats ~> %slog.0^leaf/"kiln: merge into {here} succeeded" =. vats (emit (diff:give %merge loc rak)) - =. vats (update-running-apps (get-apps-diff our loc now rein.rak)) + =? vats liv.rein.rak + (update-running-apps (get-apps-diff our loc now rein.rak)) ?. =(%base loc) vats =. kiln (bump (sy %base %kids ~)) @@ -550,6 +584,17 @@ |= daz=(list dude) ~> %slog.0^leaf/"kiln: stopping {}" (emil `(list card:agent:gall)`(zing (turn daz stop-dude:pass))) + :: +crank-next: pop stale aeons from .next.rak + :: + ++ crank-next + |= new=aeon + ^+ next.rak + =/ rog next.rak + |- ^+ next.rak + ?~ rog next.rak + ?: =(new aeon.i.rog) + t.rog + $(rog t.rog) -- :: +get-blockers: find desks that would block a kernel update :: @@ -559,6 +604,8 @@ %- ~(gas in *(set desk)) %+ murn ~(tap by ark) |= [=desk =arak] + ?: =(%base desk) + ~ ?. liv.rein.arak ~ ?: (lien next.arak |=([* k=weft] =(k kel))) @@ -600,6 +647,7 @@ %kiln-suspend =;(f (f !<(_+<.f vase)) poke-suspend) %kiln-permission =;(f (f !<(_+<.f vase)) poke-permission) %kiln-revive =;(f (f !<(_+<.f vase)) poke-revive) + %kiln-rein =;(f (f !<(_+<.f vase)) poke-rein) %kiln-rm =;(f (f !<(_+<.f vase)) poke-rm) %kiln-schedule =;(f (f !<(_+<.f vase)) poke-schedule) %kiln-sync =;(f (f !<(_+<.f vase)) poke-sync) @@ -756,6 +804,10 @@ =/ =rite [%r ~ ?:(pub %black %white) ~] [%pass /kiln/permission %arvo %c [%perm syd pax rite]] :: +++ poke-rein + |= [=desk =rein] + abet:abet:(set-rein:vats +<) +:: ++ poke-revive |= =desk abet:abet:(revive:vats desk) diff --git a/pkg/arvo/sur/hood.hoon b/pkg/arvo/sur/hood.hoon index 600c6a876..f1e4c16f4 100644 --- a/pkg/arvo/sur/hood.hoon +++ b/pkg/arvo/sur/hood.hoon @@ -55,7 +55,8 @@ :+ %rose ["" "{}" "::"] ^- tang =- ?: =(~ next.arak) - - (snoc - leaf/"pending: {}") + %+ snoc - + leaf/"pending: {<(turn next.arak |=([@ lal=@tas num=@] [lal num]))>}" ^- tang =/ meb (mergebase-hashes our desk now arak) =/ sat ?:(liv.rein.arak "running" "suspended") @@ -128,7 +129,7 @@ ^- (list dude) =/ duz (read-apes bill) =. duz (skip duz ~(has in sub.rein)) - =. duz (weld duz ~(tap in add.rein)) + =. duz (weld duz (skip ~(tap in add.rein) ~(has in (sy duz)))) duz :: ++ mergebase-hashes diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index a5c5168ba..6646e45f7 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -1057,6 +1057,7 @@ [%meld ~] :: unify memory [%noop ~] :: no operation [%pack ~] :: compact memory + [%pyre =tang] :: kill this event [%talk p=tank] :: [%text p=tape] :: [%view session=~] :: watch session blits diff --git a/pkg/arvo/sys/vane/dill.hoon b/pkg/arvo/sys/vane/dill.hoon index c5e35569f..07f91527a 100644 --- a/pkg/arvo/sys/vane/dill.hoon +++ b/pkg/arvo/sys/vane/dill.hoon @@ -112,6 +112,7 @@ %heft (pass /whey %$ whey/~) %meld (dump kyz) %pack (dump kyz) + %pyre (mean 'dill: %pyre' tang.kyz) %crop (dump trim+p.kyz) %verb (pass /verb %$ kyz) ::