From 9cc1bec92d222c49a9265f777c0a3e30ef6bf816 Mon Sep 17 00:00:00 2001 From: silnem2 <126880409+silnem2@users.noreply.github.com> Date: Thu, 13 Apr 2023 08:38:29 -0600 Subject: [PATCH 1/9] gen: remove +vat --- pkg/arvo/gen/vat.hoon | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 pkg/arvo/gen/vat.hoon diff --git a/pkg/arvo/gen/vat.hoon b/pkg/arvo/gen/vat.hoon deleted file mode 100644 index 0a154b7fa..000000000 --- a/pkg/arvo/gen/vat.hoon +++ /dev/null @@ -1,11 +0,0 @@ -/- *hood -:- %say -|= $: [now=@da eny=@uvJ bec=beak] - [syd=desk ~] - verb=? - == -=+ ~(abed report-vats p.bec now) -=+ %+ report-vat - verb - %- vat-info syd -[%tang -] From 36fb1303d38268c1c257b662ed0ed71e839c2055 Mon Sep 17 00:00:00 2001 From: silnem2 <126880409+silnem2@users.noreply.github.com> Date: Thu, 13 Apr 2023 08:39:28 -0600 Subject: [PATCH 2/9] gen: update |suspend to take a list of desks --- pkg/arvo/gen/hood/suspend.hoon | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/arvo/gen/hood/suspend.hoon b/pkg/arvo/gen/hood/suspend.hoon index cd5736f73..e4b1ede4b 100644 --- a/pkg/arvo/gen/hood/suspend.hoon +++ b/pkg/arvo/gen/hood/suspend.hoon @@ -1,5 +1,3 @@ :- %say -|= $: [now=@da eny=@uvJ bec=beak] - [[=desk ~] ~] - == -[%kiln-suspend desk] +|= [[now=@da eny=@uvJ bec=beak] desks=(list desk) ~] +[%kiln-suspend desks] From 6a0f66b836b1bdc9d8cee49dda847273bd238111 Mon Sep 17 00:00:00 2001 From: silnem2 <126880409+silnem2@users.noreply.github.com> Date: Thu, 13 Apr 2023 08:40:14 -0600 Subject: [PATCH 3/9] kiln: update +poke-suspend to use a list of desks --- pkg/arvo/lib/hood/kiln.hoon | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 741245504..3f073c4d9 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -784,8 +784,16 @@ `(foal where %sched !>((~(put by old) tym eve))) :: ++ poke-suspend - |= =desk - abet:(emit %pass /kiln/suspend %arvo %c %zest desk %dead) + |= desks=(list desk) + =< abet + %- emil + %+ turn + %+ skim desks + |= dek=desk + ?: (~(has in .^((set desk) %cd /(scot %p our)/base/(scot %da now))) dek) + & + ((slog leaf+"kiln: desk does not yet exist: {}" ~) |) + |=(=desk [%pass /kiln/suspend %arvo %c %zest desk %dead]) :: ++ poke-sync |= hos=kiln-sync From f2880ecc916ea0929c09f759c39e041d2f2d3aa0 Mon Sep 17 00:00:00 2001 From: silnem2 <126880409+silnem2@users.noreply.github.com> Date: Thu, 13 Apr 2023 09:15:03 -0600 Subject: [PATCH 4/9] gen: rewrite +vats and add optional list of desks --- pkg/arvo/gen/vats.hoon | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/pkg/arvo/gen/vats.hoon b/pkg/arvo/gen/vats.hoon index ebc152e1f..51db85bca 100644 --- a/pkg/arvo/gen/vats.hoon +++ b/pkg/arvo/gen/vats.hoon @@ -1,20 +1,21 @@ +:: Print diagnostic information about desks. +:: +:: Accepts an optional argument of a list of one or more desks, returns info +:: on all desks if no desks are specified. +:: +:: Keyword arguments include =filt and =verb. =filt takes one of %running, +:: %suspended, %exists, %exists-not, or %blocking; =verb takes either & or | +:: +:: If both a list of desks and a filter are provided, the output will include +:: the desks from the list that match the filter, with the exception of the +:: %blocking filter which always returns all desks that match. +:: /- *hood :- %say -|= $: [now=@da eny=@uvJ bec=beak] - $@(~ [?(%suspended %running %blocking %nonexistent) ~]) - $: verb=? - show-suspended=? - show-running=? - show-blocking=? - show-nonexistent=? - == - == -=+ :- verb - ?~ +<+< +<+>+ - ?- -.+<+< - %suspended [& | | |] - %running [| & | |] - %blocking [| | & |] - %nonexistent [| | | &] - == -tang+((report-vats p.bec now) -) +|= [[now=@da * bec=beak] deks=$@(~ (list desk)) filt=@tas verb=_|] +?: &(=(~ deks) =(%$ filt)) + :- %tang + %+ turn + ~(tap in .^((set desk) %cd /(scot %p p.bec)/base/(scot %da now))) + |=(syd=desk (report-vat (report-prep p.bec now) p.bec now syd verb)) +[%tang (report-vats p.bec now deks filt verb)] From f4dec815b9f746ea5a913ba6aa4e114c1354b025 Mon Sep 17 00:00:00 2001 From: silnem2 <126880409+silnem2@users.noreply.github.com> Date: Thu, 13 Apr 2023 15:33:54 -0600 Subject: [PATCH 5/9] hood: rewrite vats functions to work with updated +vats --- pkg/base-dev/sur/hood.hoon | 298 +++++++++++++++++++------------------ 1 file changed, 152 insertions(+), 146 deletions(-) diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index f0ec60624..156ebf471 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -16,155 +16,161 @@ :: +$ sync-state [nun=@ta kid=(unit desk) let=@ud] +$ sink (unit [her=@p sud=desk kid=(unit desk) let=@ud]) +:: +report-prep: get data required for reports +:: +++ report-prep + |= [our=@p now=@da] + =/ ego (scot %p our) + =/ wen (scot %da now) + :* .^(rock:tire %cx /[ego]//[wen]/tire) + .^(=cone %cx /[ego]//[wen]/domes) + .^((map desk [ship desk]) %gx /[ego]/hood/[wen]/kiln/sources/noun) + .^ (map [desk ship desk] sync-state) %gx + /[ego]/hood/[wen]/kiln/syncs/noun + == + == +:: +report-vats: report on all desk installations +:: ++ report-vats - =| $: =cone - sor=(map desk [ship desk]) - zyn=(map [desk ship desk] sync-state) - desks=(set desk) - =pikes - =rock:tire:clay - kel=weft - == - |_ [our=@p now=@da] - +* ego (scot %p our) - wen (scot %da now) - ++ $ - |= [? ? ? ? ?] - (report-vats:abed +<) - :: - ++ kel-path - |= =desk - ^- path - /[ego]/[desk]/[wen]/sys/kelvin - :: - ++ desk-exists - |= =desk - ?& !=(ud.cass 0):.^(=cass %cw /[ego]/[desk]/[wen]) - .^(? %cu (kel-path desk)) - == - :: - ++ abed - %= ..abed - cone .^(^cone %cx /[ego]//[wen]/domes) - sor .^((map desk [ship desk]) %gx /[ego]/hood/[wen]/kiln/sources/noun) - zyn .^ (map [desk ship desk] sync-state) %gx - /[ego]/hood/[wen]/kiln/syncs/noun - == - desks .^((set desk) %cd /[ego]/base/[wen]) - pikes .^(^pikes %gx /[ego]/hood/[wen]/kiln/pikes/kiln-pikes) - rock .^(rock:tire:clay %cx /[ego]//[wen]/tire) - kel (weft .^(* cx/(en-beam [our %base da+now] /sys/kelvin))) - == - ++ vat-info - |= desk=_`desk`%base - =/ pike (~(got by pikes) desk) - =/ zest -:(~(got by rock) desk) - =/ kel-path (kel-path desk) - =/ sink=sink - ?~ s=(~(get by sor) desk) - ~ - ?~ z=(~(get by zyn) desk u.s) - ~ - `[-.u.s +.u.s +.u.z] - =/ hash .^(@uv %cz /[ego]/[desk]/[wen]) - =/ dek (~(got by rock) desk) - =/ =dome (~(got by cone) our desk) - =+ .^(=waft %cx kel-path) - :* &1 &2 &3 &4 &5 &6 &7 &8 - desk=desk - ^= running =(%live zest) - ^= suspended =(%dead zest) - ^= meb :: =(list @uv) - ?~ sink [hash]~ - (mergebase-hashes our desk now her.u.sink sud.u.sink) - ^- [on=(list [@tas ?]) of=(list [@tas ?])] - (skid ~(tap by ren.dome) |=([* ?] +<+)) - ^= sat - ?- zest.dek - %live "running" - %dead "suspended" - %held "suspended until next update" + |= [our=@p now=@da desks=(list desk) filt=@tas verb=?] + =/ ego (scot %p our) + =/ wen (scot %da now) + =/ prep (report-prep our now) + ?~ filt + %+ turn (flop desks) + |=(syd=@tas (report-vat prep our now syd verb)) + =/ deks + ?~ desks ~(tap in -.prep) + %+ skip ~(tap in -.prep) + |=([syd=@tas *] =(~ (find ~[syd] desks))) + ?: =(filt %blocking) + =/ base-wic + %+ sort ~(tap by wic:(~(got by -.prep) %base)) + |=([[* a=@ud] [* b=@ud]] (gth a b)) + ?~ base-wic ~[leaf+"%base already up-to-date"] + =/ blockers=(list desk) + %+ turn + %+ skip ~(tap in -.prep) + |= [* [zest=@tas wic=(set weft)]] + ?. =(zest %live) & + (~(has in wic) i.base-wic) + |=([syd=desk *] syd) + ?~ blockers ~[leaf+"No desks blocking upgrade, run |bump to apply"] + :- [%rose [" %" "To unblock upgrade run |suspend %" ""] blockers] + %+ turn (flop blockers) + |=(syd=desk (report-vat prep our now syd verb)) + %+ turn + ?+ filt !! + :: + %exists + %+ skip deks + |=([syd=desk *] =(ud:.^(cass %cw /[ego]/[syd]/[wen]) 0)) + :: + %running + %+ skim deks + |=([* [zest=@tas *]] =(zest %live)) + :: + %suspended + %+ skip deks + |= [syd=@tas [zest=@tas *]] + ?| =(syd %kids) + =(zest %live) + =(ud:.^(cass %cw /[ego]/[syd]/[wen]) 0) + == + :: + %exists-not + %+ skim deks + |=([syd=desk *] =(ud:.^(cass %cw /[ego]/[syd]/[wen]) 0)) + == + |=([syd=desk *] (report-vat prep our now syd verb)) +:: +report-vat: report on a single desk installation +:: +++ report-vat + |= $: $: tyr=rock:tire =cone sor=(map desk [ship desk]) + zyn=(map [desk ship desk] sync-state) == - ^- kul=tape - %+ roll - %+ sort - ~(tap in (waft-to-wefts:clay waft)) - |= [a=weft b=weft] - ?: =(lal.a lal.b) - (lte num.a num.b) - (lte lal.a lal.b) - |= [=weft =tape] - (welp " {<[lal num]:weft>}" tape) - ^= blocking - ?& !=(%base desk) - !=(%live zest.pike) - !(~(has in wic.pike) kel) - == == - :: - ++ report-vats - |= $: verb=? - show-suspended=? - show-running=? - show-blocking=? - show-nonexistent=? - == - =/ [real=(list desk) fake=(list desk)] - (skid ~(tap in desks) desk-exists) - =; reals=tang - ?. show-nonexistent - reals - %+ weld reals - `tang`(turn fake |=(=desk leaf+"nonexistent desk: {}")) - %+ turn - %+ skim (turn real vat-info) - |= vat-info - ?| &(suspended show-suspended) - &(running show-running) - &(blocking show-blocking) + our=ship now=@da syd=desk verb=? == - |= =vat-info - ^- tank - :+ %rose [" " " " "::"] - :- leaf+"{}" - %- flop - %- report-vat - [verb vat-info] - :: - ++ report-vat - |= [verb=? vat-info] - ^- tang - ?: =(%kids desk) - ~[leaf+"%kids %cz hash: {}"] - %- flop - ?. verb - :~ leaf/"/sys/kelvin: {kul}" - leaf/"app status: {sat}" - leaf/"publishing ship: {?~(sink <~> <(get-publisher our desk now)>)}" - leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}" - == - :~ leaf/"/sys/kelvin: {kul}" - leaf/"base hash: {?.(=(1 (lent meb)) <(head meb)>)}" - leaf/"%cz hash: {}" - :: - leaf/"app status: {sat}" - leaf/"force on: {?:(=(~ on) "~" )}" - leaf/"force off: {?:(=(~ of) "~" )}" - :: - leaf/"publishing ship: {?~(sink <~> <(get-publisher our desk now)>)}" - leaf/"updates: {?~(sink "local" "remote")}" - leaf/"source ship: {?~(sink <~> )}" - leaf/"source desk: {?~(sink <~> )}" - leaf/"source aeon: {?~(sink <~> )}" - leaf/"kids desk: {?~(sink <~> ?~(kid.u.sink <~> ))}" - leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}" + ^- tank + =/ ego (scot %p our) + =/ wen (scot %da now) + =+ .^(=cass %cw /[ego]/[syd]/[wen]) + ?: =(ud.cass 0) + leaf+"desk does not yet exist: {}" + ?: =(%kids syd) + =+ .^(hash=@uv %cz /[ego]/[syd]/[wen]) + leaf+"%kids %cz hash: {}" + =/ kel-path + /[ego]/[syd]/[wen]/sys/kelvin + ?. .^(? %cu kel-path) + leaf+"bad desk: {}" + =+ .^(=waft %cx kel-path) + :+ %rose ["" "{}" "::"] + ^- tang + =/ hash .^(@uv %cz /[ego]/[syd]/[wen]) + =/ =sink + ?~ s=(~(get by sor) syd) + ~ + ?~ z=(~(get by zyn) syd u.s) + ~ + `[-.u.s +.u.s +.u.z] + =/ meb=(list @uv) + ?~ sink [hash]~ + (mergebase-hashes our syd now her.u.sink sud.u.sink) + =/ dek (~(got by tyr) syd) + =/ =dome (~(got by cone) our syd) + =/ [on=(list [@tas ?]) of=(list [@tas ?])] + (skid ~(tap by ren.dome) |=([* ?] +<+)) + =/ sat + ?- zest.dek + %live "running" + %dead "suspended" + %held "suspended until next update" == - ++ report-kids - ^- tank - ?. (~(has in .^((set desk) %cd /[ego]//[wen])) %kids) - leaf/"no %kids desk" - =+ .^(hash=@uv %cz /[ego]/kids/[wen]) - leaf/"%kids %cz hash: {}" - -- + =/ kul=tape + %+ roll + %+ sort + ~(tap in (waft-to-wefts:clay waft)) + |= [a=weft b=weft] + ?: =(lal.a lal.b) + (lte num.a num.b) + (lte lal.a lal.b) + |= [=weft =tape] + (welp " {<[lal num]:weft>}" tape) + ?. verb + :~ leaf/"/sys/kelvin: {kul}" + leaf/"%cz hash ends in: {(slag (sub (lent ) 5) )}" + leaf/"app status: {sat}" + leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}" + == + :~ leaf/"/sys/kelvin: {kul}" + leaf/"base hash: {?.(=(1 (lent meb)) <(head meb)>)}" + leaf/"%cz hash: {}" + :: + leaf/"app status: {sat}" + leaf/"force on: {?:(=(~ on) "~" )}" + leaf/"force off: {?:(=(~ of) "~" )}" + :: + leaf/"publishing ship: {?~(sink <~> <(get-publisher our syd now)>)}" + leaf/"updates: {?~(sink "local" "remote")}" + leaf/"source ship: {?~(sink <~> )}" + leaf/"source desk: {?~(sink <~> )}" + leaf/"source aeon: {?~(sink <~> )}" + leaf/"kids desk: {?~(sink <~> ?~(kid.u.sink <~> ))}" + leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}" + == +:: +report-kids: non-vat cz hash report for kids desk +:: +++ report-kids + |= [our=ship now=@da] + ^- tank + =/ syd %kids + =/ ego (scot %p our) + =/ wen (scot %da now) + ?. (~(has in .^((set desk) %cd /[ego]//[wen])) syd) + leaf/"no %kids desk" + =+ .^(hash=@uv %cz /[ego]/[syd]/[wen]) + leaf/"%kids %cz hash: {}" :: +read-bill-foreign: read /desk/bill from a foreign desk :: ++ read-bill-foreign @@ -175,7 +181,7 @@ =/ syd (scot %tas desk) =/ yon (scot %ud aeon) :: - =/ dom .^(domo cv/~[her syd yon]) + =/ dom .^(dome cv/~[her syd yon]) =/ tak ~| aeons=~(key by hit.dom) (scot %uv (~(got by hit.dom) aeon)) =/ yak .^(yaki cs/~[her syd yon %yaki tak]) From 9b8ea6bc8c86bbbf4807fe7db8f79e4dc7c2a101 Mon Sep 17 00:00:00 2001 From: silnem2 <126880409+silnem2@users.noreply.github.com> Date: Thu, 20 Apr 2023 03:37:48 -0600 Subject: [PATCH 6/9] gen: rewrite +vat and add deprecation notice --- pkg/arvo/gen/vat.hoon | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 pkg/arvo/gen/vat.hoon diff --git a/pkg/arvo/gen/vat.hoon b/pkg/arvo/gen/vat.hoon new file mode 100644 index 000000000..0265e97df --- /dev/null +++ b/pkg/arvo/gen/vat.hoon @@ -0,0 +1,7 @@ +/- *hood +:- %say +|= [[now=@da eny=@uvJ bec=beak] [syd=desk ~] verb=_&] +:~ %tang + leaf+"Notice: +vat is deprecated as +vats now takes lists of one or more desks" + (report-vat (report-prep p.bec now) p.bec now syd verb) +== From dbc40b3959a084f2397e6805836117101af38858 Mon Sep 17 00:00:00 2001 From: silnem2 <126880409+silnem2@users.noreply.github.com> Date: Fri, 21 Apr 2023 09:02:39 -0600 Subject: [PATCH 7/9] gen: rewrite |suspend to use %kiln-suspend-many mark --- pkg/arvo/gen/hood/suspend.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/gen/hood/suspend.hoon b/pkg/arvo/gen/hood/suspend.hoon index e4b1ede4b..4c875b9db 100644 --- a/pkg/arvo/gen/hood/suspend.hoon +++ b/pkg/arvo/gen/hood/suspend.hoon @@ -1,3 +1,3 @@ :- %say |= [[now=@da eny=@uvJ bec=beak] desks=(list desk) ~] -[%kiln-suspend desks] +[%kiln-suspend-many desks] From d363f01080100f485885c15009b13f3a0590f228 Mon Sep 17 00:00:00 2001 From: silnem2 <126880409+silnem2@users.noreply.github.com> Date: Fri, 21 Apr 2023 15:12:38 -0600 Subject: [PATCH 8/9] kiln: add +poke-suspend-many and rewrite +poke-suspend --- pkg/arvo/lib/hood/kiln.hoon | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 3f073c4d9..6418acb41 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -551,6 +551,7 @@ %kiln-rm =;(f (f !<(_+<.f vase)) poke-rm) %kiln-schedule =;(f (f !<(_+<.f vase)) poke-schedule) %kiln-suspend =;(f (f !<(_+<.f vase)) poke-suspend) + %kiln-suspend-many =;(f (f !<(_+<.f vase)) poke-suspend-many) %kiln-sync =;(f (f !<(_+<.f vase)) poke-sync) %kiln-syncs =;(f (f !<(_+<.f vase)) poke-syncs) %kiln-uninstall =;(f (f !<(_+<.f vase)) poke-uninstall) @@ -784,6 +785,10 @@ `(foal where %sched !>((~(put by old) tym eve))) :: ++ poke-suspend + |= =desk + (poke-suspend-many ~[desk]) +:: +++ poke-suspend-many |= desks=(list desk) =< abet %- emil @@ -792,7 +797,7 @@ |= dek=desk ?: (~(has in .^((set desk) %cd /(scot %p our)/base/(scot %da now))) dek) & - ((slog leaf+"kiln: desk does not yet exist: {}" ~) |) + ~> %slog.(fmt "desk does not yet exist: {}") | |=(=desk [%pass /kiln/suspend %arvo %c %zest desk %dead]) :: ++ poke-sync From e52ca71c6bbe24c294d886f9cc25be96585c8e27 Mon Sep 17 00:00:00 2001 From: silnem2 <126880409+silnem2@users.noreply.github.com> Date: Fri, 21 Apr 2023 15:13:46 -0600 Subject: [PATCH 9/9] hood: add base hash to non-verb +vats output --- pkg/base-dev/sur/hood.hoon | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index 156ebf471..e1aebce37 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -138,10 +138,12 @@ |= [=weft =tape] (welp " {<[lal num]:weft>}" tape) ?. verb - :~ leaf/"/sys/kelvin: {kul}" - leaf/"%cz hash ends in: {(slag (sub (lent ) 5) )}" - leaf/"app status: {sat}" - leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}" + =/ base-hash ?.(=(1 (lent meb)) <(head meb)>) + :~ leaf/"/sys/kelvin: {kul}" + leaf/"base hash ends in: {(slag (sub (lent base-hash) 5) base-hash)}" + leaf/"%cz hash ends in: {(slag (sub (lent ) 5) )}" + leaf/"app status: {sat}" + leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}" == :~ leaf/"/sys/kelvin: {kul}" leaf/"base hash: {?.(=(1 (lent meb)) <(head meb)>)}" @@ -181,7 +183,7 @@ =/ syd (scot %tas desk) =/ yon (scot %ud aeon) :: - =/ dom .^(dome cv/~[her syd yon]) + =/ dom .^(domo cv/~[her syd yon]) =/ tak ~| aeons=~(key by hit.dom) (scot %uv (~(got by hit.dom) aeon)) =/ yak .^(yaki cs/~[her syd yon %yaki tak])