From 87ca57c3642b5780dbb80fde902221176baffabc Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Fri, 18 Jun 2021 16:13:55 -1000 Subject: [PATCH 001/595] gall: allow apps to run from any desk Start with |start %desk %app-name Everywhere in the kernel that we deal with marks, we infer the app it's connected to and use the marks from that desk. Also some light renaming in gall, especially path->wire and current-agent->yoke. Subsequent tasks: - Dojo needs a syntax to run generators and threads from other desks - The home desk should be split into at least a minimal base desk and big "userspace" desk. Dill's initialization logic should be updated to handle - |show-package, |install, and |uninstall should to be written - Clay should have smarter handling of system versions instead of just ignoring what's on each desk. It's not clear that this will work correctly when sys updates right now. --- pkg/arvo/app/hood.hoon | 15 +- pkg/arvo/lib/hood/drum.hoon | 40 ++-- pkg/arvo/sys/lull.hoon | 8 +- pkg/arvo/sys/vane/dill.hoon | 3 +- pkg/arvo/sys/vane/eyre.hoon | 57 +++-- pkg/arvo/sys/vane/gall.hoon | 376 ++++++++++++++++-------------- pkg/arvo/sys/vane/jael.hoon | 3 +- pkg/arvo/tests/sys/vane/gall.hoon | 2 +- 8 files changed, 283 insertions(+), 221 deletions(-) diff --git a/pkg/arvo/app/hood.hoon b/pkg/arvo/app/hood.hoon index b6567e1f5..b7dde9798 100644 --- a/pkg/arvo/app/hood.hoon +++ b/pkg/arvo/app/hood.hoon @@ -2,7 +2,7 @@ /+ drum=hood-drum, helm=hood-helm, kiln=hood-kiln |% +$ state - $: %13 + $: %14 drum=state:drum helm=state:helm kiln=state:kiln @@ -10,12 +10,13 @@ +$ any-state $% state [ver=?(%1 %2 %3 %4 %5 %6) lac=(map @tas fin-any-state)] - [%7 drum=state:drum helm=state:helm kiln=state:kiln] - [%8 drum=state:drum helm=state:helm kiln=state:kiln] - [%9 drum=state:drum helm=state:helm kiln=state:kiln] - [%10 drum=state:drum helm=state:helm kiln=state:kiln] - [%11 drum=state:drum helm=state:helm kiln=state:kiln] - [%12 drum=state:drum helm=state:helm kiln=state:kiln] + [%7 drum=state-2:drum helm=state:helm kiln=state:kiln] + [%8 drum=state-2:drum helm=state:helm kiln=state:kiln] + [%9 drum=state-2:drum helm=state:helm kiln=state:kiln] + [%10 drum=state-2:drum helm=state:helm kiln=state:kiln] + [%11 drum=state-2:drum helm=state:helm kiln=state:kiln] + [%12 drum=state-2:drum helm=state:helm kiln=state:kiln] + [%13 drum=state-2:drum helm=state:helm kiln=state:kiln] == +$ any-state-tuple $: drum=any-state:drum diff --git a/pkg/arvo/lib/hood/drum.hoon b/pkg/arvo/lib/hood/drum.hoon index 3fef1adca..c23ad9a22 100644 --- a/pkg/arvo/lib/hood/drum.hoon +++ b/pkg/arvo/lib/hood/drum.hoon @@ -1,9 +1,17 @@ /- *sole /+ sole |% -+$ any-state $%(state) -+$ state [%2 pith-2] ++$ any-state $%(state state-2) ++$ state [%3 pith-3] ++$ state-2 [%2 pith-2] :: +++ pith-3 :: + $: eel=(set gill:gall) :: connect to + ray=(map dude:gall desk) :: + fur=(map dude:gall (unit server)) :: servers + bin=(map bone source) :: terminals + == :: +:: :: ++ pith-2 :: $: eel=(set gill:gall) :: connect to ray=(set well:gall) :: @@ -56,11 +64,11 @@ |% ++ deft-apes :: default servers |= [our=ship lit=?] - %- ~(gas in *(set well:gall)) + %- ~(gas by *(map dap=term desk)) ^- (list well:gall) :: boot all default apps off the home desk :: - =- (turn - |=(a=term home+a)) + =- (turn - |=(a=term [a %home])) ^- (list term) %+ welp :~ %dojo @@ -219,7 +227,7 @@ ++ on-load |= [hood-version=@ud old=any-state] =< se-abet =< se-view - =. sat old + =. sat old(- %3) =. dev (~(gut by bin) ost *source) =? ..on-load (lte hood-version %4) ~> %slog.0^leaf+"drum: starting os1 agents" @@ -260,7 +268,8 @@ => (se-born | %home %settings-store) (se-born | %home %group-view) =? ..on-load (lte hood-version %13) - (se-born | %home %dm-hook) + => (se-born | %home %dm-hook) + .(ray (~(gas by ray) (turn ~(tap in ray) |=(=well:gall [q.well p.well])))) ..on-load :: ++ reap-phat :: ack connect @@ -340,13 +349,12 @@ ++ se-adit :: update servers ^+ this |^ - =/ servers=(list well:gall) - (sort ~(tap in ray) sort-by-priorities) + =/ servers=(list [dap=term =desk]) + (sort ~(tap by ray) sort-by-priorities) |- ?~ servers this - =/ wel=well:gall - i.servers + =/ wel=well:gall [+ -]:i.servers =/ =wire [%drum p.wel q.wel ~] =/ hig=(unit (unit server)) (~(get by fur) q.wel) @@ -358,7 +366,7 @@ (se-text "activated app {(trip p.wel)}/{(trip q.wel)}") =. this %- se-emit - [%pass wire %arvo %g %conf q.wel] + [%pass wire %arvo %g %conf wel] $(servers t.servers) :: ++ priorities @@ -397,7 +405,7 @@ |- ^+ this ?~ ruf this - ?: (~(has in ray) [%home i.ruf]) + ?: (~(has by ray) i.ruf) $(ruf t.ruf) =/ wire [%drum %fade i.ruf ~] =. this (se-emit %pass wire %arvo %g %fade i.ruf %slay) @@ -490,21 +498,21 @@ ++ se-born :: new server |= [print-on-repeat=? wel=well:gall] ^+ +> - ?: (~(has in ray) wel) + ?: (~(has by ray) q.wel) ?. print-on-repeat +> (se-text "[already running {}/{}]") %= +> - ray (~(put in ray) wel) + ray (~(put by ray) q.wel p.wel) eel (~(put in eel) [our.hid q.wel]) == :: ++ se-fade :: delete server |= wel=well:gall ^+ +> - ?. (~(has in ray) wel) + ?. (~(has by ray) q.wel) (se-text "[fade not running {}/{}]") %= +> - ray (~(del in ray) wel) + ray (~(del by ray) q.wel) == :: ++ se-drop :: disconnect diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index cdc6ef10e..3d7627a96 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -1635,11 +1635,11 @@ $% [%boon payload=*] :: ames response [%done error=(unit error:ames)] :: ames message (n)ack [%onto p=(each suss tang)] :: about agent - [%unto p=sign:agent] :: + [%unto p=unto] :: == :: +$ task :: incoming request $~ [%vega ~] :: - $% [%conf dap=term] :: start agent + $% [%conf =desk dap=term] :: start agent [%deal p=sock q=term r=deal] :: full transmission [%goad force=? agent=(unit dude)] :: rebuild agent(s) [%sear =ship] :: clear pending queues @@ -1683,6 +1683,10 @@ $% [%raw-poke =mark =noun] task:agent == + +$ unto + $% [%raw-fact =mark =noun] + sign:agent + == :: :: +agent: app core :: diff --git a/pkg/arvo/sys/vane/dill.hoon b/pkg/arvo/sys/vane/dill.hoon index ebc0b9038..470bdf6c3 100644 --- a/pkg/arvo/sys/vane/dill.hoon +++ b/pkg/arvo/sys/vane/dill.hoon @@ -224,7 +224,7 @@ =/ myt (flop (fall tem ~)) =/ can (clan:title our) =. tem ~ - =. +> (pass / %g %conf ram) + =. +> (pass / %g %conf ram %home) =? +> ?=(?(%earl %duke %king) can) (ota sein %kids) :: make kids desk publicly readable, so syncs work. @@ -276,6 +276,7 @@ [%gall %unto *] :: ~& [%take-gall-unto +>.sih] ?- -.+>.sih + %raw-fact !! %poke-ack ?~(p.p.+>.sih +>.$ (crud %coup u.p.p.+>.sih)) %kick peer %watch-ack ?~ p.p.+>.sih diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index 08071af37..810e329ba 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -736,7 +736,7 @@ :: attempt to find conversion gate to mime :: =/ tub=(unit tube:clay) - (find-tube mark %mime) + (find-tube i.site.req mark %mime) ?~ tub (error-response 500 "no tube from {(trip mark)} to mime") :: attempt conversion, then send results :: @@ -749,11 +749,15 @@ == :: ++ find-tube - |= [from=mark to=mark] + |= [dap=term from=mark to=mark] ^- (unit tube:clay) ?: =(from to) `(bake same vase) + =/ des=(unit (unit cage)) + (do-scry %gd dap ~) + ?. ?=([~ ~ *] des) ~ + =+ !<(=desk q.u.u.des) =/ tub=(unit (unit cage)) - (do-scry %cc %home /[from]/[to]) + (do-scry %cc desk /[from]/[to]) ?. ?=([~ ~ %tube *] tub) ~ `!<(tube:clay q.u.u.tub) :: @@ -1240,8 +1244,10 @@ ::NOTE these will only fail if the mark and/or json types changed, :: since conversion failure also gets caught during first receive. :: we can't do anything about this, so consider it unsupported. - ?~ sign=(channel-event-to-sign channel-event) $ - ?~ jive=(sign-to-json request-id u.sign) $ + =/ sign + (channel-event-to-sign u.maybe-channel request-id channel-event) + ?~ sign $ + ?~ jive=(sign-to-json u.maybe-channel request-id u.sign) $ $(events [(event-json-to-wall id +.u.jive) events]) :: send the start event to the client :: @@ -1509,7 +1515,7 @@ :: connected, we *will* send it immediately. :: =/ jive=(unit (quip move json)) - (sign-to-json request-id sign) + (sign-to-json u.channel request-id sign) =/ json=(unit json) ?~(jive ~ `+.u.jive) =? moves ?=(^ jive) @@ -1591,7 +1597,7 @@ ^= data %- wall-to-octs %+ event-json-to-wall next-id - +:(need (sign-to-json request-id %kick ~)) + +:(need (sign-to-json u.channel request-id %kick ~)) :: complete=%.n == @@ -1610,18 +1616,33 @@ ^- channel-event ?. ?=(%fact -.sign) sign [%fact [p q.q]:cage.sign] + :: +app-to-desk + :: + ++ app-to-desk + |= [=channel request-id=@ud] + ^- (unit desk) + =/ sub (~(get by subscriptions.channel) request-id) + ?~ sub + ((slog leaf+"eyre: no subscription for request-id {}" ~) ~) + =/ des=(unit (unit cage)) + (rof ~ %gd [our app.u.sub da+now] ~) + ?. ?=([~ ~ *] des) + ((slog leaf+"eyre: no desk for app {(trip app.u.sub)}" ~) ~) + `!<(=desk q.u.u.des) :: +channel-event-to-sign: attempt to recover a sign from a channel-event :: ++ channel-event-to-sign ~% %eyre-channel-event-to-sign ..part ~ - |= event=channel-event + |= [=channel request-id=@ud event=channel-event] ^- (unit sign:agent:gall) ?. ?=(%fact -.event) `event :: rebuild vase for fact data :: + =/ des=(unit desk) (app-to-desk channel request-id) + ?~ des ~ =* have=mark mark.event =/ val=(unit (unit cage)) - (rof ~ %cb [our %home da+now] /[have]) + (rof ~ %cb [our u.des da+now] /[have]) ?. ?=([~ ~ *] val) ((slog leaf+"eyre: no mark {(trip have)}" ~) ~) =+ !<(=dais:clay q.u.u.val) @@ -1633,32 +1654,35 @@ :: ++ sign-to-json ~% %sign-to-json ..part ~ - |= [request-id=@ud =sign:agent:gall] + |= [=channel request-id=@ud =sign:agent:gall] ^- (unit (quip move json)) :: for facts, we try to convert the result to json :: - =/ [from=(unit mark) jsyn=(unit sign:agent:gall)] + =/ [from=(unit [=desk =mark]) jsyn=(unit sign:agent:gall)] ?. ?=(%fact -.sign) [~ `sign] ?: ?=(%json p.cage.sign) [~ `sign] :: find and use tube from fact mark to json :: + =/ des=(unit desk) (app-to-desk channel request-id) + ?~ des [~ ~] + :: =* have=mark p.cage.sign =* desc=tape "from {(trip have)} to json" =/ convert=(unit vase) =/ cag=(unit (unit cage)) - (rof ~ %cf [our %home da+now] /[have]/json) + (rof ~ %cf [our u.des da+now] /[have]/json) ?. ?=([~ ~ *] cag) ~ `q.u.u.cag ?~ convert ((slog leaf+"eyre: no convert {desc}" ~) [~ ~]) ~| "conversion failed {desc}" - [`have `[%fact %json (slym u.convert q.q.cage.sign)]] + [`[u.des have] `[%fact %json (slym u.convert q.q.cage.sign)]] ?~ jsyn ~ %- some :- ?~ from ~ :_ ~ - :^ duct %pass /conversion-cache/[u.from] - [%c %warp our %home `[%sing %f da+now /[u.from]/json]] + :^ duct %pass /conversion-cache/[mark.u.from] + [%c %warp our desk.u.from `[%sing %f da+now /[mark.u.from]/json]] =* sign u.jsyn =, enjs:format %- pairs @@ -2439,8 +2463,9 @@ :: ?(%poke %subscription) ?> ?=([%gall %unto *] sign) - ~| wire + ~| eyre-sub=wire ?> ?=([@ @ @t @ *] wire) + ?< ?=(%raw-fact -.p.sign) =* channel-id i.t.t.wire =* request-id i.t.t.t.wire =* extra-wire t.t.t.t.wire diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index 4249bcd8e..f881b0b69 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -64,7 +64,7 @@ == :: $blocked-move: enqueued move to an agent :: -+$ blocked-move [=duct =routes move=(each deal sign:agent)] ++$ blocked-move [=duct =routes move=(each deal unto)] :: $stats: statistics :: :: change: how many moves this agent has processed @@ -272,6 +272,13 @@ ++ mo-abet [(flop moves) gall-payload] ++ mo-pass |=(p=[wire note-arvo] mo-core(moves [[hen pass+p] moves])) ++ mo-give |=(g=gift mo-core(moves [[hen give+g] moves])) + ++ mo-past + |= =(list [wire note-arvo]) + ?~ list + mo-core + =. mo-core (mo-pass i.list) + $(list t.list) + :: :: +mo-boot: ask %ford to build us a core for the specified agent. :: ++ mo-boot @@ -365,30 +372,39 @@ |= date=@da ^+ mo-core =. mo-core (mo-abed system-duct.state) - =/ =wire /sys/lyv - =. mo-core (mo-pass /sys/lyv %c %warp our %home ~) - =/ =mool:clay - :- da+date - %- ~(gas in *(set [care:clay path])) - :* [%z /sys/hoon/hoon] + :: + =/ sources=(jug desk [care:clay path]) + %+ ~(put by *(jug desk [care:clay path])) %home + %- sy + :~ [%z /sys/hoon/hoon] [%z /sys/arvo/hoon] [%z /sys/lull/hoon] [%z /sys/zuse/hoon] [%z /sys/vane/gall/hoon] - %+ murn ~(tap by yokes.state) - |= [dap=term =yoke] - ^- (unit [care:clay path]) - ?: ?=(%| -.agent.yoke) - ~ - `[%a /app/[dap]/hoon] == - (mo-pass wire %c %warp our %home ~ %mult mool) + :: + =. sources + =/ apps=(list [dap=term =yoke]) ~(tap by yokes.state) + |- ^+ sources + ?~ apps + sources + =? sources ?=(%& -.agent.yoke.i.apps) + (~(put ju sources) q.beak.yoke.i.apps %a /app/[dap.i.apps]/hoon) + $(apps t.apps) + :: + %- mo-past + %- zing + %+ turn ~(tap by sources) + |= [=desk paths=(set [care:clay path])] + :~ [/sys/lyv %c %warp our desk ~] + [/sys/lyv %c %warp our desk ~ %mult da+date paths] + == :: +mo-scry-agent-cage: read $agent core from clay :: ++ mo-scry-agent-cage - |= [dap=term =case:clay] + |= [dap=term =desk =case:clay] ^- (each agent tang) - =/ bek=beak [our %home case] + =/ bek=beak [our desk case] =/ sky (rof ~ %ca bek /app/[dap]/hoon) ?~ sky |+[leaf+"gall: {} scry blocked"]~ ?~ u.sky |+[leaf+"gall: {} scry failed"]~ @@ -497,35 +513,35 @@ :: ++ mo-handle-sys ~/ %mo-handle-sys - |= [=path =sign-arvo] + |= [=wire =sign-arvo] ^+ mo-core :: - ?+ -.path !! - %lyv (mo-handle-sys-lyv path sign-arvo) - %era (mo-handle-sys-era path sign-arvo) - %cor (mo-handle-sys-cor path sign-arvo) - %lag (mo-handle-sys-lag path sign-arvo) - %req (mo-handle-sys-req path sign-arvo) - %way (mo-handle-sys-way path sign-arvo) + ?+ -.wire !! + %lyv (mo-handle-sys-lyv wire sign-arvo) + %era (mo-handle-sys-era wire sign-arvo) + %cor (mo-handle-sys-cor wire sign-arvo) + %lag (mo-handle-sys-lag wire sign-arvo) + %req (mo-handle-sys-req wire sign-arvo) + %way (mo-handle-sys-way wire sign-arvo) == :: +mo-handle-sys-era: receive update about contact :: ++ mo-handle-sys-era - |= [=path =sign-arvo] + |= [=wire =sign-arvo] ^+ mo-core ?> ?=([%jael %public-keys *] sign-arvo) - ?> ?=([%era ~] path) + ?> ?=([%era ~] wire) ?. ?=(%breach -.public-keys-result.sign-arvo) mo-core (mo-breach who.public-keys-result.sign-arvo) :: +mo-handle-sys-cor: receive a built agent from %clay :: ++ mo-handle-sys-cor - |= [=path =sign-arvo] + |= [=wire =sign-arvo] ^+ mo-core :: - ?> ?=([%cor @ @ @ @ ~] path) - =/ [dap=term her=@ta desk=@ta dat=@ta ~] t.path + ?> ?=([%cor @ @ @ @ ~] wire) + =/ [dap=term her=@ta desk=@ta dat=@ta ~] t.wire =/ tim (slav da+dat) =/ =beak [(slav %p her) desk da+tim] ?> ?=([?(%behn %clay) %writ *] sign-arvo) @@ -546,23 +562,22 @@ ^+ mo-core =. mo-core (mo-give %onto |+tang) =/ =case [%da tim] - =/ =wire /sys/cor/[dap]/[her]/[desk]/(scot case) + =/ =^wire /sys/cor/[dap]/[her]/[desk]/(scot case) (mo-pass wire %c %warp p.beak desk ~ %next %a case /app/[dap]/hoon) -- :: +mo-handle-sys-lyv: handle notice that agents have been rebuilt :: ++ mo-handle-sys-lyv - |= [=path =sign-arvo] + |= [=wire =sign-arvo] ^+ mo-core - ?> ?=([%lyv ~] path) + ?> ?=([%lyv ~] wire) ?> ?=([?(%behn %clay) %wris *] sign-arvo) - =/ bek=beak [our %home p.sign-arvo] - =/ nex=(list [=care:clay =^path]) ~(tap in q.sign-arvo) + =/ nex=(list [=care:clay =path]) ~(tap in q.sign-arvo) ~> %slog.[0 leaf+"gall: reloading agents"] ~< %slog.[0 leaf+"gall: reloaded agents"] =; cor (mo-subscribe-to-agent-builds:cor p.p.sign-arvo) %+ roll nex - |= [[=care:clay =^path] cor=_mo-core] + |= [[=care:clay =path] cor=_mo-core] ^+ cor :: We throw away %z results because we only have them to guarantee :: molting. Clay will tell us if e.g. changing hoon.hoon affects @@ -570,18 +585,24 @@ :: ?. =(%a care) cor + ~| path=path =/ dap dap:;;([%app dap=@tas %hoon ~] path) - =/ rag (mo-scry-agent-cage dap p.sign-arvo) + =/ yok=(unit yoke) (~(get by yokes.state) dap) + ?~ yok + ~> %slog.[0 leaf+"gall: no agent to reload: {}"] + mo-core + =/ bek=beak [our q.beak.u.yok p.sign-arvo] + =/ rag (mo-scry-agent-cage dap q.bek p.sign-arvo) ?: ?=(%| -.rag) (mean p.rag) (mo-receive-core:cor dap bek p.rag) :: +mo-handle-sys-lag: handle an ames %clog notification :: ++ mo-handle-sys-lag - |= [=path =sign-arvo] + |= [=wire =sign-arvo] ^+ mo-core :: - ?> ?=([%lag ~] path) + ?> ?=([%lag ~] wire) ?> ?=([%ames %clog *] sign-arvo) :: =/ agents=(list term) ~(tap in ~(key by yokes.state)) @@ -598,25 +619,26 @@ :: :: TODO: what should we do if the remote nacks our %pull? ++ mo-handle-sys-req - |= [=path =sign-arvo] + |= [=wire =sign-arvo] ^+ mo-core :: - ?> ?=([%req @ @ ~] path) - =/ him (slav %p i.t.path) - =/ dap i.t.t.path + ?> ?=([%req @ @ ~] wire) + =/ him (slav %p i.t.wire) + =/ dap i.t.t.wire :: ?> ?=([?(%gall %behn) %unto *] sign-arvo) - =/ =sign:agent +>.sign-arvo + =/ =unto +>.sign-arvo :: - ?- -.sign + ?- -.unto + %raw-fact ~|([%gall-raw-req wire] !!) %poke-ack =/ err=(unit error:ames) - ?~ p.sign ~ - `[%poke-ack u.p.sign] + ?~ p.unto ~ + `[%poke-ack u.p.unto] (mo-give %done err) :: %fact - =+ [mark noun]=[p q.q]:cage.sign + =+ [mark noun]=[p q.q]:cage.unto (mo-give %boon %d mark noun) :: %kick @@ -624,8 +646,8 @@ :: %watch-ack =/ err=(unit error:ames) - ?~ p.sign ~ - `[%watch-ack u.p.sign] + ?~ p.unto ~ + `[%watch-ack u.p.unto] (mo-give %done err) == :: +mo-handle-sys-way: handle response to outgoing remote request @@ -699,19 +721,19 @@ :: ++ mo-handle-use ~/ %mo-handle-use - |= [=path =sign-arvo] + |= [=wire =sign-arvo] ^+ mo-core :: - ?. ?=([@ @ @ *] path) - ~& [%mo-handle-use-bad-path path] + ?. ?=([@ @ @ *] wire) + ~& [%mo-handle-use-bad-wire wire] !! :: - =/ dap=term i.path + =/ dap=term i.wire =/ yoke (~(get by yokes.state) dap) ?~ yoke %- (slog leaf+"gall: {} dead, got {<+<.sign-arvo>}" ~) mo-core - ?. =(nonce.u.yoke i.t.path) + ?. =(nonce.u.yoke i.t.wire) %- (slog leaf+"gall: got old {<+<.sign-arvo>} for {}" ~) mo-core ?. ?=([?(%gall %behn) %unto *] sign-arvo) @@ -719,30 +741,30 @@ %- (slog leaf+"gall: {} dozing, dropping {<+<.sign-arvo>}" ~) mo-core =/ app - =/ =ship (slav %p i.t.t.path) + =/ =ship (slav %p i.t.t.wire) =/ =routes [disclosing=~ attributing=ship] (ap-abed:ap dap routes) :: - =. app (ap-generic-take:app t.t.t.path sign-arvo) + =. app (ap-generic-take:app t.t.t.wire sign-arvo) ap-abet:app - ?> ?=([%out @ @ *] t.t.path) - =/ =ship (slav %p i.t.t.t.path) + ?> ?=([%out @ @ *] t.t.wire) + =/ =ship (slav %p i.t.t.t.wire) =/ =routes [disclosing=~ attributing=ship] - =/ =sign:agent +>.sign-arvo + =/ =unto +>.sign-arvo ?: ?=(%| -.agent.u.yoke) =/ blocked=(qeu blocked-move) =/ waiting (~(get by blocked.state) dap) =/ deals (fall waiting *(qeu blocked-move)) - =/ deal [hen routes |+sign] + =/ deal [hen routes |+unto] (~(put to deals) deal) :: - %- (slog leaf+"gall: {} dozing, got {<-.sign>}" ~) + %- (slog leaf+"gall: {} dozing, got {<-.unto>}" ~) %_ mo-core blocked.state (~(put by blocked.state) dap blocked) == =/ app (ap-abed:ap dap routes) =. app - (ap-specific-take:app t.t.path sign) + (ap-specific-take:app t.t.wire unto) ap-abet:app :: +mo-clear-queue: clear blocked tasks from the specified running agent. :: @@ -758,7 +780,7 @@ ?: =(~ blocked) =. blocked.state (~(del by blocked.state) dap) mo-core - =^ [=duct =routes blocker=(each deal sign:agent)] blocked + =^ [=duct =routes blocker=(each deal unto)] blocked ~(get to blocked) =/ =move =/ =sock [attributing.routes our] @@ -803,21 +825,10 @@ ?- style %slay mo-core(yokes.state (~(del by yokes.state) dap)) %idle mo-core - %jolt (mo-boot dap our %home) + %jolt (mo-boot dap our q.beak:(~(got by yokes.state) dap)) == =? mo-core !?=(%jolt style) (mo-subscribe-to-agent-builds now) mo-core - :: +mo-beak: assemble a beak for the specified agent. - :: - ++ mo-beak - |= dap=term - ^- beak - ?^ yoke=(~(get by yokes.state) dap) - beak.u.yoke - :: XX this fallback is necessary, as .term could be either the source - :: or the destination app. ie, it might not exist locally ... - :: - [our %home %da now] :: +mo-peek: call to +ap-peek (which is not accessible outside of +mo). :: ++ mo-peek @@ -837,7 +848,8 @@ :: %raw-poke =/ =case:clay da+now - =/ sky (rof ~ %cb [our %home case] /[mark.deal]) + =/ =desk q.beak:(~(got by yokes.state) dap) + =/ sky (rof ~ %cb [our desk case] /[mark.deal]) ?- sky ?(~ [~ ~]) =/ ror "gall: raw-poke fail :{(trip dap)} {}" @@ -851,7 +863,7 @@ (mo-give %unto %poke-ack `[leaf+ror p.res]) =. mo-core %+ mo-pass /nowhere - [%c %warp our %home ~ %sing %b case /[mark.deal]] + [%c %warp our desk ~ %sing %b case /[mark.deal]] (mo-apply-sure dap routes [%poke mark.deal p.res]) == :: @@ -859,7 +871,8 @@ =/ =case:clay da+now =/ =mars:clay [p.cage mark]:deal =/ mars-path /[a.mars]/[b.mars] - =/ sky (rof ~ %cc [our %home case] mars-path) + =/ =desk q.beak:(~(got by yokes.state) dap) + =/ sky (rof ~ %cc [our desk case] mars-path) ?- sky ?(~ [~ ~]) =/ ror "gall: poke cast fail :{(trip dap)} {}" @@ -873,7 +886,7 @@ (mo-give %unto %poke-ack `[leaf+ror p.res]) =. mo-core %+ mo-pass /nowhere - [%c %warp our %home ~ %sing %c case /[a.mars]/[b.mars]] + [%c %warp our desk ~ %sing %c case /[a.mars]/[b.mars]] (mo-apply-sure dap routes [%poke mark.deal p.res]) == == @@ -935,31 +948,12 @@ ++ mo-handle-ames-response |= =ames-response ^+ mo-core - ?- -.ames-response - :: %d: diff; ask clay to validate .noun as .mark - :: - %d - =/ =case:clay da+now - =/ sky (rof ~ %cb [our %home case] /[mark.ames-response]) - ?- sky - ?(~ [~ ~]) - (mean leaf+"gall: ames mark fail {}" ~) + :: %d: diff; ask clay to validate .noun as .mark + :: %x: kick; tell agent the publisher canceled the subscription :: - [~ ~ *] - =+ !<(=dais:clay q.u.u.sky) - =/ res (mule |.((vale:dais noun.ames-response))) - ?: ?=(%| -.res) - (mean leaf+"gall: ames vale fail {}" p.res) - =. mo-core - %+ mo-pass /nowhere - [%c %warp our %home ~ %sing %b case /[mark.ames-response]] - (mo-give %unto %fact mark.ames-response p.res) - == - :: - :: %x: kick; tell agent the publisher canceled the subscription - :: - %x - (mo-give %unto %kick ~) + ?- -.ames-response + %d (mo-give %unto %raw-fact mark.ames-response noun.ames-response) + %x (mo-give %unto %kick ~) == :: +ap: agent engine :: @@ -973,7 +967,7 @@ agent-duct=duct agent-moves=(list move) agent-config=(list (each suss tang)) - current-agent=yoke + =yoke == ++ ap-core . :: +ap-abed: initialise state for an agent, with the supplied routes. @@ -991,27 +985,27 @@ ++ ap-abut |= [dap=term =egg] ^+ ap-core - =/ =yoke + =/ yak=^yoke ?: ?=(%| -.old-state.egg) egg - =/ res (mo-scry-agent-cage dap da+now) + =/ res (mo-scry-agent-cage dap q.beak.egg da+now) ?: ?=(%| -.res) (mean p.res) egg(p.old-state `agent`p.res) =/ =routes [disclosing=~ attributing=our] - (ap-yoke dap routes yoke) + (ap-yoke dap routes yak) :: +ap-yoke: initialize agent state, starting from a $yoke :: ++ ap-yoke - |= [dap=term =routes =yoke] + |= [dap=term =routes yak=^yoke] ^+ ap-core - =. stats.yoke - :+ +(change.stats.yoke) - (shaz (mix (add dap change.stats.yoke) eny)) + =. stats.yak + :+ +(change.stats.yak) + (shaz (mix (add dap change.stats.yak) eny)) now =. agent-name dap =. agent-routes routes - =. current-agent yoke + =. yoke yak =. agent-duct hen ap-core :: +ap-abet: resolve moves. @@ -1019,7 +1013,7 @@ ++ ap-abet ^+ mo-core :: - =/ running (~(put by yokes.state) agent-name current-agent) + =/ running (~(put by yokes.state) agent-name yoke) =/ moves =/ giver |=(report=(each suss tang) [hen %give %onto report]) =/ from-suss (turn agent-config giver) @@ -1039,15 +1033,15 @@ ?- style %jolt ap-core %idle - =. agent.current-agent |+on-save:ap-agent-core + =. agent.yoke |+on-save:ap-agent-core ap-core :: %slay =/ out=(list [[=wire =ship =term] ? =path]) - ~(tap by outbound.watches.current-agent) + ~(tap by outbound.watches.yoke) =/ inbound-paths=(set path) %- silt - %+ turn ~(tap by inbound.watches.current-agent) + %+ turn ~(tap by inbound.watches.yoke) |= [=duct =ship =path] path =/ will=(list card:agent:gall) @@ -1055,7 +1049,7 @@ ?: =(~ inbound-paths) ~ [%give %kick ~(tap in inbound-paths) ~]~ - %+ turn ~(tap by outbound.watches.current-agent) + %+ turn ~(tap by outbound.watches.yoke) |= [[=wire =ship =term] ? =path] [%pass wire %agent [ship term] %leave ~] =^ maybe-tang ap-core (ap-ingest ~ |.([will *agent])) @@ -1100,17 +1094,16 @@ %- zing %+ turn ducts |= =duct + ^- (list move) ~? &(=(duct system-duct.state) !=(agent-name %hood)) [%agent-giving-on-system-duct agent-name -.gift] - ^- (list move) - =/ =mark - (~(gut by marks.current-agent) duct p.cage) + =/ =mark (~(gut by marks.yoke) duct p.cage) :: ?: =(mark p.cage) [duct %give %unto %fact cage.gift]~ =/ =mars:clay [p.cage mark] =/ =case:clay da+now - =/ bek=beak [our %home case] + =/ bek=beak [our q.beak.yoke case] =/ mars-path /[a.mars]/[b.mars] =/ sky (rof ~ %cc bek mars-path) ?- sky @@ -1124,7 +1117,9 @@ ?: ?=(%| -.res) %- (slog leaf+"watch-as fact conversion failure" p.res) (ap-kill-up-slip duct) - :~ [duct %pass /nowhere %c %warp our %home ~ %sing %c case mars-path] + :~ :* duct %pass /nowhere %c %warp our q.beak.yoke ~ + %sing %c case mars-path + == [duct %give %unto %fact b.mars p.res] == == @@ -1139,7 +1134,7 @@ %huck [%out (scot %p ship.neet) name.neet wire] %arvo [(scot %p attributing.agent-routes) wire] == - =. wire [%use agent-name nonce.current-agent wire] + =. wire [%use agent-name nonce.yoke wire] =/ =note-arvo ?- -.neet %arvo note-arvo.neet @@ -1154,7 +1149,7 @@ |= =ship ^+ ap-core =/ in=(list [=duct =^ship =path]) - ~(tap by inbound.watches.current-agent) + ~(tap by inbound.watches.yoke) |- ^+ ap-core ?^ in =? ap-core =(ship ship.i.in) @@ -1163,7 +1158,7 @@ $(in t.in) :: =/ out=(list [[=wire =^ship =term] ? =path]) - ~(tap by outbound.watches.current-agent) + ~(tap by outbound.watches.yoke) |- ^+ ap-core ?~ out ap-core @@ -1186,7 +1181,7 @@ ^+ ap-core :: =/ in=(list [=duct =^ship =path]) - ~(tap by inbound.watches.current-agent) + ~(tap by inbound.watches.yoke) |- ^+ ap-core ?~ in ap-core :: @@ -1197,8 +1192,8 @@ :: +ap-agent-core: agent core with current bowl and state :: ++ ap-agent-core - ?> ?=(%& -.agent.current-agent) - ~(. p.agent.current-agent ap-construct-bowl) + ?> ?=(%& -.agent.yoke) + ~(. p.agent.yoke ap-construct-bowl) :: +ap-ducts-from-paths: get ducts subscribed to paths :: ++ ap-ducts-from-paths @@ -1207,7 +1202,7 @@ ?~ target-paths ?~ target-ship ~[agent-duct] - %+ murn ~(tap by inbound.watches.current-agent) + %+ murn ~(tap by inbound.watches.yoke) |= [=duct =ship =path] ^- (unit ^duct) ?: =(target-ship `ship) @@ -1222,7 +1217,7 @@ ++ ap-ducts-from-path |= [target-path=path target-ship=(unit ship)] ^- (list duct) - %+ murn ~(tap by inbound.watches.current-agent) + %+ murn ~(tap by inbound.watches.yoke) |= [=duct =ship =path] ^- (unit ^duct) ?: ?& =(target-path path) @@ -1276,7 +1271,7 @@ =/ tub=(unit tube:clay) ?: =(have want) `(bake same ^vase) =/ tuc=(unit (unit cage)) - (rof ~ %cc [our %home da+now] /[have]/[want]) + (rof ~ %cc [our q.beak.yoke da+now] /[have]/[want]) ?. ?=([~ ~ *] tuc) ~ `!<(tube:clay q.u.u.tuc) ?~ tub @@ -1294,14 +1289,21 @@ ?: is-ok ap-core (ap-kill-down wire [other-ship other-agent]) + :: +ap-move: send move + :: + ++ ap-move + |= =(list move) + ap-core(agent-moves (weld (flop list) agent-moves)) :: +ap-give: return result. :: ++ ap-give |= =gift:agent - ^+ ap-core - =/ internal-moves - (weld (ap-from-internal %give gift) agent-moves) - ap-core(agent-moves internal-moves) + (ap-move (ap-from-internal %give gift)) + :: +ap-pass: request action. + :: + ++ ap-pass + |= [=path =neet] + (ap-move (ap-from-internal %pass path neet)) :: +ap-construct-bowl: set up bowl. :: ++ ap-construct-bowl @@ -1310,22 +1312,14 @@ attributing.agent-routes :: guest agent-name :: agent == :: - :* wex=outbound.watches.current-agent :: outgoing - sup=inbound.watches.current-agent :: incoming + :* wex=outbound.watches.yoke :: outgoing + sup=inbound.watches.yoke :: incoming == :: - :* act=change.stats.current-agent :: tick - eny=eny.stats.current-agent :: nonce - now=time.stats.current-agent :: time - byk=beak.current-agent :: source + :* act=change.stats.yoke :: tick + eny=eny.stats.yoke :: nonce + now=time.stats.yoke :: time + byk=beak.yoke :: source == == - :: +ap-pass: request action. - :: - ++ ap-pass - |= [=path =neet] - ^+ ap-core - =/ internal-moves - (ap-from-internal %pass path neet) - ap-core(agent-moves (weld internal-moves agent-moves)) :: +ap-reinstall: reinstall. :: ++ ap-reinstall @@ -1333,11 +1327,11 @@ |= =agent ^+ ap-core =/ old-state=vase - ?: ?=(%& -.agent.current-agent) + ?: ?=(%& -.agent.yoke) on-save:ap-agent-core - p.agent.current-agent + p.agent.yoke =^ error ap-core - (ap-install(agent.current-agent &+agent) `old-state) + (ap-install(agent.yoke &+agent) `old-state) ?~ error ap-core (mean >%load-failed< u.error) @@ -1346,7 +1340,7 @@ ++ ap-subscribe-as |= [=mark =path] ^+ ap-core - =. marks.current-agent (~(put by marks.current-agent) agent-duct mark) + =. marks.yoke (~(put by marks.yoke) agent-duct mark) (ap-subscribe path) :: +ap-subscribe: apply %watch. :: @@ -1355,8 +1349,8 @@ |= pax=path ^+ ap-core =/ incoming [attributing.agent-routes pax] - =. inbound.watches.current-agent - (~(put by inbound.watches.current-agent) agent-duct incoming) + =. inbound.watches.yoke + (~(put by inbound.watches.yoke) agent-duct incoming) =^ maybe-tang ap-core %+ ap-ingest %watch-ack |. (on-watch:ap-agent-core pax) @@ -1398,7 +1392,7 @@ :: +ap-specific-take: specific take. :: ++ ap-specific-take - |= [=wire =sign:agent] + |= [=wire =unto] ^+ ap-core ~| wire=wire ?> ?=([%out @ @ *] wire) @@ -1406,13 +1400,31 @@ =/ other-agent i.t.t.wire =/ =dock [other-ship other-agent] =/ agent-wire t.t.t.wire + :: + =^ =sign:agent ap-core + ?. ?=(%raw-fact -.unto) + [unto ap-core] + =/ =case:clay da+now + =/ sky (rof ~ %cb [our q.beak.yoke case] /[mark.unto]) + ?. ?=([~ ~ *] sky) + (mean leaf+"gall: ames mark fail {}" ~) + :: + =+ !<(=dais:clay q.u.u.sky) + =/ res (mule |.((vale:dais noun.unto))) + ?: ?=(%| -.res) + (mean leaf+"gall: ames vale fail {}" p.res) + :- [%fact mark.unto p.res] + %- ap-move :_ ~ + :^ hen %pass /nowhere + [%c %warp our q.beak.yoke ~ %sing %b case /[mark.unto]] + :: :: if subscription ack or close, handle before calling user code :: - =? outbound.watches.current-agent ?=(%kick -.sign) - %- ~(del by outbound.watches.current-agent) + =? outbound.watches.yoke ?=(%kick -.sign) + %- ~(del by outbound.watches.yoke) [agent-wire dock] ?: ?& ?=(%watch-ack -.sign) - !(~(has by outbound.watches.current-agent) [agent-wire dock]) + !(~(has by outbound.watches.yoke) [agent-wire dock]) == %- %: slog leaf+"{}: got ack for nonexistent subscription" @@ -1422,11 +1434,11 @@ == ap-core :: - =? outbound.watches.current-agent ?=(%watch-ack -.sign) + =? outbound.watches.yoke ?=(%watch-ack -.sign) ?^ p.sign - %- ~(del by outbound.watches.current-agent) + %- ~(del by outbound.watches.yoke) [agent-wire dock] - %+ ~(jab by outbound.watches.current-agent) [agent-wire dock] + %+ ~(jab by outbound.watches.yoke) [agent-wire dock] |= [acked=? =path] =. . ?. acked @@ -1484,8 +1496,8 @@ ^+ ap-core :: %= ap-core - inbound.watches.current-agent - (~(del by inbound.watches.current-agent) agent-duct) + inbound.watches.yoke + (~(del by inbound.watches.yoke) agent-duct) == :: +ap-load-delete: load delete. :: @@ -1493,13 +1505,13 @@ ^+ ap-core :: =/ maybe-incoming - (~(get by inbound.watches.current-agent) agent-duct) + (~(get by inbound.watches.yoke) agent-duct) ?~ maybe-incoming ap-core :: =/ incoming u.maybe-incoming - =. inbound.watches.current-agent - (~(del by inbound.watches.current-agent) agent-duct) + =. inbound.watches.yoke + (~(del by inbound.watches.yoke) agent-duct) :: =^ maybe-tang ap-core %+ ap-ingest ~ |. @@ -1603,9 +1615,9 @@ ?: ?=(%| -.result) `ap-core :: - =. agent.current-agent &++.p.result + =. agent.yoke &++.p.result =/ moves (zing (turn -.p.result ap-from-internal)) - =. inbound.watches.current-agent + =. inbound.watches.yoke (ap-handle-kicks moves) (ap-handle-peers moves) :: +ap-handle-kicks: handle cancels of inbound.watches @@ -1624,7 +1636,7 @@ :: =/ quit-map=bitt (malt (turn quits |=(=duct [duct *[ship path]]))) - (~(dif by inbound.watches.current-agent) quit-map) + (~(dif by inbound.watches.yoke) quit-map) :: +ap-handle-peers: handle new outbound.watches :: ++ ap-handle-peers @@ -1641,8 +1653,8 @@ ?> ?=([%use @ @ %out @ @ *] wire) =/ short-wire t.t.t.t.t.t.wire =/ =dock [q.p q]:q.move.move - =. outbound.watches.current-agent - (~(del by outbound.watches.current-agent) [short-wire dock]) + =. outbound.watches.yoke + (~(del by outbound.watches.yoke) [short-wire dock]) $(moves t.moves, new-moves [move new-moves]) ?. ?=([* %pass * %g %deal * * ?(%watch %watch-as) *] move) $(moves t.moves, new-moves [move new-moves]) @@ -1655,17 +1667,17 @@ %watch path.r.q.move.move %watch-as path.r.q.move.move == - ?: (~(has by outbound.watches.current-agent) short-wire dock) + ?: (~(has by outbound.watches.yoke) short-wire dock) =. ap-core =/ =tang ~[leaf+"subscribe wire not unique" >agent-name< >short-wire< >dock<] =/ have - (~(got by outbound.watches.current-agent) short-wire dock) + (~(got by outbound.watches.yoke) short-wire dock) %- (slog >out=have< tang) (ap-error %watch-not-unique tang) :: reentrant, maybe bad? $(moves t.moves) - =. outbound.watches.current-agent - (~(put by outbound.watches.current-agent) [short-wire dock] [| path]) + =. outbound.watches.yoke + (~(put by outbound.watches.yoke) [short-wire dock] [| path]) $(moves t.moves, new-moves [move new-moves]) -- -- @@ -1683,7 +1695,7 @@ :: =/ mo-core (mo-abed:mo duct) ?- -.task - %conf mo-abet:(mo-boot:mo-core dap.task our %home) + %conf mo-abet:(mo-boot:mo-core dap.task our desk.task) %deal =/ [=sock =term =deal] [p q r]:task ?. =(q.sock our) @@ -1753,6 +1765,16 @@ == [~ ~ noun+!>((~(has by yokes.state) dap))] :: + ?: ?& =(%d care) + =(~ path) + =([%$ %da now] coin) + =(our ship) + == + =/ yok=(unit yoke) (~(get by yokes.state) dap) + ?~ yok + [~ ~] + [~ ~ desk+!>(q.beak.u.yok)] + :: ?. =(our ship) ~ ?. =([%$ %da now] coin) diff --git a/pkg/arvo/sys/vane/jael.hoon b/pkg/arvo/sys/vane/jael.hoon index 3bda44586..fe6928590 100644 --- a/pkg/arvo/sys/vane/jael.hoon +++ b/pkg/arvo/sys/vane/jael.hoon @@ -563,7 +563,8 @@ +>.$ :: [%gall %unto *] - ?- +>-.hin + ?- +>-.hin + %raw-fact !! %kick ~|([%jael-unexpected-quit tea hin] !!) %poke-ack ?~ p.p.+>.hin diff --git a/pkg/arvo/tests/sys/vane/gall.hoon b/pkg/arvo/tests/sys/vane/gall.hoon index f80820c74..5893824db 100644 --- a/pkg/arvo/tests/sys/vane/gall.hoon +++ b/pkg/arvo/tests/sys/vane/gall.hoon @@ -33,7 +33,7 @@ =/ ship ~nec :: =/ call-args - =/ =task:gall [%conf dap] + =/ =task:gall [%conf dap %home] [duct task] :: =/ =move:gall-gate From d5ec02c801fb81920e8794d525bf4950b02642a5 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Mon, 14 Jun 2021 16:15:45 -0500 Subject: [PATCH 002/595] eyre: cast within zapgar to avoid nest check --- pkg/arvo/sys/vane/eyre.hoon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index 810e329ba..abf34980e 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -554,6 +554,7 @@ :: +per-server-event: per-event server core :: ++ per-server-event + ~% %eyre-per-server-event ..part ~ :: gate that produces the +per-server-event core from event information :: |= [[eny=@ =duct now=@da rof=roof] state=server-state] @@ -785,7 +786,7 @@ :* duct %pass /run-app-request/[eyre-id] %g %deal [our our] app %poke %handle-http-request - !>([eyre-id inbound-request]) + !>(`[@ta inbound-request:eyre]`[eyre-id inbound-request]) == == :: +cancel-request: handles a request being externally aborted From 87b7f0513e7aff45a69669d2a09e9e77b3c2ffd3 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Mon, 28 Jun 2021 15:04:15 -0400 Subject: [PATCH 003/595] added /sys.kelvin and %kelvin mark --- pkg/arvo/mar/kelvin.hoon | 20 ++++++++++++++++++++ pkg/arvo/sys.kelvin | 1 + 2 files changed, 21 insertions(+) create mode 100644 pkg/arvo/mar/kelvin.hoon create mode 100644 pkg/arvo/sys.kelvin diff --git a/pkg/arvo/mar/kelvin.hoon b/pkg/arvo/mar/kelvin.hoon new file mode 100644 index 000000000..b95fddf85 --- /dev/null +++ b/pkg/arvo/mar/kelvin.hoon @@ -0,0 +1,20 @@ +=> |% + +$ kelvin [lal=@tas num=@ud] + -- +|_ kel=kelvin +++ grow + |% + ++ mime [/text/x-kelvin (as-octs:mimes:html hoon)] + ++ noun kel + ++ hoon (crip "{<[lal num]:kel>}\0a") + ++ txt (to-wain:format hoon) + -- +++ grab + |% + ++ noun kelvin + ++ mime + |= [=mite len=@ud tex=@] + !<(kelvin (slap !>(~) (ream tex))) + -- +++ grad %noun +-- diff --git a/pkg/arvo/sys.kelvin b/pkg/arvo/sys.kelvin new file mode 100644 index 000000000..b7464903a --- /dev/null +++ b/pkg/arvo/sys.kelvin @@ -0,0 +1 @@ +[%zuse 420] From 9c4ea770212d399e5e2915669f6d15fe1aafad3f Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Mon, 28 Jun 2021 17:54:41 -0400 Subject: [PATCH 004/595] desk.bill and %bill mark --- pkg/arvo/desk.bill | 16 +++++++++++++ pkg/arvo/mar/bill.hoon | 53 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 pkg/arvo/desk.bill create mode 100644 pkg/arvo/mar/bill.hoon diff --git a/pkg/arvo/desk.bill b/pkg/arvo/desk.bill new file mode 100644 index 000000000..8f5189f70 --- /dev/null +++ b/pkg/arvo/desk.bill @@ -0,0 +1,16 @@ +:~ :- %apes + :~ %acme + %azimuth-tracker + %dbug + %dojo + %eth-watcher + %goad + %lens + %ping + %spider + == +:: + :- %fish + :~ %dojo + == +== diff --git a/pkg/arvo/mar/bill.hoon b/pkg/arvo/mar/bill.hoon new file mode 100644 index 000000000..03895ba08 --- /dev/null +++ b/pkg/arvo/mar/bill.hoon @@ -0,0 +1,53 @@ +=> |% + +$ bill (list chit) + +$ chit + $% [%apes duz=(list dude:gall)] + [%fish duz=(list dude:gall)] + == + -- +|_ bil=bill +++ grow + |% + ++ mime [/text/x-bill (as-octs:mimes:html hoon)] + ++ noun bil + ++ hoon + |^ (crip (wrap-chits (turn bil spit-chit))) + :: + ++ wrap-chits + =/ res=tape ":~ " + |= taz=(list tape) + ^- tape + ?: =(~ taz) "~" + |- ^+ res + ?~ taz (weld res "==\0a") + $(taz t.taz, res :(weld res " " i.taz "\0a")) + :: + ++ spit-chit + |= =chit + ^- tape + ?- -.chit + %apes (weld (spit-tag %apes) (spit-list duz.chit)) + %fish (weld (spit-tag %fish) (spit-list duz.chit)) + == + :: + ++ spit-tag |=(tag=term ":- {}\0a") + ++ spit-list + =/ res=tape ":~ " + |= duz=(list dude:gall) + ^- tape + ?: =(~ duz) "~" + |- ^+ res + ?~ duz (weld res "==\0a") + $(duz t.duz, res :(weld res " " (trip i.duz) "\0a")) + -- + ++ txt (to-wain:format hoon) + -- +++ grab + |% + ++ noun bill + ++ mime + |= [=mite len=@ud tex=@] + !<(bill (slap !>(~) (ream tex))) + -- +++ grad %noun +-- From 5ea99135612b3c69b4dab94e9697dbf1da056737 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Mon, 28 Jun 2021 18:46:14 -0400 Subject: [PATCH 005/595] /mar/bill: fix formatting --- pkg/arvo/mar/bill.hoon | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/pkg/arvo/mar/bill.hoon b/pkg/arvo/mar/bill.hoon index 03895ba08..6b6426ca8 100644 --- a/pkg/arvo/mar/bill.hoon +++ b/pkg/arvo/mar/bill.hoon @@ -11,34 +11,29 @@ ++ mime [/text/x-bill (as-octs:mimes:html hoon)] ++ noun bil ++ hoon - |^ (crip (wrap-chits (turn bil spit-chit))) + ^- @t + |^ (crip (of-wall:format (wrap-lines (zing (turn bil spit-chit))))) :: - ++ wrap-chits - =/ res=tape ":~ " - |= taz=(list tape) - ^- tape - ?: =(~ taz) "~" - |- ^+ res - ?~ taz (weld res "==\0a") - $(taz t.taz, res :(weld res " " i.taz "\0a")) + ++ wrap-lines + |= taz=wall + ^- wall + ?~ taz ["~"]~ + :- (weld ":~ " i.taz) + %- snoc :_ "==" + (turn t.taz |=(t=tape (weld " " t))) :: ++ spit-chit |= =chit - ^- tape + ^- wall ?- -.chit - %apes (weld (spit-tag %apes) (spit-list duz.chit)) - %fish (weld (spit-tag %fish) (spit-list duz.chit)) + %apes [":- %apes" (wrap-lines (spit-duz duz.chit))] + %fish [":- %fish" (wrap-lines (spit-duz duz.chit))] == :: - ++ spit-tag |=(tag=term ":- {}\0a") - ++ spit-list - =/ res=tape ":~ " + ++ spit-duz |= duz=(list dude:gall) - ^- tape - ?: =(~ duz) "~" - |- ^+ res - ?~ duz (weld res "==\0a") - $(duz t.duz, res :(weld res " " (trip i.duz) "\0a")) + ^- wall + (turn duz |=(=dude:gall "%{}")) -- ++ txt (to-wain:format hoon) -- From c4228db2eaf0d8f69a4f8baa6d2b400e86af79ed Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Mon, 28 Jun 2021 18:49:27 -0400 Subject: [PATCH 006/595] desk.bill: remove comment for jenky bijection --- pkg/arvo/desk.bill | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/arvo/desk.bill b/pkg/arvo/desk.bill index 8f5189f70..30a6f6b42 100644 --- a/pkg/arvo/desk.bill +++ b/pkg/arvo/desk.bill @@ -9,7 +9,6 @@ %ping %spider == -:: :- %fish :~ %dojo == From fe1f6d895aa6bbb97fb465396f8bd76a0eb7c2db Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Mon, 28 Jun 2021 19:07:29 -0400 Subject: [PATCH 007/595] /gen/show-vat.hoon --- pkg/arvo/gen/show-vat.hoon | 15 +++++++++++++++ pkg/arvo/mar/bill.hoon | 8 +------- pkg/arvo/sur/bill.hoon | 7 +++++++ 3 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 pkg/arvo/gen/show-vat.hoon create mode 100644 pkg/arvo/sur/bill.hoon diff --git a/pkg/arvo/gen/show-vat.hoon b/pkg/arvo/gen/show-vat.hoon new file mode 100644 index 000000000..2f2e7f725 --- /dev/null +++ b/pkg/arvo/gen/show-vat.hoon @@ -0,0 +1,15 @@ +/- *bill +:- %say +|= $: [now=@da eny=@uvJ bec=beak] + [=desk ~] + ~ + == +:- %tang +%- flop ^- tang +=/ pax=path /(scot %p p.bec)/[desk]/(scot %da now) +=+ .^([lal=@tas num=@ud] cx+(weld pax /sys/kelvin)) +:~ 'sys.kelvin:' + leaf/"[%{} %{}]" + 'desk.bill:' + (sell !>(.^(bill cx+(weld pax /desk/bill)))) +== diff --git a/pkg/arvo/mar/bill.hoon b/pkg/arvo/mar/bill.hoon index 6b6426ca8..60dec3453 100644 --- a/pkg/arvo/mar/bill.hoon +++ b/pkg/arvo/mar/bill.hoon @@ -1,10 +1,4 @@ -=> |% - +$ bill (list chit) - +$ chit - $% [%apes duz=(list dude:gall)] - [%fish duz=(list dude:gall)] - == - -- +/- *bill |_ bil=bill ++ grow |% diff --git a/pkg/arvo/sur/bill.hoon b/pkg/arvo/sur/bill.hoon new file mode 100644 index 000000000..bfd52b04d --- /dev/null +++ b/pkg/arvo/sur/bill.hoon @@ -0,0 +1,7 @@ +|% ++$ bill (list chit) ++$ chit + $% [%apes duz=(list dude:gall)] + [%fish duz=(list dude:gall)] + == +-- From 501ed4ad827f9ec698608a99ec34164614bc4f3c Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Mon, 28 Jun 2021 20:01:51 -0400 Subject: [PATCH 008/595] clay: remove reef --- pkg/arvo/sys/vane/clay.hoon | 248 ++++++++++++++++-------------------- 1 file changed, 113 insertions(+), 135 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index b86b1c181..4faee424a 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -96,7 +96,6 @@ lab=(map @tas aeon) :: labels mim=(map path mime) :: mime cache fod=ford-cache :: ford cache - fer=(unit reef-cache) :: reef cache == :: :: :: Commit state. @@ -131,14 +130,6 @@ casts=(map mars [res=vase dez=(set [dir=? =path])]) tubes=(map mars [res=tube dez=(set [dir=? =path])]) == -:: $reef-cache: built system files -:: -+$ reef-cache - $: hoon=vase - arvo=vase - lull=vase - zuse=vase - == :: :: Hash of a blob, for lookup in the object store (lat.ran) :: @@ -490,8 +481,7 @@ cycle=(set build) == +$ args - $: bud=vase - =ankh + $: =ankh deletes=(set path) changes=(map path (each page lobe)) file-store=(map lobe blob) @@ -588,7 +578,7 @@ -- :_ nub ^- vase :: vase of nave - %+ slap (slop (with-face cor+cor) bud) + %+ slap (slop (with-face cor+cor) !>(..zuse)) !, *hoon =/ typ _+<.cor =/ dif _*diff:grad:cor @@ -873,7 +863,8 @@ :: ++ run-pile |= =pile - =^ sut=vase nub (run-tauts bud %sur sur.pile) + =/ sut=vase !>(..zuse) + =^ sut=vase nub (run-tauts sut %sur sur.pile) =^ sut=vase nub (run-tauts sut %lib lib.pile) =^ sut=vase nub (run-raw sut raw.pile) =^ sut=vase nub (run-raz sut raz.pile) @@ -1315,8 +1306,7 @@ ++ balk-all (duct-lift balk) ++ bleb-all (duct-lift bleb) :: - ++ static-ford-args - [zuse:(need fer.dom) ank.dom ~ ~ lat.ran fod.dom] + ++ static-ford-args [ank.dom ~ ~ lat.ran fod.dom] :: :: Transfer a request to another ship's clay. :: @@ -1536,25 +1526,19 @@ :: promote and fill in ankh :: promote and fill in mime cache :: - ?: &(=(%home syd) !updated) + ?: &(=(%base syd) !updated) (sys-update yoki new-data) :: clear caches if zuse reloaded :: - =/ is-zuse-new=? (need-reef-update changes) =. fod.dom - ?: is-zuse-new - *ford-cache + ?: updated *ford-cache (promote-ford fod.dom deletes ~(key by changes)) - =. fer.dom `(build-reef fer.dom ~(key by changes) new-data) - =? ank.dom is-zuse-new *ankh - =? changes is-zuse-new - (changes-for-upgrade q.old-yaki deletes changes) + =? ank.dom updated *ankh + =? changes updated (changes-for-upgrade q.old-yaki deletes changes) :: - =/ =args:ford:fusion - [zuse:(need fer.dom) ank.dom deletes changes lat.ran fod.dom] + =/ =args:ford:fusion [ank.dom deletes changes lat.ran fod.dom] :: - =^ change-cages ford-cache.args - (checkout-changes args changes) + =^ change-cages ford-cache.args (checkout-changes args changes) =/ sane-continuation (sane-changes changes change-cages) =/ new-blobs=(map lobe blob) %- malt @@ -1693,62 +1677,6 @@ $(builds t.builds) (~(put by $(builds t.builds)) i.builds) :: - ++ build-reef - => |% - +$ reef-step - :: vary: source or dependencies changed - :: deep: source and dependencies match kernel - :: - [vary=? deep=?] - -- - :: - |= $: fer=(unit reef-cache) - invalid=(set path) - data=(map path (each page lobe)) - == - |^ ^- reef-cache - =/ [tep=reef-step ref=reef-cache] - ?^ fer - [[vary=| deep=&] u.fer] - [[vary=& deep=&] *reef-cache] - :: - =^ hon tep (build tep /sys/hoon hoon.ref !>(**) !,(*hoon ..ride)) - =^ rav tep (build tep /sys/arvo arvo.ref hon !,(*hoon ..part)) - =^ lul tep (build tep /sys/lull lull.ref rav !,(*hoon .)) - =^ zus tep (build tep /sys/zuse zuse.ref lul !,(*hoon .)) - [hon rav lul zus] - :: - ++ build - |= [tep=reef-step pax=path pre=vase sub=vase pro=hoon] - ^- (pair vase reef-step) - =/ ful (weld pax /hoon) - ?. ?| vary.tep - (~(has in invalid) ful) - == - [pre tep] - =. vary.tep & - =/ src (path-to-cord data ful) - :: - ?: &(deep.tep (deep pax src)) - [(slap !>(..zuse) pro) tep] - :: - =/ nam=term ?.(?=([@ta @ta *] pax) %$ i.t.pax) - ~> %slog.0^leaf+"clay: building %{(trip nam)} on %{(trip syd)}" - =/ gen - ~_ leaf+"%{(trip nam)}-parse-fail" - (rain ful src) - ~_ leaf+"%{(trip nam)}-compile-fail" - [(slap (slap sub gen) pro) tep(deep |)] - :: - ++ deep - |= [pax=path src=cord] - ^- ? - =/ dat (rof `[our ~ ~] $/[[our $/da/now] mod/fat/pax]) - ?: |(?=(~ dat) ?=(~ u.dat)) | - =/ nod !<((axal (cask)) q.u.u.dat) - &(?=(^ fil.nod) ?=(%hoon p.u.fil.nod) =(src q.u.fil.nod)) - -- - :: ++ page-to-cord |= =page ^- @t @@ -1936,8 +1864,7 @@ =/ original=(map path (each page lobe)) (~(run by q.yaki) |=(=lobe |+lobe)) (~(uni by original) changes) - =/ =args:ford:fusion - [zuse:(need fer.dom) *ankh ~ all-changes lat.ran *ford-cache] + =/ =args:ford:fusion [*ankh ~ all-changes lat.ran *ford-cache] =^ all-change-cages ford-cache.args (checkout-changes args all-changes) =/ ccs=(list [=path =lobe =cage]) ~(tap by change-cages) @@ -2002,19 +1929,6 @@ test-ankh (~(got by dir.test-ankh) ta) == :: - :: Find reef dependency changes - :: - ++ need-reef-update - |= changes=(map path (each page lobe)) - ^- ? - %+ lien ~(tap by changes) - |= [=path *] - ?| =(/sys/hoon/hoon path) - =(/sys/arvo/hoon path) - =(/sys/lull/hoon path) - =(/sys/zuse/hoon path) - == - :: :: Delay current update until sys update is complete :: ++ sys-update @@ -2802,8 +2716,7 @@ =. mon (~(put by mon) pot [her syd case] spur) =/ =yaki (~(got by hut.ran) (~(got by hit.dom) let.dom)) =/ changes (~(run by q.yaki) |=(=lobe |+lobe)) - =/ =args:ford:fusion - [zuse:(need fer.dom) ank.dom ~ changes lat.ran fod.dom] + =/ =args:ford:fusion [ank.dom ~ changes lat.ran fod.dom] =^ mim ford-cache.args (checkout-mime args ~ ~(key by changes)) =. mim.dom (apply-changes-to-mim mim.dom mim) @@ -3004,10 +2917,10 @@ =/ vale-result %- mule |. %- wrap:fusion - :: Use %home's marks to validate, so we don't have to build the + :: Use %base's marks to validate, so we don't have to build the :: foreign hoon/zuse :: - =/ args %*(static-ford-args . dom dom:(~(got by dos.rom) %home)) + =/ args %*(static-ford-args . dom dom:(~(got by dos.rom) %base)) (page-to-cage:(ford:fusion args) peg) ?: ?=(%| -.vale-result) %- (slog >%validate-x-failed< p.vale-result) @@ -4210,7 +4123,7 @@ :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: =| :: instrument state - $: ver=%8 :: vane version + $: ver=%9 :: vane version ruf=raft :: revision tree == :: |= [now=@da eny=@uvJ rof=roof] :: current invocation @@ -4312,7 +4225,7 @@ =/ bem=beam ?^ bem u.bem - [[our %home %ud 1] ~] + [[our %home %ud 1] ~] :: TODO: remove this fallback? =/ dos (~(get by dos.rom.ruf) q.bem) ?~ dos !! :: fire next in queue @@ -4464,41 +4377,83 @@ ++ load => |% +$ raft-any - $% [%8 raft-8] + $% [%9 raft-9] + [%8 raft-8] [%7 raft-7] [%6 raft-6] == - +$ raft-8 raft + +$ raft-9 raft + +$ raft-8 + $: rom=room-8 + hoy=(map ship rung-8) + ran=rang + mon=(map term beam) + hez=(unit duct) + cez=(map @ta crew) + pud=(unit [=desk =yoki]) + == + +$ room-8 + $: hun=duct + dos=(map desk dojo-8) + == + +$ rung-8 + $: rus=(map desk rede-8) + == + +$ dojo-8 + $: qyx=cult + dom=dome-8 + per=regs + pew=regs + fiz=melt + == + +$ dome-8 + $: ank=ankh + let=aeon + hit=(map aeon tako) + lab=(map @tas aeon) + mim=(map path mime) + fod=ford-cache + fer=* :: reef cache, obsolete + == + +$ rede-8 + $: lim=@da + ref=(unit rind) + qyx=cult + dom=dome-8 + per=regs + pew=regs + fiz=melt + == +$ raft-7 - $: rom=room-7 - hoy=(map ship rung-7) - ran=rang - mon=(map term beam) - hez=(unit duct) - cez=(map @ta crew) - pud=(unit [=desk =yoki]) - == + $: rom=room-7 + hoy=(map ship rung-7) + ran=rang + mon=(map term beam) + hez=(unit duct) + cez=(map @ta crew) + pud=(unit [=desk =yoki]) + == +$ room-7 - $: hun=duct - dos=(map desk dojo-7) - == + $: hun=duct + dos=(map desk dojo-7) + == +$ rung-7 - $: rus=(map desk rede-7) - == + $: rus=(map desk rede-7) + == +$ dojo-7 - $: qyx=cult - dom=dome - per=regs - pew=regs - == + $: qyx=cult + dom=dome-8 + per=regs + pew=regs + == +$ rede-7 - $: lim=@da - ref=(unit rind) - qyx=cult - dom=dome - per=regs - pew=regs - == + $: lim=@da + ref=(unit rind) + qyx=cult + dom=dome-8 + per=regs + pew=regs + == +$ ford-cache-7 ford-cache +$ raft-6 $: rom=room-6 :: domestic @@ -4523,7 +4478,7 @@ lab=(map @tas aeon) :: labels mim=(map path mime) :: mime cache fod=ford-cache-6 :: ford cache - fer=(unit reef-cache) :: reef cache + fer=* :: reef cache == +$ rung-6 $: rus=(map desk rede-6) @@ -4542,7 +4497,8 @@ |^ =? old ?=(%6 -.old) 7+(raft-6-to-7 +.old) =? old ?=(%7 -.old) 8+(raft-7-to-8 +.old) - ?> ?=(%8 -.old) + =? old ?=(%8 -.old) 9+(raft-8-to-9 +.old) + ?> ?=(%9 -.old) ..^^$(ruf +.old) :: +raft-6-to-7: delete stale ford caches (they could all be invalid) :: @@ -4572,7 +4528,7 @@ dos.rom %- ~(run by dos.rom.raf) |= doj=dojo-7 - ^- dojo + ^- dojo-8 [qyx.doj dom.doj per.doj pew.doj *melt] :: hoy @@ -4580,9 +4536,31 @@ |= =rung-7 %- ~(run by rus.rung-7) |= r=rede-7 - ^- rede + ^- rede-8 [lim.r ref.r qyx.r dom.r per.r pew.r *melt] == + :: +raft-8-to-9: remove reef cache + :: + ++ raft-8-to-9 + |= raf=raft-8 + ^- raft-9 + %= raf + dos.rom + %- ~(run by dos.rom.raf) + |= =dojo-8 + ^- dojo + =/ dom dom.dojo-8 + dojo-8(dom [ank.dom let.dom hit.dom lab.dom mim.dom *ford-cache]) + :: + hoy + %- ~(run by hoy.raf) + |= =rung-8 + %- ~(run by rus.rung-8) + |= =rede-8 + ^- rede + =/ dom dom.rede-8 + rede-8(dom [ank.dom let.dom hit.dom lab.dom mim.dom *ford-cache]) + == -- :: ++ scry :: inspect From 40af38c9ee2af72ff05bfd887884e62b181c91c7 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Mon, 28 Jun 2021 20:18:37 -0400 Subject: [PATCH 009/595] bin/solid.pill --- bin/solid.pill | 4 ++-- pkg/arvo/sys/vane/clay.hoon | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/bin/solid.pill b/bin/solid.pill index 671dccc97..e6489275f 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e0c05655f47ff81c8d4985a061d3ff57526a436adf25f667432a48c5cd10d438 -size 12190347 +oid sha256:626d8c5451e48df166f3e8d1fba27264e940efede037a1eb266a23316caeb259 +size 12307337 diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 4faee424a..a7ba3591e 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -1509,6 +1509,18 @@ =: hut.ran (~(uni by hut.rang) hut.ran) lat.ran (~(uni by lat.rang) lat.ran) == + :: assert desk kelvin matches kernel kelvin, except on %base + :: + ?> ?: =(%base syd) & + .= zuse/zuse + ?- -.yoki + %& =/ fil (~(got by q.p.yoki) /sys/kelvin) + ?- -.fil + %& q.p.fil + %| + == + %| + == =/ new-data=(map path (each page lobe)) ?- -.yoki %& q.p.yoki From 8c3d14b7a73673eec0e9db07571cf0ea483cd644 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Mon, 28 Jun 2021 21:22:55 -0400 Subject: [PATCH 010/595] clay: check kelvin on non-%base desks --- pkg/arvo/sys/vane/clay.hoon | 47 +++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index a7ba3591e..79b15cadc 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -1509,23 +1509,17 @@ =: hut.ran (~(uni by hut.rang) hut.ran) lat.ran (~(uni by lat.rang) lat.ran) == - :: assert desk kelvin matches kernel kelvin, except on %base - :: - ?> ?: =(%base syd) & - .= zuse/zuse - ?- -.yoki - %& =/ fil (~(got by q.p.yoki) /sys/kelvin) - ?- -.fil - %& q.p.fil - %| - == - %| - == =/ new-data=(map path (each page lobe)) ?- -.yoki %& q.p.yoki %| (~(run by q.p.yoki) |=(=lobe |+lobe)) == + :: find desk kelvin + :: + =/ kel=[@tas @ud] (get-kelvin yoki) + ?. |(=(%base syd) =(kel [%zuse zuse])) + ~>(%mean.|.(leaf/"clay: bad-kelvin, {<[need=zuse/zuse have=kel]>}") !!) + :: =/ old-yaki ?: =(0 let.dom) *yaki @@ -1596,6 +1590,35 @@ :: wake:(ergo mim) :: + :: +get-kelvin: read the desk's kernel version from /sys/kelvin + :: + ++ get-kelvin + |= =yoki + ;; [@tas @ud] + |^ ?- -.yoki + %| + %- lobe-to-noun + ~> %mean.'clay: missing /sys/kelvin' + (~(got by q.p.yoki) /sys/kelvin) + :: + %& + =/ fil=(each page lobe) + ~> %mean.'clay: missing /sys/kelvin' + (~(got by q.p.yoki) /sys/kelvin) + ?- -.fil + %& q.p.fil + %| (lobe-to-noun p.fil) + == + == + ++ lobe-to-noun + |= =lobe + =/ bob (lobe-to-blob:ze lobe) + ?- -.bob + %direct q.q.bob + %delta q.r.bob + == + -- + :: :: Find which files changed or were deleted :: ++ get-changes From 784004cfb638368ca6758cce365374daebdaac08 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Wed, 30 Jun 2021 21:03:47 -0400 Subject: [PATCH 011/595] kiln: +install compiles and loads, untested --- pkg/arvo/app/hood.hoon | 3 +- pkg/arvo/lib/hood/kiln.hoon | 520 +++++++++++++++++++++++------------- pkg/arvo/sys/vane/clay.hoon | 40 +-- pkg/arvo/sys/zuse.hoon | 28 ++ 4 files changed, 376 insertions(+), 215 deletions(-) diff --git a/pkg/arvo/app/hood.hoon b/pkg/arvo/app/hood.hoon index b7dde9798..689e43d0b 100644 --- a/pkg/arvo/app/hood.hoon +++ b/pkg/arvo/app/hood.hoon @@ -2,7 +2,7 @@ /+ drum=hood-drum, helm=hood-helm, kiln=hood-kiln |% +$ state - $: %14 + $: %15 drum=state:drum helm=state:helm kiln=state:kiln @@ -17,6 +17,7 @@ [%11 drum=state-2:drum helm=state:helm kiln=state:kiln] [%12 drum=state-2:drum helm=state:helm kiln=state:kiln] [%13 drum=state-2:drum helm=state:helm kiln=state:kiln] + [%14 drum=state:drum helm=state:helm kiln=state-1:kiln] == +$ any-state-tuple $: drum=any-state:drum diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 79b07a668..6b29aeb75 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -3,11 +3,22 @@ =, space:userlib =, format |% -+$ state [%1 pith-1] ++$ state [%2 pith-2] ++$ state-2 state ++$ state-1 [%1 pith-1] ++$ state-0 [%0 pith-0] +$ any-state - $% state - [%0 pith-0] + $% state-2 + state-1 + state-0 == ++$ pith-2 :: + $: rem=(map desk per-desk) :: + syn=(map kiln-sync let=@ud) :: + ota=(unit [=ship =desk =aeon]) :: + ark=(map desk arak) :: + commit-timer=[way=wire nex=@da tim=@dr mon=term] :: + == :: +$ pith-1 :: $: rem=(map desk per-desk) :: syn=(map kiln-sync let=@ud) :: @@ -24,6 +35,14 @@ cur-vanes=(map @tas @uvI) :: commit-timer=[way=wire nex=@da tim=@dr mon=term] :: == +:: $arak: foreign vat tracker +:: ++$ arak + $: =ship + =desk + =aeon + next=(list [=aeon kelvin=[@tas @ud]]) + == +$ per-desk :: per-desk state $: auto=? :: escalate on failure gem=?(%this %that germ) :: strategy @@ -98,17 +117,27 @@ `[syd her sud]:i.syncs $(syncs t.syncs) :: - =. +<+.$.abet - =- old(- %1, |3 [ota=~ commit-timer.old], syn -) + =/ sen=(map kiln-sync let=@ud) ?~ recognized-ota - syn - (~(del by syn) [syd her sud]:u.recognized-ota) + syn.old + (~(del by syn.old) [syd her sud]:u.recognized-ota) + :: note that the new state has not yet been initialized :: =? ..abet ?=(^ recognized-ota) - (poke-internal:update `[her sud]:u.recognized-ota) - +(old +<+.$.abet) + (poke:update `[her sud]:u.recognized-ota) + :: + +>(old [%1 rem.old syn=sen ota=~ commit-timer.old]) :: - ?> ?=(%1 -.old) + =? old ?=(%1 -.old) + :* %2 + rem.old + syn.old + ota.old + ark=~ + commit-timer.old + == + :: + ?> ?=(%2 -.old) =. +<+.$.abet old ..abet :: @@ -123,67 +152,164 @@ ``noun+!>(?~(ver 0v0 i.ver)) == :: -++ poke-commit - |= [mon=kiln-commit auto=?] - =< abet - =. +>.$ (emit %pass /commit %arvo %c [%dirk mon]) - ?. auto - +>.$ - =/ recur ~s1 - =. commit-timer - [/kiln/autocommit (add now recur) recur mon] - (emit %pass way.commit-timer %arvo %b [%wait nex.commit-timer]) +++ vats + |_ [loc=desk rak=arak] + :: + ++ abet ..vats(ark (~(put by ark) loc rak)) + ++ abed + |= lac=desk + ~_ leaf/"kiln: {} not installed" + ..abet(loc lac, rak (~(got by ark) lac)) + :: + ++ emit |=(card:agent:gall ..abet(..vats (^emit +<))) + ++ emil |=((list card:agent:gall) ..abet(..vats (^emil +<))) + ++ here "{} from {<[ship desk]:rak>}" + ++ make-wire |=(step=@tas /kiln/vats/[loc]/[step]) + ++ from-wire + |= =wire + ?> ?=([%kiln %vats @ @ ~] wire) + (abed i.t.t.wire) + :: + ++ uninstall + |= lac=desk + ^+ ..vats + =. ..abet (abed lac) + ~> %slog.0^leaf/"kiln: uninstalling {here}" + :: TODO: ask gall to doze + ..vats(ark (~(del by ark) lac)) + :: + ++ install + |= [lac=desk her=ship rem=desk] + ^+ ..abet + :: TODO: check if same args, then make idempotent + =? ..vats (~(has by ark) lac) (uninstall lac) + =: loc lac + rak [her rem *aeon next=~] + == + ~> %slog.0^leaf/"kiln: beginning install into {here}" + %: emit + %pass (make-wire %find) %arvo %c + %warp ship.rak desk.rak `[%sing %y ud+1 /] + == + :: + ++ take + |= [=wire syn=sign-arvo] + ^+ ..abet + =. ..abet (from-wire wire) + ?> ?=([%kiln %vats @ @ ~] wire) + ?+ i.t.t.t.wire + ~> %slog.0^leaf/"kiln: vats-bad-take {}" + ..abet + %find (take-find syn) + %sync (take-sync syn) + %download (take-download syn) + %merge (take-merge syn) + == + :: + ++ take-find + |= syn=sign-arvo + ?> ?=(%writ +<.syn) + ~> %slog.0^leaf/"kiln: activated install into {here}" + %: emit + %pass (make-wire %sync) %arvo %c + %warp ship.rak desk.rak `[%sing %w da+now /] + == + :: + ++ take-sync + |= syn=sign-arvo + ?> ?=(%writ +<.syn) + ?~ p.syn + ~> %slog.0^leaf/"kiln: cancelled (1) install into {here}, retrying" + (install loc [ship desk]:rak) :: TODO reset aeon? + ~> %slog.0^leaf/"kiln: downloading update for {here}" + =? aeon.rak ?=(%w p.p.u.p.syn) ud:;;(cass:clay q.q.r.u.p.syn) + %: emit + %pass (make-wire %download) %arvo %c + %warp ship.rak desk.rak `[%sing %v ud+aeon.rak /] + == + :: + ++ take-download + |= syn=sign-arvo + ?> ?=(%writ +<.syn) + ?~ p.syn + ~> %slog.0^leaf/"kiln: cancelled (2) install into {here}, retrying" + (install loc [ship desk]:rak) :: TODO reset aeon? + ~> %slog.0^leaf/"kiln: finished downloading update for {here}" + :: TODO: check kelvin here + =. aeon.rak +(aeon.rak) + =/ =germ (get-germ loc) + ~> %slog.0^leaf/"kiln: merging into {here}" + %- emil + :~ :* %pass (make-wire %merge) %arvo %c + %merg loc ship.rak desk.rak ud+(dec aeon.rak) germ + == + :* %pass (make-wire %sync) %arvo %c + %warp ship.rak desk.rak `[%sing %z ud+aeon.rak /] + == == + :: + ++ take-merge + |= syn=sign-arvo + ?> ?=(%mere +<.syn) + ?: ?=([%| %ali-unavailable *] p.syn) + %- %+ slog + :- %leaf + "kiln: merge into {here} failed, maybe because sunk; restarting" + p.p.syn + (install loc [ship desk]:rak) :: TODO reset aeon? + ?: ?=(%| -.p.syn) + %- %+ slog + :- %leaf + "kiln: merge into {here} failed, waiting for next revision" + p.p.syn + ..abet + :: + ~> %slog.0^leaf/"merge into {here} succeeded" + ..abet + -- +:: +get-germ: select merge strategy into local desk :: -++ poke-autocommit - |= [mon=kiln-commit auto=?] - =< abet - =. +>.$ (emit %pass /commit %arvo %c [%dirk mon]) - ?. auto - +>.$ - =/ recur ~s1 - =. commit-timer - [/kiln/autocommit (add now recur) recur mon] - (emit %pass way.commit-timer %arvo %b [%wait nex.commit-timer]) +:: If destination desk doesn't exist, need a %init merge. If this is +:: its first revision, it probably doesn't have a mergebase yet, so +:: use %take-that. :: -++ poke-cancel-autocommit - |= ~ - abet:(emit %pass way.commit-timer %arvo %b [%rest nex.commit-timer]) -:: -++ poke-mount - |= kiln-mount - =+ bem=(de-beam pax) - ?~ bem - =+ "can't mount bad path: {}" - abet:(spam leaf+- ~) - abet:(emit %pass /mount %arvo %c [%mont pot u.bem]) -:: -++ poke-unmount - |= mon=kiln-unmount - ?^ mon - =+ bem=(de-beam mon) - ?~ bem - =+ "can't unmount bad path: {}" - abet:(spam leaf+- ~) - abet:(emit %pass /unmount-beam %arvo %c [%ogre [[p q r] s]:u.bem]) - abet:(emit %pass /unmount-point %arvo %c [%ogre mon]) -:: -++ poke-track :: - |= hos=kiln-sync - ?: (~(has by syn) hos) - abet:(spam (render "already tracking" [sud her syd]:hos) ~) - abet:abet:start-track:(auto hos) +++ get-germ + |= =desk + =+ .^(=cass:clay %cw /(scot %p our)/[desk]/(scot %da now)) + ?- ud.cass + %0 %init + %1 %take-that + * %mate + == :: ++ update |% + ++ poke + |= arg=(unit [=ship =desk]) + ^+ ..abet + =? ..abet =(arg (bind ota |=([=ship =desk =aeon] [ship desk]))) + (render "restarting OTA sync" ~) + =? ..abet ?=(^ ota) + =. ..abet (render-ket "cancelling OTA sync" ~) + ..abet(ota ~) + ?~ arg + ..abet + =. ota `[ship.u.arg desk.u.arg *aeon] + =. ..abet (render "starting OTA sync" ~) + %: emit + %pass (make-wire /find) %arvo %c + %warp ship.u.arg desk.u.arg `[%sing %y ud+1 /] + == + :: ++ make-wire |= =path + ^- wire ?> ?=(^ ota) - %- welp - :_ path + %- welp :_ path /kiln/ota/(scot %p ship.u.ota)/[desk.u.ota]/(scot %ud aeon.u.ota) :: ++ check-ota |= =wire + ^- ? ?~ ota | ?& ?=([@ @ @ *] wire) @@ -214,40 +340,6 @@ ~ [>p.u.error< q.u.error] :: - :: If destination desk doesn't exist, need a %init merge. If this is - :: its first revision, it probably doesn't have a mergebase yet, so - :: use %take-that. - :: - ++ get-germ - |= =desk - =+ .^(=cass:clay %cw /(scot %p our)/[desk]/(scot %da now)) - ?- ud.cass - %0 %init - %1 %take-that - * %mate - == - :: - ++ poke - |= arg=(unit [=ship =desk]) - abet:(poke-internal arg) - :: - ++ poke-internal - |= arg=(unit [=ship =desk]) - ^+ ..abet - =? ..abet =(arg (bind ota |=([=ship =desk =aeon] [ship desk]))) - (render "restarting OTA sync" ~) - =? ..abet ?=(^ ota) - =. ..abet (render-ket "cancelling OTA sync" ~) - ..abet(ota ~) - ?~ arg - ..abet - =. ota `[ship.u.arg desk.u.arg *aeon] - =. ..abet (render "starting OTA sync" ~) - %: emit - %pass (make-wire /find) %arvo %c - %warp ship.u.arg desk.u.arg `[%sing %y ud+1 /] - == - :: ++ take |= [=wire =sign-arvo] ^+ ..abet @@ -280,7 +372,7 @@ ?> ?=(^ ota) ?~ p.sign-arvo =. ..abet (render-ket "OTA cancelled (1), retrying" ~) - (poke-internal `[ship desk]:u.ota) + (poke `[ship desk]:u.ota) =. ..abet (render-ket "downloading OTA update" ~) =? aeon.u.ota ?=(%w p.p.u.p.sign-arvo) ud:;;(cass:clay q.q.r.u.p.sign-arvo) @@ -296,7 +388,7 @@ ?> ?=(^ ota) ?~ p.sign-arvo =. ..abet (render-ket "OTA cancelled (2), retrying" ~) - (poke-internal `[ship desk]:u.ota) + (poke `[ship desk]:u.ota) =. ..abet (render-ket "finished downloading OTA" ~) =. aeon.u.ota +(aeon.u.ota) =/ =germ (get-germ %home) @@ -318,7 +410,7 @@ =. ..abet =/ =tape "OTA to %home failed, maybe because sunk; restarting" (render-ket tape `p.p.sign-arvo) - (poke-internal `[ship desk]:u.ota) + (poke `[ship desk]:u.ota) :: ?: ?=(%| -.p.sign-arvo) =/ =tape "OTA to %home failed, waiting for next revision" @@ -339,7 +431,7 @@ =. ..abet =/ =tape "OTA to %kids failed, maybe because sunk; restarting" (render-ket tape `p.p.sign-arvo) - (poke-internal `[ship desk]:u.ota) + (poke `[ship desk]:u.ota) :: ?- -.p.sign-arvo %& (render-ket "OTA to %kids succeeded" ~) @@ -347,54 +439,76 @@ == -- :: -++ poke-sync :: - |= hos=kiln-sync - ?: (~(has by syn) hos) - abet:(spam (render "already syncing" [sud her syd]:hos) ~) - abet:abet:start-sync:(auto hos) -:: -++ ota-info - ?~ ota - "OTAs disabled" - "OTAs enabled from {} on {}" -:: -++ poke-ota-info - |= * - =< abet %- spam - :~ [%leaf ota-info] - [%leaf "use |ota %disable or |ota ~sponsor %kids to reset it"] +++ poke + |= [=mark =vase] + ?+ mark ~|([%poke-kiln-bad-mark mark] !!) + %kiln-autocommit =;(f (f !<(_+<.f vase)) poke-autocommit) + %kiln-cancel =;(f (f !<(_+<.f vase)) poke-cancel) + %kiln-cancel-autocommit =;(f (f !<(_+<.f vase)) poke-cancel-autocommit) + %kiln-commit =;(f (f !<(_+<.f vase)) poke-commit) + %kiln-fuse =;(f (f !<(_+<.f vase)) poke-fuse) + %kiln-gall-sear =;(f (f !<(_+<.f vase)) poke-gall-sear) + %kiln-goad-gall =;(f (f !<(_+<.f vase)) poke-goad-gall) + %kiln-info =;(f (f !<(_+<.f vase)) poke-info) + %kiln-install =;(f (f !<(_+<.f vase)) poke-install) + %kiln-label =;(f (f !<(_+<.f vase)) poke-label) + %kiln-merge =;(f (f !<(_+<.f vase)) poke-merge) + %kiln-mount =;(f (f !<(_+<.f vase)) poke-mount) + %kiln-ota =;(f (f !<(_+<.f vase)) poke-ota) + %kiln-ota-info =;(f (f !<(_+<.f vase)) poke-ota-info) + %kiln-permission =;(f (f !<(_+<.f vase)) poke-permission) + %kiln-rm =;(f (f !<(_+<.f vase)) poke-rm) + %kiln-schedule =;(f (f !<(_+<.f vase)) poke-schedule) + %kiln-sync =;(f (f !<(_+<.f vase)) poke-sync) + %kiln-syncs =;(f (f !<(_+<.f vase)) poke-syncs) + %kiln-track =;(f (f !<(_+<.f vase)) poke-track) + %kiln-uninstall =;(f (f !<(_+<.f vase)) poke-uninstall) + %kiln-unmount =;(f (f !<(_+<.f vase)) poke-unmount) + %kiln-unsync =;(f (f !<(_+<.f vase)) poke-unsync) == :: -++ poke-syncs :: print sync config +++ poke-autocommit + |= [mon=kiln-commit auto=?] + =< abet + =. +>.$ (emit %pass /commit %arvo %c [%dirk mon]) + ?. auto + +>.$ + =/ recur ~s1 + =. commit-timer + [/kiln/autocommit (add now recur) recur mon] + (emit %pass way.commit-timer %arvo %b [%wait nex.commit-timer]) +:: +++ poke-cancel + |= a=@tas + abet:(emit %pass /cancel %arvo %c [%drop a]) +:: +++ poke-cancel-autocommit |= ~ - =< abet %- spam - :- [%leaf ota-info] - ?: =(0 ~(wyt by syn)) - [%leaf "no other syncs configured"]~ - %+ turn ~(tap in ~(key by syn)) - |=(a=kiln-sync (render "sync configured" [sud her syd]:a)) + abet:(emit %pass way.commit-timer %arvo %b [%rest nex.commit-timer]) :: -++ poke-unsync :: - |= hus=kiln-unsync - ?. (~(has by syn) hus) - abet:(spam (render "not syncing" [sud her syd]:hus) ~) - %* . abet:abet:stop:(auto hus) - syn (~(del by syn) hus) - == -:: -++ poke-merge :: - |= kiln-merge - ?~ +< abet - abet:abet:(merge:(work syd) ali sud cas gim) +++ poke-commit + |= [mon=kiln-commit auto=?] + =< abet + =. +>.$ (emit %pass /commit %arvo %c [%dirk mon]) + ?. auto + +>.$ + =/ recur ~s1 + =. commit-timer + [/kiln/autocommit (add now recur) recur mon] + (emit %pass way.commit-timer %arvo %b [%wait nex.commit-timer]) :: ++ poke-fuse |= k=kiln-fuse ?~ k abet abet:(emit [%pass /kiln/fuse/[syd.k] %arvo %c [%fuse syd.k bas.k con.k]]) :: -++ poke-cancel - |= a=@tas - abet:(emit %pass /cancel %arvo %c [%drop a]) +++ poke-gall-sear + |= =ship + abet:(emit %pass /kiln %arvo %g %sear ship) +:: +++ poke-goad-gall + |= [force=? agent=(unit dude:gall)] + abet:(emit %pass /kiln %arvo %g %goad force agent) :: ++ poke-info |= [mez=tape tor=(unit toro)] @@ -402,6 +516,46 @@ abet:(spam leaf+mez ~) abet:(emit:(spam leaf+mez ~) %pass /kiln %arvo %c [%info u.tor]) :: +++ poke-install + |= [loc=desk her=ship rem=desk] + abet:abet:(install:vats +<) +:: +++ poke-label + |= [syd=desk lab=@tas] + =+ pax=/(scot %p our)/[syd]/[lab] + (poke-info "labeled {(spud pax)}" `[syd %| lab]) +:: +++ poke-merge + |= kiln-merge + ?~ +< abet + abet:abet:(merge:(work syd) ali sud cas gim) +:: +++ poke-mount + |= kiln-mount + =+ bem=(de-beam pax) + ?~ bem + =+ "can't mount bad path: {}" + abet:(spam leaf+- ~) + abet:(emit %pass /mount %arvo %c [%mont pot u.bem]) +:: +++ poke-ota + |= arg=(unit [=ship =desk]) + abet:(poke:update arg) +:: +++ poke-ota-info + |= * + =< abet %- spam + :~ [%leaf get-ota-info] + [%leaf "use |ota %disable or |ota ~sponsor %kids to reset it"] + == +:: +++ poke-permission + |= [syd=desk pax=path pub=?] + =< abet + %- emit + =/ =rite [%r ~ ?:(pub %black %white) ~] + [%pass /kiln/permission %arvo %c [%perm syd pax rite]] +:: ++ poke-rm |= a=path =+ b=.^(arch %cy a) @@ -410,11 +564,6 @@ abet:(spam -) (poke-info "removed" `(fray a)) :: -++ poke-label - |= [syd=desk lab=@tas] - =+ pax=/(scot %p our)/[syd]/[lab] - (poke-info "labeled {(spud pax)}" `[syd %| lab]) -:: ++ poke-schedule |= [where=path tym=@da eve=@t] =. where (welp where /sched) @@ -422,51 +571,53 @@ =+ old=;;((map @da cord) (fall (file where) ~)) `(foal where %sched !>((~(put by old) tym eve))) :: -++ poke-permission - |= [syd=desk pax=path pub=?] - =< abet - %- emit - =/ =rite [%r ~ ?:(pub %black %white) ~] - [%pass /kiln/permission %arvo %c [%perm syd pax rite]] +++ poke-sync + |= hos=kiln-sync + ?: (~(has by syn) hos) + abet:(spam (render "already syncing" [sud her syd]:hos) ~) + abet:abet:start-sync:(auto hos) :: -++ poke - |= [=mark =vase] - ?+ mark ~|([%poke-kiln-bad-mark mark] !!) - %kiln-autocommit =;(f (f !<(_+<.f vase)) poke-autocommit) - %kiln-cancel =;(f (f !<(_+<.f vase)) poke-cancel) - %kiln-cancel-autocommit =;(f (f !<(_+<.f vase)) poke-cancel-autocommit) - %kiln-commit =;(f (f !<(_+<.f vase)) poke-commit) - %kiln-gall-sear =;(f (f !<(_+<.f vase)) poke-gall-sear) - %kiln-goad-gall =;(f (f !<(_+<.f vase)) poke-goad-gall) - %kiln-info =;(f (f !<(_+<.f vase)) poke-info) - %kiln-label =;(f (f !<(_+<.f vase)) poke-label) - %kiln-merge =;(f (f !<(_+<.f vase)) poke-merge) - %kiln-fuse =;(f (f !<(_+<.f vase)) poke-fuse) - %kiln-mount =;(f (f !<(_+<.f vase)) poke-mount) - %kiln-ota =;(f (f !<(_+<.f vase)) poke:update) - %kiln-ota-info =;(f (f !<(_+<.f vase)) poke-ota-info) - %kiln-permission =;(f (f !<(_+<.f vase)) poke-permission) - %kiln-rm =;(f (f !<(_+<.f vase)) poke-rm) - %kiln-schedule =;(f (f !<(_+<.f vase)) poke-schedule) - %kiln-sync =;(f (f !<(_+<.f vase)) poke-sync) - %kiln-syncs =;(f (f !<(_+<.f vase)) poke-syncs) - %kiln-track =;(f (f !<(_+<.f vase)) poke-track) - %kiln-unmount =;(f (f !<(_+<.f vase)) poke-unmount) - %kiln-unsync =;(f (f !<(_+<.f vase)) poke-unsync) +++ poke-syncs :: print sync config + |= ~ + =< abet %- spam + :- [%leaf get-ota-info] + ?: =(0 ~(wyt by syn)) + [%leaf "no other syncs configured"]~ + %+ turn ~(tap in ~(key by syn)) + |=(a=kiln-sync (render "sync configured" [sud her syd]:a)) +:: +++ poke-track + |= hos=kiln-sync + ?: (~(has by syn) hos) + abet:(spam (render "already tracking" [sud her syd]:hos) ~) + abet:abet:start-track:(auto hos) +:: +++ poke-uninstall + |= loc=desk + abet:(uninstall:vats +<) +:: +++ poke-unmount + |= mon=kiln-unmount + ?^ mon + =+ bem=(de-beam mon) + ?~ bem + =+ "can't unmount bad path: {}" + abet:(spam leaf+- ~) + abet:(emit %pass /unmount-beam %arvo %c [%ogre [[p q r] s]:u.bem]) + abet:(emit %pass /unmount-point %arvo %c [%ogre mon]) +:: +++ poke-unsync + |= hus=kiln-unsync + ?. (~(has by syn) hus) + abet:(spam (render "not syncing" [sud her syd]:hus) ~) + %* . abet:abet:stop:(auto hus) + syn (~(del by syn) hus) == :: -++ poke-goad-gall - |= [force=? agent=(unit dude:gall)] - abet:(emit %pass /kiln %arvo %g %goad force agent) -:: -++ poke-gall-sear - |= =ship - abet:(emit %pass /kiln %arvo %g %sear ship) -:: -++ done - |= [way=wire saw=(unit error:ames)] - ~? ?=(^ saw) [%kiln-nack u.saw] - abet +++ get-ota-info + ?~ ota + "OTAs disabled" + "OTAs enabled from {} on {}" :: ++ take-agent |= [=wire =sign:agent:gall] @@ -499,6 +650,11 @@ == == ++ take |=(way=wire ?>(?=([@ ~] way) (work i.way))) :: general handler +++ done + |= [way=wire saw=(unit error:ames)] + ~? ?=(^ saw) [%kiln-nack u.saw] + abet +:: ++ take-mere :: |= [way=wire are=(each (set path) (pair term tang))] ?. ?=([@ ~] way) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 79b15cadc..bc67d9190 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -422,30 +422,13 @@ [ducts (print-wove wove)] :: ++ fusion - => |% - :: +an: $ankh interface door + :: +wrap: external wrapper + :: + ++ wrap + |* [* state:ford] + [+<- +<+>-] :: cache.state :: - ++ an - |_ nak=ankh - :: +dug: produce ankh at path - :: - ++ dug - |= =path - ^- (unit ankh) - ?~ path `nak - ?~ kid=(~(get by dir.nak) i.path) - ~ - $(nak u.kid, path t.path) - :: +get: produce file at path - :: - ++ get - |= =path - ^- (unit cage) - ?~ nik=(dug path) ~ - ?~ fil.u.nik ~ - `q.u.fil.u.nik - -- ++ with-face |=([face=@tas =vase] vase(p [%face face p.vase])) ++ with-faces =| res=(unit vase) @@ -455,13 +438,6 @@ =/ faz (with-face i.vaz) =. res `?~(res faz (slop faz u.res)) $(vaz t.vaz) - -- - |% - :: +wrap: external wrapper - :: - ++ wrap - |* [* state:ford] - [+<- +<+>-] :: cache.state :: ++ ford !. @@ -527,7 +503,7 @@ [cage nub] ?< (~(has in deletes) path) ~| %file-not-found^path - :_(nub (need (~(get an ankh) path))) + :_(nub (need (~(get an:cloy ankh) path))) :: +build-nave: build a statically typed mark core :: ++ build-nave @@ -844,7 +820,7 @@ |= =path ^- [(map @ta vase) state] =/ fiz=(list @ta) - =/ nuk=(unit _ankh) (~(dug an ankh) path) + =/ nuk=(unit _ankh) (~(dug an:cloy ankh) path) ?~ nuk ~ %+ murn ~(tap by dir.u.nuk) @@ -1042,7 +1018,7 @@ $(paz t.paz) ?: (~(has by changes) pux) pux - ?^ (~(get an ankh) pux) + ?^ (~(get an:cloy ankh) pux) pux $(paz t.paz) -- diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 0d934380b..4bb3221f8 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -3729,6 +3729,34 @@ (some (~(run by lum) need)) -- ::dejs-soft -- +:: |cloy: clay helpers +:: +++ cloy + =, clay + |% + :: +an: $ankh interface door + :: + ++ an + |_ nak=ankh + :: +dug: produce ankh at path + :: + ++ dug + |= =path + ^- (unit ankh) + ?~ path `nak + ?~ kid=(~(get by dir.nak) i.path) + ~ + $(nak u.kid, path t.path) + :: +get: produce file at path + :: + ++ get + |= =path + ^- (unit cage) + ?~ nik=(dug path) ~ + ?~ fil.u.nik ~ + `q.u.fil.u.nik + -- + -- :: :: :::: ++differ :: (2d) hunt-mcilroy :: :::: From 1e07e347ff263781ea8c597f62ac0c21055ae2f1 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Thu, 1 Jul 2021 19:10:03 -0400 Subject: [PATCH 012/595] kiln: make |install idempotent --- pkg/arvo/lib/hood/kiln.hoon | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 6b29aeb75..2df03a10f 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -181,8 +181,11 @@ ++ install |= [lac=desk her=ship rem=desk] ^+ ..abet - :: TODO: check if same args, then make idempotent - =? ..vats (~(has by ark) lac) (uninstall lac) + =/ got (~(get by ark) lac) + ?: =(`[her rem] got) + ~> %slog.0^leaf/"kiln: already tracking {here:(abed lac)}, ignoring" + ..abet + =? ..vats ?=(^ got) (uninstall lac) =: loc lac rak [her rem *aeon next=~] == From 82581ae993e12277abab27fa43d11fe8dc2f6171 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Thu, 1 Jul 2021 20:33:43 -0400 Subject: [PATCH 013/595] gall: %e scry to list apps on a desk --- pkg/arvo/sys/vane/gall.hoon | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index f881b0b69..55423605b 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -1775,6 +1775,20 @@ [~ ~] [~ ~ desk+!>(q.beak.u.yok)] :: + ?: ?& =(%e care) + =(~ path) + =([%$ %da now] coin) + =(our ship) + == + :+ ~ ~ + :- %apps !> ^- (set dude) + =* syd=desk dap + %+ roll ~(tap by yokes.state) + |= [[=dude =yoke] acc=(set dude)] + ?. =(syd q.beak.yoke) + acc + (~(put in acc) dude) + :: ?. =(our ship) ~ ?. =([%$ %da now] coin) From bfb9419d22f762982a662f4548d59cffe69e0e62 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Thu, 1 Jul 2021 20:34:17 -0400 Subject: [PATCH 014/595] kiln: tell gall to fade apps on uninstall --- pkg/arvo/lib/hood/kiln.hoon | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 2df03a10f..54a9c3b66 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -175,7 +175,12 @@ ^+ ..vats =. ..abet (abed lac) ~> %slog.0^leaf/"kiln: uninstalling {here}" - :: TODO: ask gall to doze + =. ..abet + %- emil + %+ turn (get-apps lac) + |= =dude:gall + [%pass /kiln/vats/uninstall %arvo %g %fade dude %idle] + :: ..vats(ark (~(del by ark) lac)) :: ++ install @@ -269,6 +274,15 @@ ~> %slog.0^leaf/"merge into {here} succeeded" ..abet -- +:: +get-apps: find which apps Gall is running on a desk +:: +:: TODO: move to zuse? +:: +++ get-apps + |= =desk + ^- (list dude:gall) + %~ tap in + .^((set dude:gall) ge+/(scot %p our)/[desk]/(scot %da now)) :: +get-germ: select merge strategy into local desk :: :: If destination desk doesn't exist, need a %init merge. If this is From 6a1cbf8894e221dbd9ea5a02c3678d5028b15a37 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 2 Jul 2021 17:40:55 -0400 Subject: [PATCH 015/595] arvo: kelvin version type --- pkg/arvo/sys/arvo.hoon | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/pkg/arvo/sys/arvo.hoon b/pkg/arvo/sys/arvo.hoon index b9f9e1fde..67f0c158b 100644 --- a/pkg/arvo/sys/arvo.hoon +++ b/pkg/arvo/sys/arvo.hoon @@ -165,6 +165,7 @@ :: $vile: reflexive constants :: $waif: arvo task, from anywhere :: $wasp: arvo task, from Outside +:: $weft: kelvin version, tag and number :: $worm: compiler cache :: $wisp: arvo task, larval stage :: $wynn: kelvin stack @@ -269,6 +270,7 @@ [%wack p=@uvJ] [%wyrd p=vere] == ++$ weft [lal=@tas num=@ud] +$ worm $: :: +nest, +play, and +mint :: @@ -281,7 +283,7 @@ $>(?(%wack %wyrd) wasp) [%whom p=ship] == -+$ wynn (list (pair term @ud)) ++$ wynn (list weft) -- => :: ~% %hex ..ut ~ @@ -364,10 +366,10 @@ |= kel=wynn ^- ? ?: =(~ kel) & - =^ las=(pair term @ud) kel kel + =^ las=weft kel kel |- ^- ? ?~ kel & - ?& (gte q.las q.i.kel) + ?& (gte num.las num.i.kel) $(las i.kel, kel t.kel) == :: +need: require kelvins @@ -384,7 +386,7 @@ ~_ :+ %rose [" " ~ ~] :~ =+ p.u.wyr - leaf/"%{(trip p)} %{(scow %ud q)} required;" + leaf/"%{(trip lal)} %{(scow %ud num)} required;" ?~ q.u.wyr leaf/"runtime missing support" leaf/"runtime only supports %{(scow %ud u.q.u.wyr)}" @@ -393,20 +395,20 @@ ~> %mean.'wyrd' !! :: - |- ^- (unit (pair (pair term @ud) (unit @ud))) + |- ^- (unit (pair weft (unit @ud))) ?~ hav ~ :: :: fel: %&: runtime kelvin for [i.hav] :: %|: no specified runtime support :: =/ fel - |- ^- (each @ud (pair term @ud)) + |- ^- (each @ud weft) ?~ run |/i.hav - ?:(=(p.i.hav p.i.run) &/q.i.run $(run t.run)) + ?:(=(lal.i.hav lal.i.run) &/num.i.run $(run t.run)) :: ?- -.fel %| `[p.fel ~] - %& ?.((lte p.fel q.i.hav) `[i.hav `p.fel] $(hav t.hav)) + %& ?.((lte p.fel num.i.hav) `[i.hav `p.fel] $(hav t.hav)) == -- :: @@ -1539,7 +1541,7 @@ %wyrd ?. (sane:wyrd kel.p.buz) ~>(%mean.'wyrd: insane' !!) %- %+ need:wyrd kel.p.buz - ^- (list (pair term @)) + ^- wynn :~ hoon/hoon-version arvo/arvo lull/;;(@ud q:(slap lul.mod limb/%lull)) @@ -1707,7 +1709,7 @@ =. van.mod (~(run by van.mod) |=(=vane vane(worm *worm))) :: %- %+ need:wyrd kel.ver.zen - ^- (list (pair term @)) + ^- wynn :~ hoon/hoon-version arvo/arvo lull/;;(@ud q:(slap lul.mod limb/%lull)) @@ -1799,7 +1801,7 @@ =/ lul $:u.lul =/ zus $:u.zus %- %+ need:wyrd kel.u.ver - ^- (list (pair term @)) + ^- wynn :~ hoon/hoon-version arvo/arvo lull/;;(@ud q:(slap lul limb/%lull)) @@ -1886,7 +1888,7 @@ %wyrd ?. (sane:wyrd kel.p.wip) ~>(%mean.'wyrd: insane' !!) %- %+ need:wyrd kel.p.wip - ^- (list (pair term @)) + ^- wynn :* hoon/hoon-version arvo/arvo ?~ lul ~ From e8dc993d8404ad4e5032f04b9e983b715ad42bea Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 2 Jul 2021 17:41:21 -0400 Subject: [PATCH 016/595] kiln: initial kelvin check support compiles --- pkg/arvo/lib/hood/kiln.hoon | 108 ++++++++++++++++++++++++++---------- 1 file changed, 80 insertions(+), 28 deletions(-) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 54a9c3b66..6584d68a0 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -41,7 +41,7 @@ $: =ship =desk =aeon - next=(list [=aeon kelvin=[@tas @ud]]) + next=(list [=aeon =weft]) == +$ per-desk :: per-desk state $: auto=? :: escalate on failure @@ -169,8 +169,9 @@ |= =wire ?> ?=([%kiln %vats @ @ ~] wire) (abed i.t.t.wire) + :: +uninstall: stop tracking apps on desk, and suspend apps :: - ++ uninstall + ++ uninstall |= lac=desk ^+ ..vats =. ..abet (abed lac) @@ -182,6 +183,7 @@ [%pass /kiln/vats/uninstall %arvo %g %fade dude %idle] :: ..vats(ark (~(del by ark) lac)) + :: +install: set up desk sync to .lac to install all apps from [her rem] :: ++ install |= [lac=desk her=ship rem=desk] @@ -195,10 +197,41 @@ rak [her rem *aeon next=~] == ~> %slog.0^leaf/"kiln: beginning install into {here}" - %: emit - %pass (make-wire %find) %arvo %c - %warp ship.rak desk.rak `[%sing %y ud+1 /] - == + (emit find:pass) + :: +reset: resync after failure + :: + ++ reset + ^+ ..abet + =. ark (~(del by ark) loc) + (install loc [ship desk]:rak) + :: +get-blockers: find desks that would block a kernel update + :: + ++ get-blockers + |= kel=weft + ^- (set desk) + %- ~(gas in *(set desk)) + %+ murn ~(tap by ark) + |= [=desk =arak] + ?: (lien next.arak |=([* k=weft] =(k kel))) + ~ + `desk + :: +bump: handle kernel kelvin upgrade + :: + :: Apply merges and revive faded agents on all paused desks. + :: + ++ bump + |= except=(set desk) + ^+ ..vats + =/ kel=weft [%zuse zuse] + =/ 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))) + =< ..vats + |- ^+ ..abet + ?~ liv ..abet + $(liv t.liv, ..abet (emit merge:pass(loc p.i.liv, rak q.i.liv))) :: ++ take |= [=wire syn=sign-arvo] @@ -218,42 +251,33 @@ |= syn=sign-arvo ?> ?=(%writ +<.syn) ~> %slog.0^leaf/"kiln: activated install into {here}" - %: emit - %pass (make-wire %sync) %arvo %c - %warp ship.rak desk.rak `[%sing %w da+now /] - == + (emit sync:pass) :: ++ take-sync |= syn=sign-arvo ?> ?=(%writ +<.syn) ?~ p.syn ~> %slog.0^leaf/"kiln: cancelled (1) install into {here}, retrying" - (install loc [ship desk]:rak) :: TODO reset aeon? + reset ~> %slog.0^leaf/"kiln: downloading update for {here}" =? aeon.rak ?=(%w p.p.u.p.syn) ud:;;(cass:clay q.q.r.u.p.syn) - %: emit - %pass (make-wire %download) %arvo %c - %warp ship.rak desk.rak `[%sing %v ud+aeon.rak /] - == + (emit download:pass) :: ++ take-download |= syn=sign-arvo ?> ?=(%writ +<.syn) ?~ p.syn ~> %slog.0^leaf/"kiln: cancelled (2) install into {here}, retrying" - (install loc [ship desk]:rak) :: TODO reset aeon? + reset ~> %slog.0^leaf/"kiln: finished downloading update for {here}" - :: TODO: check kelvin here =. aeon.rak +(aeon.rak) - =/ =germ (get-germ loc) + =/ kel (get-kelvin (get-ankh u.p.syn)) + ?. =(kel [%zuse zuse]) + ~> %slog.0^leaf/"kiln: future version {}, enqueueing" + =. next.rak :_(next.rak [(dec aeon.rak) kel]) + (emit sync:pass) ~> %slog.0^leaf/"kiln: merging into {here}" - %- emil - :~ :* %pass (make-wire %merge) %arvo %c - %merg loc ship.rak desk.rak ud+(dec aeon.rak) germ - == - :* %pass (make-wire %sync) %arvo %c - %warp ship.rak desk.rak `[%sing %z ud+aeon.rak /] - == == + (emil ~[merge sync]:pass) :: ++ take-merge |= syn=sign-arvo @@ -263,7 +287,7 @@ :- %leaf "kiln: merge into {here} failed, maybe because sunk; restarting" p.p.syn - (install loc [ship desk]:rak) :: TODO reset aeon? + reset ?: ?=(%| -.p.syn) %- %+ slog :- %leaf @@ -273,16 +297,44 @@ :: ~> %slog.0^leaf/"merge into {here} succeeded" ..abet + :: + ++ pass + |% + ++ find (warp %find [%sing %y ud+1 /]) + ++ sync (warp %sync [%sing %w da+now /]) + ++ download (warp %download [%sing %v ud+aeon.rak /]) + ++ merge + =/ germ (get-germ loc) + =/ =aeon (dec aeon.rak) + (clay-card %merge [%merg loc ship.rak desk.rak ud+aeon germ]) + :: + ++ warp |=([s=term r=rave] (clay-card s %warp ship.rak desk.rak `r)) + ++ clay-card + |= [step=@tas =task:clay] + ^- card:agent:gall + [%pass (make-wire step) %arvo %c task] + -- -- :: +get-apps: find which apps Gall is running on a desk :: -:: TODO: move to zuse? -:: ++ get-apps |= =desk ^- (list dude:gall) %~ tap in .^((set dude:gall) ge+/(scot %p our)/[desk]/(scot %da now)) +:: +get-kelvin: read /sys.kelvin from an $ankh +:: +++ get-kelvin + |= =ankh + !< [lal=@tas num=@ud] + q:(need (~(get an:cloy ankh) /sys/kelvin)) +:: +get-ankh: extract $ankh from clay %v response $rant +:: +++ get-ankh + |= =rant + ^- ankh + ?> ?=(%dome p.r.rant) + !<(ankh q.r.rant) :: +get-germ: select merge strategy into local desk :: :: If destination desk doesn't exist, need a %init merge. If this is From 0e144314c3f22fe535ae5a0db4ec13bf69757945 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Wed, 7 Jul 2021 14:08:21 -0400 Subject: [PATCH 017/595] gall: suspend agents on upgrade --- pkg/arvo/sys/vane/gall.hoon | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index 55423605b..957a981d4 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -173,6 +173,13 @@ [%g %wiping-eyre-subs] |- ^+ mo-core ?~ apps mo-core + ?. =(%base q.beak.egg.i.apps) + ~> %slog.[0 leaf+"gall: suspending {}"] + =. old-state.egg.i.apps + =/ old old-state.egg.i.apps + |/?-(-.old %| p.old, %& p.old) + =/ ap-core (ap-abut:ap:mo-core i.apps) + $(apps t.apps, mo-core ap-abet:ap-core) ~> %slog.[0 leaf+"gall: upgrading {}"] =/ ap-core (ap-abut:ap:mo-core i.apps) =? ap-core ?=(%& -.old-state.egg.i.apps) @@ -1468,13 +1475,11 @@ =^ maybe-tang ap-core (ap-upgrade-state old-agent-state) :: =. agent-config - =/ =term ?~(old-agent-state %boot %bump) - =/ possibly-suss - ?~ maybe-tang - =/ =suss [agent-name term now] - [%.y suss] - [%.n u.maybe-tang] - [possibly-suss agent-config] + :_ agent-config + ^- (each suss tang) + ?^ maybe-tang + |/u.maybe-tang + &/[agent-name ?~(old-agent-state %boot %bump) now] :: [maybe-tang ap-core] :: +ap-upgrade-state: low-level install. From 06b4206e0245d57012adbb80d03d8f0531dd85bf Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Wed, 7 Jul 2021 14:11:40 -0400 Subject: [PATCH 018/595] kiln: minor cleanup --- pkg/arvo/lib/hood/kiln.hoon | 51 +++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 6584d68a0..f8afd4b49 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -161,14 +161,31 @@ ~_ leaf/"kiln: {} not installed" ..abet(loc lac, rak (~(got by ark) lac)) :: - ++ emit |=(card:agent:gall ..abet(..vats (^emit +<))) - ++ emil |=((list card:agent:gall) ..abet(..vats (^emil +<))) ++ here "{} from {<[ship desk]:rak>}" ++ make-wire |=(step=@tas /kiln/vats/[loc]/[step]) ++ from-wire |= =wire ?> ?=([%kiln %vats @ @ ~] wire) (abed i.t.t.wire) + :: + ++ emit |=(card:agent:gall ..abet(..vats (^emit +<))) + ++ emil |=((list card:agent:gall) ..abet(..vats (^emil +<))) + ++ pass + |% + ++ find (warp %find [%sing %y ud+1 /]) + ++ sync (warp %sync [%sing %w da+now /]) + ++ download (warp %download [%sing %v ud+aeon.rak /]) + ++ merge + =/ germ (get-germ loc) + =/ =aeon (dec aeon.rak) + (clay-card %merge [%merg loc ship.rak desk.rak ud+aeon germ]) + :: + ++ warp |=([s=term r=rave] (clay-card s %warp ship.rak desk.rak `r)) + ++ clay-card + |= [step=@tas =task:clay] + ^- card:agent:gall + [%pass (make-wire step) %arvo %c task] + -- :: +uninstall: stop tracking apps on desk, and suspend apps :: ++ uninstall @@ -283,37 +300,15 @@ |= syn=sign-arvo ?> ?=(%mere +<.syn) ?: ?=([%| %ali-unavailable *] p.syn) - %- %+ slog - :- %leaf - "kiln: merge into {here} failed, maybe because sunk; restarting" - p.p.syn + =+ "kiln: merge into {here} failed, maybe because sunk; restarting" + %- (slog leaf/- p.p.syn) reset ?: ?=(%| -.p.syn) - %- %+ slog - :- %leaf - "kiln: merge into {here} failed, waiting for next revision" - p.p.syn + =+ "kiln: merge into {here} failed, waiting for next revision" + %- (slog leaf/- p.p.syn) ..abet - :: ~> %slog.0^leaf/"merge into {here} succeeded" ..abet - :: - ++ pass - |% - ++ find (warp %find [%sing %y ud+1 /]) - ++ sync (warp %sync [%sing %w da+now /]) - ++ download (warp %download [%sing %v ud+aeon.rak /]) - ++ merge - =/ germ (get-germ loc) - =/ =aeon (dec aeon.rak) - (clay-card %merge [%merg loc ship.rak desk.rak ud+aeon germ]) - :: - ++ warp |=([s=term r=rave] (clay-card s %warp ship.rak desk.rak `r)) - ++ clay-card - |= [step=@tas =task:clay] - ^- card:agent:gall - [%pass (make-wire step) %arvo %c task] - -- -- :: +get-apps: find which apps Gall is running on a desk :: From 51aac0f5d3d1f1b59bb64568e93102d6183bf868 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Wed, 7 Jul 2021 14:49:22 -0400 Subject: [PATCH 019/595] kiln: revive agents on upgrade (provisional) --- pkg/arvo/lib/hood/kiln.hoon | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index f8afd4b49..167a903e6 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -307,8 +307,11 @@ =+ "kiln: merge into {here} failed, waiting for next revision" %- (slog leaf/- p.p.syn) ..abet - ~> %slog.0^leaf/"merge into {here} succeeded" - ..abet + ~> %slog.0^leaf/"merge into {here} succeeded; reviving agents" + %- emil + %+ turn (get-apps loc) + |= =dude:gall + [/kiln/fade/[dude] %pass %arvo %g %fade dude %jolt] -- :: +get-apps: find which apps Gall is running on a desk :: From cda4080e06fb723ad701e7928eccbedaa54eb0c0 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Wed, 7 Jul 2021 15:17:03 -0400 Subject: [PATCH 020/595] kiln: check for blocking desks before kernel update --- pkg/arvo/lib/hood/kiln.hoon | 85 +++++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 32 deletions(-) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 167a903e6..5ec2a7dc6 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -221,17 +221,6 @@ ^+ ..abet =. ark (~(del by ark) loc) (install loc [ship desk]:rak) - :: +get-blockers: find desks that would block a kernel update - :: - ++ get-blockers - |= kel=weft - ^- (set desk) - %- ~(gas in *(set desk)) - %+ murn ~(tap by ark) - |= [=desk =arak] - ?: (lien next.arak |=([* k=weft] =(k kel))) - ~ - `desk :: +bump: handle kernel kelvin upgrade :: :: Apply merges and revive faded agents on all paused desks. @@ -313,19 +302,6 @@ |= =dude:gall [/kiln/fade/[dude] %pass %arvo %g %fade dude %jolt] -- -:: +get-apps: find which apps Gall is running on a desk -:: -++ get-apps - |= =desk - ^- (list dude:gall) - %~ tap in - .^((set dude:gall) ge+/(scot %p our)/[desk]/(scot %da now)) -:: +get-kelvin: read /sys.kelvin from an $ankh -:: -++ get-kelvin - |= =ankh - !< [lal=@tas num=@ud] - q:(need (~(get an:cloy ankh) /sys/kelvin)) :: +get-ankh: extract $ankh from clay %v response $rant :: ++ get-ankh @@ -333,6 +309,24 @@ ^- ankh ?> ?=(%dome p.r.rant) !<(ankh q.r.rant) +:: +get-apps: find which apps Gall is running on a desk +:: +++ get-apps + |= =desk + ^- (list dude:gall) + %~ tap in + .^((set dude:gall) ge+/(scot %p our)/[desk]/(scot %da now)) +:: +get-blockers: find desks that would block a kernel update +:: +++ get-blockers + |= kel=weft + ^- (set desk) + %- ~(gas in *(set desk)) + %+ murn ~(tap by ark) + |= [=desk =arak] + ?: (lien next.arak |=([* k=weft] =(k kel))) + ~ + `desk :: +get-germ: select merge strategy into local desk :: :: If destination desk doesn't exist, need a %init merge. If this is @@ -347,6 +341,12 @@ %1 %take-that * %mate == +:: +get-kelvin: read /sys.kelvin from an $ankh +:: +++ get-kelvin + |= =ankh + !< weft + q:(need (~(get an:cloy ankh) /sys/kelvin)) :: ++ update |% @@ -458,31 +458,52 @@ (poke `[ship desk]:u.ota) =. ..abet (render-ket "finished downloading OTA" ~) =. aeon.u.ota +(aeon.u.ota) - =/ =germ (get-germ %home) - =. ..abet (render-ket "applying OTA to %home" ~) + :: + =/ old-ankh ank:.^(dome cv+/(scot %p our)/base/(scot %da now)) + =/ old-weft (get-kelvin old-ankh) + :: + =/ new-ankh (get-ankh u.p.sign-arvo) + =/ new-weft (get-kelvin new-ankh) + :: + =/ blockers + ?: =(new-weft old-weft) + ~ + (get-blockers new-weft) + :: + ?^ blockers + =. ..abet (render-ket "OTA to %base blocked on {}" + %- emil :~ + :* %pass (make-wire /sync) %arvo %c + %warp ship.u.ota desk.u.ota `[%sing %z ud+aeon.u.ota /] + == + :: TODO: emit subscription update here + == + :: + =/ =germ (get-germ %base) + =. ..abet (render-ket "applying OTA to %base" ~) %- emil - :~ :* %pass (make-wire /merge-home) %arvo %c - %merg %home ship.u.ota desk.u.ota ud+(dec aeon.u.ota) germ + :~ :* %pass (make-wire /merge-base) %arvo %c + %merg %base ship.u.ota desk.u.ota ud+(dec aeon.u.ota) germ == :* %pass (make-wire /sync) %arvo %c %warp ship.u.ota desk.u.ota `[%sing %z ud+aeon.u.ota /] == == :: - ++ take-merge-home + ++ take-merge-base |= =sign-arvo ?> ?=(%mere +<.sign-arvo) ?> ?=(^ ota) ?: ?=([%| %ali-unavailable *] p.sign-arvo) =. ..abet - =/ =tape "OTA to %home failed, maybe because sunk; restarting" + =/ =tape "OTA to %base failed, maybe because sunk; restarting" (render-ket tape `p.p.sign-arvo) (poke `[ship desk]:u.ota) :: ?: ?=(%| -.p.sign-arvo) - =/ =tape "OTA to %home failed, waiting for next revision" + =/ =tape "OTA to %base failed, waiting for next revision" (render-ket tape `p.p.sign-arvo) - =. ..abet (render-ket "OTA to %home succeeded" ~) + =. ..abet (render-ket "OTA to %base succeeded" ~) =. ..abet (render-ket "applying OTA to %kids" ~) =/ =germ (get-germ %kids) %: emit From db49cbee92708c546abe030fac34f74cca5a0cd7 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Thu, 8 Jul 2021 19:25:18 -0400 Subject: [PATCH 021/595] kiln: bugfixes, cleanup, and publish some ota progress --- pkg/arvo/app/hood.hoon | 1 + pkg/arvo/lib/hood/kiln.hoon | 132 +++++++++++++++++++++++------------- 2 files changed, 84 insertions(+), 49 deletions(-) diff --git a/pkg/arvo/app/hood.hoon b/pkg/arvo/app/hood.hoon index 689e43d0b..8c54566e9 100644 --- a/pkg/arvo/app/hood.hoon +++ b/pkg/arvo/app/hood.hoon @@ -98,6 +98,7 @@ ^- step:agent:gall ?+ path (on-watch:def +<) [%drum *] =^(c drum.state (peer:drum-core +<) [c this]) + [%kiln *] =^(c kiln.state (peer:kiln-core +<) [c this]) == :: ++ on-agent diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 5ec2a7dc6..1a771fe0d 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -3,8 +3,8 @@ =, space:userlib =, format |% -+$ state [%2 pith-2] -+$ state-2 state ++$ state state-2 ++$ state-2 [%2 pith-2] +$ state-1 [%1 pith-1] +$ state-0 [%0 pith-0] +$ any-state @@ -83,9 +83,9 @@ -- |= [bowl:gall state] ?> =(src our) -|_ moz=(list card:agent:gall) -+$ state ^state :: proxy -+$ any-state ^any-state :: proxy +=| moz=(list card:agent:gall) +|% +++ kiln . ++ abet :: resolve [(flop moz) `state`+<+.$] :: @@ -154,12 +154,12 @@ :: ++ vats |_ [loc=desk rak=arak] - :: - ++ abet ..vats(ark (~(put by ark) loc rak)) + ++ vats . + ++ abet kiln(ark (~(put by ark) loc rak)) ++ abed |= lac=desk ~_ leaf/"kiln: {} not installed" - ..abet(loc lac, rak (~(got by ark) lac)) + vats(loc lac, rak (~(got by ark) lac)) :: ++ here "{} from {<[ship desk]:rak>}" ++ make-wire |=(step=@tas /kiln/vats/[loc]/[step]) @@ -168,8 +168,8 @@ ?> ?=([%kiln %vats @ @ ~] wire) (abed i.t.t.wire) :: - ++ emit |=(card:agent:gall ..abet(..vats (^emit +<))) - ++ emil |=((list card:agent:gall) ..abet(..vats (^emil +<))) + ++ emit |=(card:agent:gall vats(kiln (^emit +<))) + ++ emil |=((list card:agent:gall) vats(kiln (^emil +<))) ++ pass |% ++ find (warp %find [%sing %y ud+1 /]) @@ -190,26 +190,26 @@ :: ++ uninstall |= lac=desk - ^+ ..vats - =. ..abet (abed lac) + ^+ kiln + =. vats (abed lac) ~> %slog.0^leaf/"kiln: uninstalling {here}" - =. ..abet + =. vats %- emil %+ turn (get-apps lac) |= =dude:gall [%pass /kiln/vats/uninstall %arvo %g %fade dude %idle] :: - ..vats(ark (~(del by ark) lac)) + kiln(ark (~(del by ark) lac)) :: +install: set up desk sync to .lac to install all apps from [her rem] :: ++ install |= [lac=desk her=ship rem=desk] - ^+ ..abet + ^+ vats =/ got (~(get by ark) lac) ?: =(`[her rem] got) ~> %slog.0^leaf/"kiln: already tracking {here:(abed lac)}, ignoring" - ..abet - =? ..vats ?=(^ got) (uninstall lac) + vats + =? kiln ?=(^ got) (uninstall lac) =: loc lac rak [her rem *aeon next=~] == @@ -218,35 +218,35 @@ :: +reset: resync after failure :: ++ reset - ^+ ..abet + ^+ vats =. ark (~(del by ark) loc) (install loc [ship desk]:rak) :: +bump: handle kernel kelvin upgrade :: - :: Apply merges and revive faded agents on all paused desks. + :: Apply merges to revive faded agents on all paused desks. :: ++ bump |= except=(set desk) - ^+ ..vats + ^+ kiln =/ kel=weft [%zuse zuse] =/ 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))) - =< ..vats - |- ^+ ..abet - ?~ liv ..abet - $(liv t.liv, ..abet (emit merge:pass(loc p.i.liv, rak q.i.liv))) + =< kiln + |- ^+ vats + ?~ liv vats + $(liv t.liv, vats (emit merge:pass(loc p.i.liv, rak q.i.liv))) :: ++ take |= [=wire syn=sign-arvo] - ^+ ..abet - =. ..abet (from-wire wire) + ^+ vats + =. vats (from-wire wire) ?> ?=([%kiln %vats @ @ ~] wire) ?+ i.t.t.t.wire ~> %slog.0^leaf/"kiln: vats-bad-take {}" - ..abet + vats %find (take-find syn) %sync (take-sync syn) %download (take-download syn) @@ -295,12 +295,12 @@ ?: ?=(%| -.p.syn) =+ "kiln: merge into {here} failed, waiting for next revision" %- (slog leaf/- p.p.syn) - ..abet + vats ~> %slog.0^leaf/"merge into {here} succeeded; reviving agents" %- emil %+ turn (get-apps loc) |= =dude:gall - [/kiln/fade/[dude] %pass %arvo %g %fade dude %jolt] + [%pass /kiln/fade/[dude] %arvo %g %fade dude %jolt] -- :: +get-ankh: extract $ankh from clay %v response $rant :: @@ -419,7 +419,7 @@ %find (take-find sign-arvo) %sync (take-sync sign-arvo) %download (take-download sign-arvo) - %merge-home (take-merge-home sign-arvo) + %merge-base (take-merge-base sign-arvo) %merge-kids (take-merge-kids sign-arvo) == :: @@ -470,25 +470,28 @@ ~ (get-blockers new-weft) :: - ?^ blockers - =. ..abet (render-ket "OTA to %base blocked on {}" - %- emil :~ - :* %pass (make-wire /sync) %arvo %c - %warp ship.u.ota desk.u.ota `[%sing %z ud+aeon.u.ota /] - == - :: TODO: emit subscription update here - == + ?. =(~ blockers) + =. ..abet (render-ket "OTA to %base blocked on {}" ~) + %- emil + :~ :* %pass (make-wire /sync) %arvo %c + %warp ship.u.ota desk.u.ota `[%sing %z ud+aeon.u.ota /] + == + :* %give %fact [/vats]~ %kiln-vats-diff + !>([%blocked ota=u.ota weft=new-weft blockers=blockers]) + == == :: =/ =germ (get-germ %base) =. ..abet (render-ket "applying OTA to %base" ~) - %- emil - :~ :* %pass (make-wire /merge-base) %arvo %c - %merg %base ship.u.ota desk.u.ota ud+(dec aeon.u.ota) germ - == - :* %pass (make-wire /sync) %arvo %c - %warp ship.u.ota desk.u.ota `[%sing %z ud+aeon.u.ota /] - == - == + =. ..abet + =< ?>(?=(^ ota) .) + %- emil + :~ :* %pass (make-wire /merge-base) %arvo %c + %merg %base ship.u.ota desk.u.ota ud+(dec aeon.u.ota) germ + == + :* %pass (make-wire /sync) %arvo %c + %warp ship.u.ota desk.u.ota `[%sing %z ud+aeon.u.ota /] + == == + (bump:vats blockers=~) :: ++ take-merge-base |= =sign-arvo @@ -498,13 +501,25 @@ =. ..abet =/ =tape "OTA to %base failed, maybe because sunk; restarting" (render-ket tape `p.p.sign-arvo) + =. ..abet + =< ?>(?=(^ ota) .) + =/ fact merge-base-fail/[u.ota p.p.sign-arvo] + (emit %give %fact [/vats]~ %kiln-vats-diff !>(fact)) (poke `[ship desk]:u.ota) :: ?: ?=(%| -.p.sign-arvo) - =/ =tape "OTA to %base failed, waiting for next revision" - (render-ket tape `p.p.sign-arvo) + =. ..abet + =/ =tape "OTA to %base failed, waiting for next revision" + (render-ket tape `p.p.sign-arvo) + =/ fact merge-base-fail/[u.ota p.p.sign-arvo] + (emit %give %fact [/vats]~ %kiln-vats-diff !>(fact)) + :: =. ..abet (render-ket "OTA to %base succeeded" ~) =. ..abet (render-ket "applying OTA to %kids" ~) + =. ..abet + =< ?>(?=(^ ota) .) + =/ fact merge-base/u.ota + (emit %give %fact [/vats]~ %kiln-vats-diff !>(fact)) =/ =germ (get-germ %kids) %: emit %pass (make-wire /merge-kids) %arvo %c @@ -519,8 +534,17 @@ =. ..abet =/ =tape "OTA to %kids failed, maybe because sunk; restarting" (render-ket tape `p.p.sign-arvo) + =. ..abet + =< ?>(?=(^ ota) .) + =/ fact merge-kids-fail/[u.ota p.p.sign-arvo] + (emit %give %fact [/vats]~ %kiln-vats-diff !>(fact)) (poke `[ship desk]:u.ota) :: + =. ..abet + =< ?>(?=(^ ota) .) + =/ fact merge-kids/u.ota + (emit %give %fact [/vats]~ %kiln-vats-diff !>(fact)) + :: ?- -.p.sign-arvo %& (render-ket "OTA to %kids succeeded" ~) %| (render-ket "OTA to %kids failed" `p.p.sign-arvo) @@ -583,7 +607,7 @@ =/ recur ~s1 =. commit-timer [/kiln/autocommit (add now recur) recur mon] - (emit %pass way.commit-timer %arvo %b [%wait nex.commit-timer]) + (emit %pass way.commit-timer %arvo %b [%wait nex.commit-timer]) :: ++ poke-fuse |= k=kiln-fuse @@ -706,6 +730,16 @@ ?~ ota "OTAs disabled" "OTAs enabled from {} on {}" +:: +peer: handle %watch +:: +++ peer + |= =path + ?> (team:title our src) + ?+ path ~|(kiln-path/path !!) + [%vats ~] + =/ snap [ota=ota ark=ark] + abet(moz :_(moz [%give %fact ~ kiln-vats-snap/!>(snap)])) + == :: ++ take-agent |= [=wire =sign:agent:gall] From ad15da2e7b9e04219e7bc2b393a65da9c9867281 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 9 Jul 2021 01:08:33 -0400 Subject: [PATCH 022/595] kiln: first stab at ota inside +vats --- pkg/arvo/lib/hood/kiln.hoon | 50 +++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 1a771fe0d..fc621d5c4 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -219,6 +219,7 @@ :: ++ reset ^+ vats + ~> %slog.0^leaf/"kiln: resetting tracking for {here}" =. ark (~(del by ark) loc) (install loc [ship desk]:rak) :: +bump: handle kernel kelvin upgrade @@ -234,6 +235,7 @@ ~> %slog.0^leaf/"kiln: desks blocked upgrade {}" !! =/ liv (skip ~(tap by ark) |=([d=desk *] (~(has in except) d))) + ~> %slog.0^leaf/"kiln: bump {}" =< kiln |- ^+ vats ?~ liv vats @@ -277,12 +279,34 @@ reset ~> %slog.0^leaf/"kiln: finished downloading update for {here}" =. aeon.rak +(aeon.rak) - =/ kel (get-kelvin (get-ankh u.p.syn)) - ?. =(kel [%zuse zuse]) - ~> %slog.0^leaf/"kiln: future version {}, enqueueing" - =. next.rak :_(next.rak [(dec aeon.rak) kel]) - (emit sync:pass) - ~> %slog.0^leaf/"kiln: merging into {here}" + :: + ?. =(%base loc) + =/ kel (get-kelvin (get-ankh u.p.syn)) + ?. =(kel [%zuse zuse]) + ~> %slog.0^leaf/"kiln: future version {}, enqueueing" + =. next.rak (snoc next.rak [(dec aeon.rak) kel]) + (emit sync:pass) + ~> %slog.0^leaf/"kiln: merging into {here}" + (emil ~[merge sync]:pass) + :: + =/ old-ankh ank:.^(dome cv+/(scot %p our)/base/(scot %da now)) + =/ old-weft (get-kelvin old-ankh) + :: + =/ new-ankh (get-ankh u.p.syn) + =/ new-weft (get-kelvin new-ankh) + :: + =/ blockers + ?: =(new-weft old-weft) + ~ + (get-blockers new-weft) + :: + ?. =(~ blockers) + ~> %slog.0^leaf/"kiln: OTA blocked on {}" + =- (emil sync:pass - ~) + :* %give %fact [/vats]~ %kiln-vats-diff + !>([%blocked arak=rak weft=new-weft blockers=blockers]) + == + ~> %slog.0^leaf/"kiln: applying OTA to {here}" (emil ~[merge sync]:pass) :: ++ take-merge @@ -296,11 +320,15 @@ =+ "kiln: merge into {here} failed, waiting for next revision" %- (slog leaf/- p.p.syn) vats - ~> %slog.0^leaf/"merge into {here} succeeded; reviving agents" - %- emil - %+ turn (get-apps loc) - |= =dude:gall - [%pass /kiln/fade/[dude] %arvo %g %fade dude %jolt] + =. vats + ~> %slog.0^leaf/"merge into {here} succeeded; reviving agents" + %- emil + %+ turn (get-apps loc) + |= =dude:gall + [%pass /kiln/fade/[dude] %arvo %g %fade dude %jolt] + ?. =(%base loc) + vats + vats(kiln (bump (sy %base ~))) -- :: +get-ankh: extract $ankh from clay %v response $rant :: From c3469a44444b71b2b8f1a2d8cdf7a1385ac48de3 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 9 Jul 2021 11:56:52 -0400 Subject: [PATCH 023/595] kiln: merge to %kids in +vats --- pkg/arvo/lib/hood/kiln.hoon | 46 ++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index fc621d5c4..4b1ed7330 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -175,10 +175,14 @@ ++ find (warp %find [%sing %y ud+1 /]) ++ sync (warp %sync [%sing %w da+now /]) ++ download (warp %download [%sing %v ud+aeon.rak /]) - ++ merge + ++ merge-main =/ germ (get-germ loc) =/ =aeon (dec aeon.rak) - (clay-card %merge [%merg loc ship.rak desk.rak ud+aeon germ]) + (clay-card %merge-main [%merg loc ship.rak desk.rak ud+aeon germ]) + ++ merge-kids + =/ germ (get-germ %kids) + =/ =aeon (dec aeon.rak) + (clay-card %merge-kids [%merg %kids ship.rak desk.rak ud+aeon germ]) :: ++ warp |=([s=term r=rave] (clay-card s %warp ship.rak desk.rak `r)) ++ clay-card @@ -239,7 +243,7 @@ =< kiln |- ^+ vats ?~ liv vats - $(liv t.liv, vats (emit merge:pass(loc p.i.liv, rak q.i.liv))) + $(liv t.liv, vats (emit merge-main:pass(loc p.i.liv, rak q.i.liv))) :: ++ take |= [=wire syn=sign-arvo] @@ -249,10 +253,11 @@ ?+ i.t.t.t.wire ~> %slog.0^leaf/"kiln: vats-bad-take {}" vats - %find (take-find syn) - %sync (take-sync syn) - %download (take-download syn) - %merge (take-merge syn) + %find (take-find syn) + %sync (take-sync syn) + %download (take-download syn) + %merge-main (take-merge-main syn) + %merge-kids (take-merge-kids syn) == :: ++ take-find @@ -287,7 +292,7 @@ =. next.rak (snoc next.rak [(dec aeon.rak) kel]) (emit sync:pass) ~> %slog.0^leaf/"kiln: merging into {here}" - (emil ~[merge sync]:pass) + (emil ~[merge-main sync]:pass) :: =/ old-ankh ank:.^(dome cv+/(scot %p our)/base/(scot %da now)) =/ old-weft (get-kelvin old-ankh) @@ -307,9 +312,9 @@ !>([%blocked arak=rak weft=new-weft blockers=blockers]) == ~> %slog.0^leaf/"kiln: applying OTA to {here}" - (emil ~[merge sync]:pass) + (emil ~[merge-main sync]:pass) :: - ++ take-merge + ++ take-merge-main |= syn=sign-arvo ?> ?=(%mere +<.syn) ?: ?=([%| %ali-unavailable *] p.syn) @@ -328,7 +333,26 @@ [%pass /kiln/fade/[dude] %arvo %g %fade dude %jolt] ?. =(%base loc) vats - vats(kiln (bump (sy %base ~))) + =. kiln (bump (sy %base %kids ~)) + (emit merge-kids:pass) + :: + ++ take-merge-kids + |= syn=sign-arvo + ?> ?=(%mere +<.syn) + ?: ?=([%| %ali-unavailable *] p.syn) + ~> %slog.0^leaf/"kiln: OTA to %kids failed, maybe peer sunk; restarting" + =. vats + =/ fact merge-kids-sunk/[rak p.p.syn] + (emit %give %fact [/vats]~ %kiln-vats-diff !>(fact)) + reset + =/ fact + ?- -.p.syn + %& ~> %slog.0^leaf/"kiln: OTA to %kids succeeded" + merge-kids/rak + %| ~> %slog.0^leaf/"kiln: OTA to %kids failed {}" + merge-kids-fail/[rak p.p.syn] + == + (emit %give %fact [/vats]~ %kiln-vats-diff !>(fact)) -- :: +get-ankh: extract $ankh from clay %v response $rant :: From 5e4593ae22c8d2df90514ec08a23e48289eb6b92 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 9 Jul 2021 11:58:36 -0400 Subject: [PATCH 024/595] |install,|uninstall generators --- pkg/arvo/gen/hood/install.hoon | 5 +++++ pkg/arvo/gen/hood/uninstall.hoon | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 pkg/arvo/gen/hood/install.hoon create mode 100644 pkg/arvo/gen/hood/uninstall.hoon diff --git a/pkg/arvo/gen/hood/install.hoon b/pkg/arvo/gen/hood/install.hoon new file mode 100644 index 000000000..fb5590273 --- /dev/null +++ b/pkg/arvo/gen/hood/install.hoon @@ -0,0 +1,5 @@ +:- %say +|= $: [now=@da eny=@uvJ bec=beak] + [arg=[her=@p sud=@tas ~] ~] + == +[%kiln-install [lac=sud her=her rem=sud]:arg] diff --git a/pkg/arvo/gen/hood/uninstall.hoon b/pkg/arvo/gen/hood/uninstall.hoon new file mode 100644 index 000000000..40e7f6710 --- /dev/null +++ b/pkg/arvo/gen/hood/uninstall.hoon @@ -0,0 +1,5 @@ +:- %say +|= $: [now=@da eny=@uvJ bec=beak] + [=desk ~] ~] + == +[%kiln-uninstall desk] From 2dc2133b2f93aaf45fbfbd73cb9d4a5c7488f876 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 9 Jul 2021 12:07:16 -0400 Subject: [PATCH 025/595] kiln: remove +update core; needs migration work --- pkg/arvo/lib/hood/kiln.hoon | 223 +----------------------------------- 1 file changed, 4 insertions(+), 219 deletions(-) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 4b1ed7330..83a369d64 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -123,8 +123,9 @@ (~(del by syn.old) [syd her sud]:u.recognized-ota) :: note that the new state has not yet been initialized :: - =? ..abet ?=(^ recognized-ota) - (poke:update `[her sud]:u.recognized-ota) +:: TODO reinstate with +vats +:: =? ..abet ?=(^ recognized-ota) +:: (poke:update `[her sud]:u.recognized-ota) :: +>(old [%1 rem.old syn=sen ota=~ commit-timer.old]) :: @@ -400,209 +401,6 @@ !< weft q:(need (~(get an:cloy ankh) /sys/kelvin)) :: -++ update - |% - ++ poke - |= arg=(unit [=ship =desk]) - ^+ ..abet - =? ..abet =(arg (bind ota |=([=ship =desk =aeon] [ship desk]))) - (render "restarting OTA sync" ~) - =? ..abet ?=(^ ota) - =. ..abet (render-ket "cancelling OTA sync" ~) - ..abet(ota ~) - ?~ arg - ..abet - =. ota `[ship.u.arg desk.u.arg *aeon] - =. ..abet (render "starting OTA sync" ~) - %: emit - %pass (make-wire /find) %arvo %c - %warp ship.u.arg desk.u.arg `[%sing %y ud+1 /] - == - :: - ++ make-wire - |= =path - ^- wire - ?> ?=(^ ota) - %- welp :_ path - /kiln/ota/(scot %p ship.u.ota)/[desk.u.ota]/(scot %ud aeon.u.ota) - :: - ++ check-ota - |= =wire - ^- ? - ?~ ota - | - ?& ?=([@ @ @ *] wire) - =(i.wire (scot %p ship.u.ota)) - =(i.t.wire desk.u.ota) - =(i.t.t.wire (scot %ud aeon.u.ota)) - == - :: - ++ render - |= [mez=tape error=(unit (pair term tang))] - %+ spam - ?~ ota - leaf+mez - :^ %palm [" " ~ ~ ~] leaf+(weld "kiln: " mez) - ~[leaf+"from {}" leaf+"on {}"] - ?~ error - ~ - [>p.u.error< q.u.error] - :: - ++ render-ket - |= [mez=tape error=(unit (pair term tang))] - ?> ?=(^ ota) - =< ?>(?=(^ ota) .) - %+ spam - :^ %palm [" " ~ ~ ~] leaf+(weld "kiln: " mez) - ~[leaf+"from {}" leaf+"on {}"] - ?~ error - ~ - [>p.u.error< q.u.error] - :: - ++ take - |= [=wire =sign-arvo] - ^+ ..abet - ?> ?=(^ ota) - ?. (check-ota wire) - ..abet - ?. ?=([@ @ @ @ *] wire) - ..abet - ?+ i.t.t.t.wire ~&([%strange-ota-take t.t.t.wire] ..abet) - %find (take-find sign-arvo) - %sync (take-sync sign-arvo) - %download (take-download sign-arvo) - %merge-base (take-merge-base sign-arvo) - %merge-kids (take-merge-kids sign-arvo) - == - :: - ++ take-find - |= =sign-arvo - ?> ?=(%writ +<.sign-arvo) - ?> ?=(^ ota) - =. ..abet (render-ket "activated OTA" ~) - %: emit - %pass (make-wire /sync) %arvo %c - %warp ship.u.ota desk.u.ota `[%sing %w da+now /] - == - :: - ++ take-sync - |= =sign-arvo - ?> ?=(%writ +<.sign-arvo) - ?> ?=(^ ota) - ?~ p.sign-arvo - =. ..abet (render-ket "OTA cancelled (1), retrying" ~) - (poke `[ship desk]:u.ota) - =. ..abet (render-ket "downloading OTA update" ~) - =? aeon.u.ota ?=(%w p.p.u.p.sign-arvo) - ud:;;(cass:clay q.q.r.u.p.sign-arvo) - %: emit - %pass (make-wire /download) %arvo %c - %warp ship.u.ota desk.u.ota `[%sing %v ud+aeon.u.ota /] - == - :: - ++ take-download - |= =sign-arvo - ^+ ..abet - ?> ?=(%writ +<.sign-arvo) - ?> ?=(^ ota) - ?~ p.sign-arvo - =. ..abet (render-ket "OTA cancelled (2), retrying" ~) - (poke `[ship desk]:u.ota) - =. ..abet (render-ket "finished downloading OTA" ~) - =. aeon.u.ota +(aeon.u.ota) - :: - =/ old-ankh ank:.^(dome cv+/(scot %p our)/base/(scot %da now)) - =/ old-weft (get-kelvin old-ankh) - :: - =/ new-ankh (get-ankh u.p.sign-arvo) - =/ new-weft (get-kelvin new-ankh) - :: - =/ blockers - ?: =(new-weft old-weft) - ~ - (get-blockers new-weft) - :: - ?. =(~ blockers) - =. ..abet (render-ket "OTA to %base blocked on {}" ~) - %- emil - :~ :* %pass (make-wire /sync) %arvo %c - %warp ship.u.ota desk.u.ota `[%sing %z ud+aeon.u.ota /] - == - :* %give %fact [/vats]~ %kiln-vats-diff - !>([%blocked ota=u.ota weft=new-weft blockers=blockers]) - == == - :: - =/ =germ (get-germ %base) - =. ..abet (render-ket "applying OTA to %base" ~) - =. ..abet - =< ?>(?=(^ ota) .) - %- emil - :~ :* %pass (make-wire /merge-base) %arvo %c - %merg %base ship.u.ota desk.u.ota ud+(dec aeon.u.ota) germ - == - :* %pass (make-wire /sync) %arvo %c - %warp ship.u.ota desk.u.ota `[%sing %z ud+aeon.u.ota /] - == == - (bump:vats blockers=~) - :: - ++ take-merge-base - |= =sign-arvo - ?> ?=(%mere +<.sign-arvo) - ?> ?=(^ ota) - ?: ?=([%| %ali-unavailable *] p.sign-arvo) - =. ..abet - =/ =tape "OTA to %base failed, maybe because sunk; restarting" - (render-ket tape `p.p.sign-arvo) - =. ..abet - =< ?>(?=(^ ota) .) - =/ fact merge-base-fail/[u.ota p.p.sign-arvo] - (emit %give %fact [/vats]~ %kiln-vats-diff !>(fact)) - (poke `[ship desk]:u.ota) - :: - ?: ?=(%| -.p.sign-arvo) - =. ..abet - =/ =tape "OTA to %base failed, waiting for next revision" - (render-ket tape `p.p.sign-arvo) - =/ fact merge-base-fail/[u.ota p.p.sign-arvo] - (emit %give %fact [/vats]~ %kiln-vats-diff !>(fact)) - :: - =. ..abet (render-ket "OTA to %base succeeded" ~) - =. ..abet (render-ket "applying OTA to %kids" ~) - =. ..abet - =< ?>(?=(^ ota) .) - =/ fact merge-base/u.ota - (emit %give %fact [/vats]~ %kiln-vats-diff !>(fact)) - =/ =germ (get-germ %kids) - %: emit - %pass (make-wire /merge-kids) %arvo %c - %merg %kids ship.u.ota desk.u.ota ud+(dec aeon.u.ota) germ - == - :: - ++ take-merge-kids - |= =sign-arvo - ?> ?=(%mere +<.sign-arvo) - ?> ?=(^ ota) - ?: ?=([%| %ali-unavailable *] p.sign-arvo) - =. ..abet - =/ =tape "OTA to %kids failed, maybe because sunk; restarting" - (render-ket tape `p.p.sign-arvo) - =. ..abet - =< ?>(?=(^ ota) .) - =/ fact merge-kids-fail/[u.ota p.p.sign-arvo] - (emit %give %fact [/vats]~ %kiln-vats-diff !>(fact)) - (poke `[ship desk]:u.ota) - :: - =. ..abet - =< ?>(?=(^ ota) .) - =/ fact merge-kids/u.ota - (emit %give %fact [/vats]~ %kiln-vats-diff !>(fact)) - :: - ?- -.p.sign-arvo - %& (render-ket "OTA to %kids succeeded" ~) - %| (render-ket "OTA to %kids failed" `p.p.sign-arvo) - == - -- -:: ++ poke |= [=mark =vase] ?+ mark ~|([%poke-kiln-bad-mark mark] !!) @@ -618,8 +416,6 @@ %kiln-label =;(f (f !<(_+<.f vase)) poke-label) %kiln-merge =;(f (f !<(_+<.f vase)) poke-merge) %kiln-mount =;(f (f !<(_+<.f vase)) poke-mount) - %kiln-ota =;(f (f !<(_+<.f vase)) poke-ota) - %kiln-ota-info =;(f (f !<(_+<.f vase)) poke-ota-info) %kiln-permission =;(f (f !<(_+<.f vase)) poke-permission) %kiln-rm =;(f (f !<(_+<.f vase)) poke-rm) %kiln-schedule =;(f (f !<(_+<.f vase)) poke-schedule) @@ -702,17 +498,6 @@ abet:(spam leaf+- ~) abet:(emit %pass /mount %arvo %c [%mont pot u.bem]) :: -++ poke-ota - |= arg=(unit [=ship =desk]) - abet:(poke:update arg) -:: -++ poke-ota-info - |= * - =< abet %- spam - :~ [%leaf get-ota-info] - [%leaf "use |ota %disable or |ota ~sponsor %kids to reset it"] - == -:: ++ poke-permission |= [syd=desk pax=path pub=?] =< abet @@ -813,7 +598,7 @@ ?>(?=(%writ +<.sign-arvo) +>.sign-arvo) [%autocommit *] %+ take-wake-autocommit t.wire ?>(?=(%wake +<.sign-arvo) +>.sign-arvo) - [%ota *] abet:(take:update t.wire sign-arvo) + [%vats *] abet:(take:vats t.wire sign-arvo) * ?+ +<.sign-arvo ((slog leaf+"kiln: strange card {<+<.sign-arvo wire>}" ~) abet) From 035b5fb0316aa1ef8701a3d3af11ba233fe3a7d2 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Sat, 10 Jul 2021 08:56:08 -0400 Subject: [PATCH 026/595] kiln: read future kelvins from clay --- pkg/arvo/lib/hood/kiln.hoon | 45 ++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 83a369d64..4f6f3bfae 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -284,23 +284,23 @@ ~> %slog.0^leaf/"kiln: cancelled (2) install into {here}, retrying" reset ~> %slog.0^leaf/"kiln: finished downloading update for {here}" + =/ old-weft `weft`[%zuse zuse] + =/ new-weft (read-kelvin [ship desk aeon]:rak) =. aeon.rak +(aeon.rak) :: ?. =(%base loc) - =/ kel (get-kelvin (get-ankh u.p.syn)) - ?. =(kel [%zuse zuse]) - ~> %slog.0^leaf/"kiln: future version {}, enqueueing" - =. next.rak (snoc next.rak [(dec aeon.rak) kel]) + :: TODO: ?> =(%zuse lal.new-weft) but more flexible for future renames + ?: (gth num.new-weft num.old-weft) + ~> %slog.0^leaf/"kiln: cannot install {here}, old kelvin {}" + ~> %slog.0^leaf/"kiln: will retry at foreign kelvin {}" + (emit sync:pass) + ?: (lth num.new-weft num.old-weft) + ~> %slog.0^leaf/"kiln: future version {}, enqueueing" + =. next.rak (snoc next.rak [(dec aeon.rak) new-weft]) (emit sync:pass) ~> %slog.0^leaf/"kiln: merging into {here}" (emil ~[merge-main sync]:pass) :: - =/ old-ankh ank:.^(dome cv+/(scot %p our)/base/(scot %da now)) - =/ old-weft (get-kelvin old-ankh) - :: - =/ new-ankh (get-ankh u.p.syn) - =/ new-weft (get-kelvin new-ankh) - :: =/ blockers ?: =(new-weft old-weft) ~ @@ -312,7 +312,7 @@ :* %give %fact [/vats]~ %kiln-vats-diff !>([%blocked arak=rak weft=new-weft blockers=blockers]) == - ~> %slog.0^leaf/"kiln: applying OTA to {here}" + ~> %slog.0^leaf/"kiln: applying OTA to {here}, kelvin: {}" (emil ~[merge-main sync]:pass) :: ++ take-merge-main @@ -394,13 +394,32 @@ %1 %take-that * %mate == -:: +get-kelvin: read /sys.kelvin from an $ankh +:: +ankh-to-kelvin: read /sys.kelvin from an $ankh :: -++ get-kelvin +++ ankh-to-kelvin |= =ankh !< weft q:(need (~(get an:cloy ankh) /sys/kelvin)) :: +++ read-kelvin + |= [=ship =desk =aeon] + ^- weft + =/ her (scot %p ship) + =/ syd (scot %tas desk) + =/ yon (scot %ud aeon) + :: + =/ dom .^(dome cs/~[her syd yon]) + =/ tak (scot %uv (~(got by hit.dom) let.dom)) + =/ yak .^(yaki cs/~[her syd yon %taki tak]) + =/ lob (scot %uv (~(got by q.yak) /sys/kelvin)) + =/ bob .^(blob cs/~[her syd yon %blob lob]) + :: + ;; weft + ?- -.bob + %direct q.q.bob + %delta q.r.bob + == +:: ++ poke |= [=mark =vase] ?+ mark ~|([%poke-kiln-bad-mark mark] !!) From 070bbd0917e7c5e4e6a615085345f94afb2f4eaa Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Sat, 10 Jul 2021 08:56:25 -0400 Subject: [PATCH 027/595] clay: use --- pkg/arvo/sys/vane/clay.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index bc67d9190..5e12ff31d 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -1570,7 +1570,7 @@ :: ++ get-kelvin |= =yoki - ;; [@tas @ud] + ;; weft |^ ?- -.yoki %| %- lobe-to-noun From e4dd4c1a0fb1f4e54b404f2402a397549f85d456 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Tue, 13 Jul 2021 17:35:15 +0300 Subject: [PATCH 028/595] kiln: check clay %find product --- pkg/arvo/lib/hood/kiln.hoon | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 4f6f3bfae..364825331 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -264,6 +264,9 @@ ++ take-find |= syn=sign-arvo ?> ?=(%writ +<.syn) + ?~ p.syn + ~> %slog.0^leaf/"kiln: cancelled (1) install into {here}, aborting" + vats(ark (~(del by ark) loc)) ~> %slog.0^leaf/"kiln: activated install into {here}" (emit sync:pass) :: From 5986fe67f5bb0a4abf85dd49abc9e0036ef7de30 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Tue, 13 Jul 2021 17:35:54 +0300 Subject: [PATCH 029/595] gall: no-op on %slay,%idle for missing agent --- pkg/arvo/sys/vane/gall.hoon | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index 957a981d4..f4cccf6b5 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -825,8 +825,11 @@ ++ mo-fade |= [dap=term style=?(%slay %idle %jolt)] ^+ mo-core - =/ =routes [disclosing=~ attributing=our] - =/ app (ap-abed:ap dap routes) + ?. |(=(%jolt style) (~(has by yokes.state) dap)) + mo-core + =/ app + ~_ leaf/"gall: fade { + + + + + diff --git a/pkg/grid/src/favicon.svg b/pkg/grid/src/favicon.svg deleted file mode 100644 index de4aeddc1..000000000 --- a/pkg/grid/src/favicon.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/pkg/grid/src/nav/Leap.tsx b/pkg/grid/src/nav/Leap.tsx index d754b1793..25c4882a1 100644 --- a/pkg/grid/src/nav/Leap.tsx +++ b/pkg/grid/src/nav/Leap.tsx @@ -38,6 +38,16 @@ type LeapProps = { shouldDim: boolean; } & HTMLAttributes; +function normalizeMatchString(match: string, keepAltChars: boolean): string { + let normalizedString = match.toLocaleLowerCase().trim(); + + if (!keepAltChars) { + normalizedString = normalizedString.replace(/[^\w]/, ''); + } + + return normalizedString; +} + export const Leap = React.forwardRef( ({ menu, dropdown, navOpen, shouldDim, className }: LeapProps, ref) => { const { push } = useHistory(); @@ -78,11 +88,12 @@ export const Leap = React.forwardRef( const getMatch = useCallback( (value: string) => { - const normValue = value.toLocaleLowerCase(); + const onlySymbols = !value.match(/[\w]/g); + const normValue = normalizeMatchString(value, onlySymbols); return matches.find( (m) => - m.display?.toLocaleLowerCase().startsWith(normValue) || - m.value.toLocaleLowerCase().startsWith(normValue) + (m.display && normalizeMatchString(m.display, onlySymbols).startsWith(normValue)) || + normalizeMatchString(m.value, onlySymbols).startsWith(normValue) ); }, [matches] @@ -121,7 +132,10 @@ export const Leap = React.forwardRef( if (matchValue && inputRef.current && !isDeletion) { inputRef.current.value = matchValue; - inputRef.current.setSelectionRange(value.length, matchValue.length); + const start = matchValue.startsWith(value) + ? value.length + : matchValue.substring(0, matchValue.indexOf(value)).length + value.length; + inputRef.current.setSelectionRange(start, matchValue.length); useLeapStore.setState({ rawInput: matchValue, selectedMatch: inputMatch diff --git a/pkg/grid/src/nav/search/Apps.tsx b/pkg/grid/src/nav/search/Apps.tsx index 78b014189..4d19008d7 100644 --- a/pkg/grid/src/nav/search/Apps.tsx +++ b/pkg/grid/src/nav/search/Apps.tsx @@ -6,6 +6,7 @@ import { ShipName } from '../../components/ShipName'; import useDocketState, { useAllyTreaties } from '../../state/docket'; import { useLeapStore } from '../Nav'; import { AppList } from '../../components/AppList'; +import { addRecentDev } from './Home'; type AppsProps = RouteComponentProps<{ ship: string }>; @@ -68,6 +69,7 @@ export const Apps = ({ match }: AppsProps) => { useEffect(() => { if (provider) { useDocketState.getState().fetchAllyTreaties(provider); + addRecentDev(provider); } }, [provider]); From e6fcaafe3c7808e63adce350a74e2f86c13b2e59 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Wed, 15 Sep 2021 11:42:22 -0500 Subject: [PATCH 287/595] ci: allows us to deploy frontends to vercel --- .vercelignore | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .vercelignore diff --git a/.vercelignore b/.vercelignore new file mode 100644 index 000000000..6203dc090 --- /dev/null +++ b/.vercelignore @@ -0,0 +1,16 @@ +bin +doc +extras +nix +pkg/arvo +pkg/base-dev +pkg/docker-image +pkg/ent +pkg/garden +pkg/garden-dev +pkg/ge-additions +pkg/herb +pkg/hs +pkg/libaes_siv +pkg/urbit +sh \ No newline at end of file From 577ec24459c2f16cf7545822af8418bd301b9477 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Wed, 15 Sep 2021 22:57:08 +0300 Subject: [PATCH 288/595] kiln: WIP listen to %warp's too --- pkg/arvo/lib/hood/kiln.hoon | 32 +++++++++++++++++++++++--------- pkg/base-dev/sur/hood.hoon | 2 +- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index d0806a841..453edd821 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -366,6 +366,8 @@ =/ =aeon (dec aeon.rail.rak) %+ clay-card %merge-kids [%merg %kids ship.rail.rak desk.rail.rak ud+aeon germ] + ++ listen + (clay-card %listen %warp our loc `[%next %z da+now /]) ++ clay-card |= [step=@tas =task:clay] ^- card:agent:gall @@ -419,7 +421,7 @@ rak [[paused=| her rem *aeon] next=~ rein:(fall got *arak)] == ~> %slog.0^leaf/"kiln: beginning install into {here}" - (emit find:pass) + (emit listen:pass find:pass) :: +reset: resync after failure :: ++ reset @@ -582,6 +584,7 @@ %find (take-find syn) %sync (take-sync syn) %download (take-download syn) + %listen (take-listen syn) %merge-main (take-merge-main syn) %merge-kids (take-merge-kids syn) == @@ -688,6 +691,24 @@ (emil ~[merge-main sync-ud]:pass) -- :: + ++ take-listen + |= syn=sign-arvo + ^+ vats + ?> ?=([@ %writ ~ *] syn) + =. vats (emit listen:pass) + take-commit + :: + ++ take-commit + ^+ vats + ~> %slog.0^leaf/"kiln: commit detected at {here}" + =. vats (emit (diff:give %commit loc rak)) + =? vats liv.rein.rak + (update-running-apps (get-apps-diff our loc now rein.rak)) + ?. =(%base loc) + vats + ~> %slog.0^leaf/"kiln: merging %base into %kids at {<[- +]:weft:(head next.rak)>}" + (emit merge-kids:pass) + :: ++ take-merge-main |= syn=sign-arvo ^+ vats @@ -702,14 +723,7 @@ %- (slog leaf/- p.p.syn) =. vats (emit (diff:give %merge-fail loc rak p.p.syn)) vats - ~> %slog.0^leaf/"kiln: merge into {here} succeeded" - =. vats (emit (diff:give %merge loc rak)) - =? vats liv.rein.rak - (update-running-apps (get-apps-diff our loc now rein.rak)) - ?. =(%base loc) - vats - ~> %slog.0^leaf/"kiln: bumping {}" :: TODO print next - (emit merge-kids:pass) + take-commit :: ++ take-merge-kids |= syn=sign-arvo diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index 6de54e571..5ee46f3a2 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -7,7 +7,7 @@ +$ diff $% [%block =desk =arak =weft blockers=(set desk)] [%reset =desk =arak] - [%merge =desk =arak] + [%commit =desk =arak] [%merge-sunk =desk =arak =tang] [%merge-fail =desk =arak =tang] [%suspend =desk =arak] From 326a14f2372f1a839e16b91ef99689b467d562c7 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Wed, 15 Sep 2021 16:26:43 -0500 Subject: [PATCH 289/595] prefs: adding support for enabling/disabling app updates --- pkg/grid/src/nav/SystemPreferences.tsx | 95 +++++++++++++---------- pkg/grid/src/nav/preferences/AppPrefs.tsx | 33 ++++++++ pkg/grid/src/state/kiln.ts | 6 +- pkg/grid/src/state/mock-data.ts | 3 +- 4 files changed, 94 insertions(+), 43 deletions(-) create mode 100644 pkg/grid/src/nav/preferences/AppPrefs.tsx diff --git a/pkg/grid/src/nav/SystemPreferences.tsx b/pkg/grid/src/nav/SystemPreferences.tsx index 82773a506..17aeb1f9f 100644 --- a/pkg/grid/src/nav/SystemPreferences.tsx +++ b/pkg/grid/src/nav/SystemPreferences.tsx @@ -1,4 +1,4 @@ -import React, { useCallback } from 'react'; +import React, { PropsWithChildren, useCallback } from 'react'; import { Link, Route, RouteComponentProps, Switch, useRouteMatch } from 'react-router-dom'; import classNames from 'classnames'; import { NotificationPrefs } from './preferences/NotificationPrefs'; @@ -6,32 +6,30 @@ import { SystemUpdatePrefs } from './preferences/SystemUpdatePrefs'; import notificationsSVG from '../assets/notifications.svg'; import systemUpdatesSVG from '../assets/system-updates.svg'; import { InterfacePrefs } from './preferences/InterfacePrefs'; +import { useCharges } from '../state/docket'; +import { AppPrefs } from './preferences/AppPrefs'; +import { DocketImage } from '../components/DocketImage'; -interface SystemPreferencesSectionProps extends RouteComponentProps<{ submenu: string }> { - submenu: string; +interface SystemPreferencesSectionProps { + url: string; active: boolean; - text: string; - icon?: string; } function SystemPreferencesSection({ - match, - submenu, + url, active, - icon, - text -}: SystemPreferencesSectionProps) { + children +}: PropsWithChildren) { return (
  • - {icon ? : null} - {text} + {children}
  • ); @@ -39,53 +37,72 @@ function SystemPreferencesSection({ export const SystemPreferences = (props: RouteComponentProps<{ submenu: string }>) => { const { match } = props; - const subMatch = useRouteMatch<{ submenu: string }>(`${match.url}/:submenu`); + const subMatch = useRouteMatch<{ submenu: string; desk?: string }>( + `${match.url}/:submenu/:desk?` + ); + const charges = useCharges(); const matchSub = useCallback( - (target: string) => { + (target: string, desk?: string) => { if (!subMatch && target === 'notifications') { return true; } + if (desk && subMatch?.params.desk !== desk) { + return false; + } + return subMatch?.params.submenu === target; }, [match, subMatch] ); + const subUrl = useCallback((submenu: string) => `${match.url}/${submenu}`, [match]); + return (
    -