mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-25 16:05:27 +03:00
gall,drum,kiln: WIP start agents in kiln
This commit is contained in:
parent
5e496e920e
commit
4cb5cd0ba1
@ -115,7 +115,6 @@
|
||||
|= [=wire syn=sign-arvo]
|
||||
^- step:agent:gall
|
||||
?+ wire ~|([%hood-bad-wire wire] !!)
|
||||
[%drum *] =^(c drum.state (take-arvo:drum-core t.wire syn) [c this])
|
||||
[%helm *] =^(c helm.state (take-arvo:helm-core t.wire syn) [c this])
|
||||
[%kiln *] =^(c kiln.state (take-arvo:kiln-core t.wire syn) [c this])
|
||||
==
|
||||
|
@ -370,7 +370,7 @@
|
||||
:_ state
|
||||
:_ ~
|
||||
:+ %pass /build/[new-tid]
|
||||
[%arvo %c %warp our.bowl %home ~ %sing %a da+now.bowl pax]
|
||||
[%arvo %c %warp our.bowl %base ~ %sing %a da+now.bowl pax]
|
||||
::
|
||||
++ handle-build
|
||||
~/ %handle-build
|
||||
@ -478,7 +478,7 @@
|
||||
=/ moz (thread-say-fail tid term tang)
|
||||
?. ?=([~ %build *] (~(get by starting.state) yarn))
|
||||
moz
|
||||
:_(moz [%pass /build/[tid] %arvo %c %warp our.bowl %home ~])
|
||||
:_(moz [%pass /build/[tid] %arvo %c %warp our.bowl %base ~])
|
||||
::
|
||||
++ thread-say-fail
|
||||
|= [=tid =term =tang]
|
||||
|
@ -1,28 +1,35 @@
|
||||
/- *sole
|
||||
/+ sole
|
||||
|%
|
||||
+$ any-state $%(state state-2)
|
||||
+$ state [%3 pith-3]
|
||||
+$ any-state
|
||||
$% state-4
|
||||
state-3
|
||||
state-2
|
||||
==
|
||||
+$ state state-4
|
||||
+$ state-4 [%4 pith-4]
|
||||
+$ state-3 [%3 pith-3]
|
||||
+$ state-2 [%2 pith-2]
|
||||
::
|
||||
+$ pith-4
|
||||
$: eel=(set gill:gall) :: connect to
|
||||
bin=(map bone source) :: terminals
|
||||
== ::
|
||||
::
|
||||
++ pith-3 ::
|
||||
$: eel=(set gill:gall) :: connect to
|
||||
ray=(map dude:gall desk) ::
|
||||
fur=(map dude:gall (unit server)) :: servers
|
||||
fur=(map dude:gall (unit *)) :: servers
|
||||
bin=(map bone source) :: terminals
|
||||
== ::
|
||||
:: ::
|
||||
++ pith-2 ::
|
||||
$: eel=(set gill:gall) :: connect to
|
||||
ray=(set well:gall) ::
|
||||
fur=(map dude:gall (unit server)) :: servers
|
||||
fur=(map dude:gall (unit *)) :: servers
|
||||
bin=(map bone source) :: terminals
|
||||
== ::
|
||||
:: ::
|
||||
++ server :: running server
|
||||
$: syd=desk :: app identity
|
||||
cas=case :: boot case
|
||||
== ::
|
||||
++ kill :: kill ring
|
||||
$: pos=@ud :: ring position
|
||||
num=@ud :: number of entries
|
||||
@ -62,69 +69,6 @@
|
||||
:::: :: ::
|
||||
:: :: ::
|
||||
|%
|
||||
++ deft-apes :: default servers
|
||||
|= [our=ship lit=?]
|
||||
%- ~(gas by *(map dap=term desk))
|
||||
^- (list well:gall)
|
||||
:: boot all default apps off the base desk
|
||||
::
|
||||
=- (turn - |=(a=term [a %base]))
|
||||
^- (list term)
|
||||
%+ welp
|
||||
:~ %dojo
|
||||
%spider
|
||||
%eth-watcher
|
||||
%azimuth-tracker
|
||||
%ping
|
||||
%goad
|
||||
%lens
|
||||
==
|
||||
?: lit
|
||||
~
|
||||
:~ %acme
|
||||
%clock
|
||||
%dojo
|
||||
%launch
|
||||
%publish
|
||||
%weather
|
||||
%group-store
|
||||
%group-pull-hook
|
||||
%group-push-hook
|
||||
%invite-store
|
||||
%invite-hook
|
||||
%chat-store
|
||||
%chat-hook
|
||||
%chat-view
|
||||
%chat-cli
|
||||
%herm
|
||||
%contact-store
|
||||
%contact-push-hook
|
||||
%contact-pull-hook
|
||||
%metadata-store
|
||||
%s3-store
|
||||
%file-server
|
||||
%glob
|
||||
%graph-store
|
||||
%graph-pull-hook
|
||||
%graph-push-hook
|
||||
%hark-store
|
||||
%hark-graph-hook
|
||||
%hark-group-hook
|
||||
%hark-chat-hook
|
||||
%observe-hook
|
||||
%metadata-push-hook
|
||||
%metadata-pull-hook
|
||||
%group-view
|
||||
%settings-store
|
||||
%dm-hook
|
||||
==
|
||||
::
|
||||
++ deft-fish :: default connects
|
||||
|= our=ship
|
||||
%- ~(gas in *(set gill:gall))
|
||||
^- (list gill:gall)
|
||||
[[our %dojo] [our %chat-cli]~]
|
||||
::
|
||||
++ en-gill :: gill to wire
|
||||
|= gyl=gill:gall
|
||||
^- wire
|
||||
@ -147,7 +91,7 @@
|
||||
++ this .
|
||||
+$ state ^state :: proxy
|
||||
+$ any-state ^any-state :: proxy
|
||||
++ on-init se-abet:this(eel (deft-fish our.hid))
|
||||
++ on-init se-abet
|
||||
++ diff-sole-effect-phat :: app event
|
||||
|= [way=wire fec=sole-effect]
|
||||
=< se-abet =< se-view
|
||||
@ -162,17 +106,6 @@
|
||||
=< se-abet =< se-view
|
||||
(se-text "[{<src.hid>}, driving {<our.hid>}]")
|
||||
::
|
||||
++ poke-set-boot-apps ::
|
||||
|= lit=?
|
||||
^- (quip card:agent:gall ^state)
|
||||
:: We do not run se-abet:se-view here because that starts the apps,
|
||||
:: and some apps are not ready to start (eg Talk crashes because the
|
||||
:: terminal has width 0). It appears the first message to drum must
|
||||
:: be the peer.
|
||||
::
|
||||
=. ray (deft-apes our.hid lit)
|
||||
[~ sat]
|
||||
::
|
||||
++ poke-dill-belt :: terminal event
|
||||
|= bet=dill-belt:dill
|
||||
=< se-abet =< se-view
|
||||
@ -182,16 +115,6 @@
|
||||
|= bit=dill-blit:dill
|
||||
se-abet:(se-blit-sys bit)
|
||||
::
|
||||
++ poke-start :: start app
|
||||
|= wel=well:gall
|
||||
=< se-abet =< se-view
|
||||
(se-born & wel)
|
||||
::
|
||||
++ poke-fade :: fade app
|
||||
|= wel=well:gall
|
||||
=< se-abet =< se-view
|
||||
(se-fade wel)
|
||||
::
|
||||
++ poke-link :: connect app
|
||||
|= gyl=gill:gall
|
||||
=< se-abet =< se-view
|
||||
@ -218,58 +141,18 @@
|
||||
%drum-exit =;(f (f !<(_+<.f vase)) poke-exit)
|
||||
%drum-link =;(f (f !<(_+<.f vase)) poke-link)
|
||||
%drum-put =;(f (f !<(_+<.f vase)) poke-put)
|
||||
%drum-set-boot-apps =;(f (f !<(_+<.f vase)) poke-set-boot-apps)
|
||||
%drum-start =;(f (f !<(_+<.f vase)) poke-start)
|
||||
%drum-fade =;(f (f !<(_+<.f vase)) poke-fade)
|
||||
%drum-unlink =;(f (f !<(_+<.f vase)) poke-unlink)
|
||||
==
|
||||
::
|
||||
++ on-load
|
||||
|= [hood-version=@ud old=any-state]
|
||||
=< se-abet =< se-view
|
||||
=. sat old(- %3)
|
||||
=? old ?=(%2 -.old) [%4 [eel bin]:old]
|
||||
=? old ?=(%3 -.old) [%4 [eel bin]:old]
|
||||
::
|
||||
?> ?=(%4 -.old)
|
||||
=. sat old
|
||||
=. dev (~(gut by bin) ost *source)
|
||||
=? ..on-load (lte hood-version %4)
|
||||
~> %slog.0^leaf+"drum: starting os1 agents"
|
||||
=> (se-born | %base %s3-store)
|
||||
=> (se-born | %base %contact-view)
|
||||
=> (se-born | %base %contact-hook)
|
||||
=> (se-born | %base %contact-store)
|
||||
=> (se-born | %base %metadata-hook)
|
||||
=> (se-born | %base %metadata-store)
|
||||
=> (se-born | %base %goad)
|
||||
~> %slog.0^leaf+"drum: resubscribing to %dojo and %chat-cli"
|
||||
=> (se-drop:(se-pull our.hid %dojo) | our.hid %dojo)
|
||||
(se-drop:(se-pull our.hid %chat-cli) | our.hid %chat-cli)
|
||||
=? ..on-load (lte hood-version %5)
|
||||
(se-born | %base %file-server)
|
||||
=? ..on-load (lte hood-version %7)
|
||||
(se-born | %base %glob)
|
||||
=? ..on-load (lte hood-version %8)
|
||||
=> (se-born | %base %group-push-hook)
|
||||
(se-born | %base %group-pull-hook)
|
||||
=? ..on-load (lte hood-version %9)
|
||||
(se-born | %base %graph-store)
|
||||
=? ..on-load (lte hood-version %10)
|
||||
=> (se-born | %base %graph-push-hook)
|
||||
(se-born | %base %graph-pull-hook)
|
||||
=? ..on-load (lte hood-version %11)
|
||||
=> (se-born | %base %hark-graph-hook)
|
||||
=> (se-born | %base %hark-group-hook)
|
||||
=> (se-born | %base %hark-chat-hook)
|
||||
=> (se-born | %base %hark-store)
|
||||
=> (se-born | %base %observe-hook)
|
||||
=> (se-born | %base %metadata-pull-hook)
|
||||
=> (se-born | %base %metadata-push-hook)
|
||||
(se-born | %base %herm)
|
||||
=? ..on-load (lte hood-version %12)
|
||||
=> (se-born | %base %contact-push-hook)
|
||||
=> (se-born | %base %contact-pull-hook)
|
||||
=> (se-born | %base %settings-store)
|
||||
(se-born | %base %group-view)
|
||||
=? ..on-load (lte hood-version %13)
|
||||
=> (se-born | %base %dm-hook)
|
||||
.(ray (~(gas by ray) (turn ~(tap in ray) |=(=well:gall [q.well p.well]))))
|
||||
..on-load
|
||||
::
|
||||
++ reap-phat :: ack connect
|
||||
@ -283,12 +166,6 @@
|
||||
::
|
||||
(se-drop & gyl)
|
||||
::
|
||||
++ take-arvo
|
||||
|= [=wire =sign-arvo]
|
||||
%+ take-onto wire
|
||||
?> ?=(%onto +<.sign-arvo)
|
||||
+>.sign-arvo
|
||||
::
|
||||
++ take-coup-phat :: ack poke
|
||||
|= [way=wire saw=(unit tang)]
|
||||
=< se-abet =< se-view
|
||||
@ -299,19 +176,6 @@
|
||||
:_ u.saw
|
||||
>[%drum-coup-fail src.hid gyl]<
|
||||
::
|
||||
++ take-onto :: ack start
|
||||
|= [way=wire saw=(each suss:gall tang)]
|
||||
=< se-abet =< se-view
|
||||
?> ?=([@ @ ~] way)
|
||||
?> (~(has by fur) i.t.way)
|
||||
=/ wel=well:gall [i.way i.t.way]
|
||||
?- saw
|
||||
[%| *] (se-dump p.saw)
|
||||
[%& *] ?> =(q.wel p.p.saw)
|
||||
:: =. +>.$ (se-text "live {<p.saw>}")
|
||||
+>.$(fur (~(put by fur) q.wel `[p.wel %da r.p.saw]))
|
||||
==
|
||||
::
|
||||
++ take-agent
|
||||
|= [=wire =sign:agent:gall]
|
||||
?+ wire ~|([%drum-bad-take-agent wire -.sign] !!)
|
||||
@ -338,7 +202,7 @@
|
||||
:: :: ::
|
||||
++ se-abet :: resolve
|
||||
^- (quip card:agent:gall state)
|
||||
=. . se-subze:se-adze:se-subit:se-adit
|
||||
=. . se-subze:se-adze
|
||||
:_ sat(bin (~(put by bin) ost dev))
|
||||
^- (list card:agent:gall)
|
||||
?~ biz (flop moz)
|
||||
@ -346,71 +210,6 @@
|
||||
=/ =dill-blit:dill ?~(t.biz i.biz [%mor (flop biz)])
|
||||
[%give %fact ~[/drum] %dill-blit !>(dill-blit)]
|
||||
::
|
||||
++ se-adit :: update servers
|
||||
^+ this
|
||||
|^
|
||||
=/ servers=(list [dap=term =desk])
|
||||
(sort ~(tap by ray) sort-by-priorities)
|
||||
|-
|
||||
?~ servers
|
||||
this
|
||||
=/ wel=well:gall [+ -]:i.servers
|
||||
=/ =wire [%drum p.wel q.wel ~]
|
||||
=/ hig=(unit (unit server))
|
||||
(~(get by fur) q.wel)
|
||||
?: &(?=(^ hig) |(?=(~ u.hig) =(p.wel syd.u.u.hig)))
|
||||
$(servers t.servers)
|
||||
=. fur
|
||||
(~(put by fur) q.wel ~)
|
||||
=. this
|
||||
(se-text "activated app {(trip p.wel)}/{(trip q.wel)}")
|
||||
=. this
|
||||
%- se-emit
|
||||
[%pass wire %arvo %g %conf wel]
|
||||
$(servers t.servers)
|
||||
::
|
||||
++ priorities
|
||||
^- (list (set @))
|
||||
:~
|
||||
:: set up stores with priority: depended on, but never depending
|
||||
%- sy
|
||||
:~ %chat-store
|
||||
%contact-store
|
||||
%group-store
|
||||
%invite-store
|
||||
%metadata-store
|
||||
==
|
||||
:: ensure chat-cli can sub to invites
|
||||
:: and file server can receive pokes
|
||||
(sy ~[%chat-hook %file-server])
|
||||
==
|
||||
++ sort-by-priorities
|
||||
=/ priorities priorities
|
||||
|= [[desk a=term] [desk b=term]]
|
||||
^- ?
|
||||
?~ priorities
|
||||
(aor a b)
|
||||
=* priority i.priorities
|
||||
?: &((~(has in priority) a) (~(has in priority) b))
|
||||
(aor a b)
|
||||
?: (~(has in priority) a)
|
||||
%.y
|
||||
?: (~(has in priority) b)
|
||||
%.n
|
||||
$(priorities t.priorities)
|
||||
--
|
||||
::
|
||||
++ se-subit :: downdate servers
|
||||
=/ ruf=(list term) ~(tap in ~(key by fur))
|
||||
|- ^+ this
|
||||
?~ ruf
|
||||
this
|
||||
?: (~(has by ray) i.ruf)
|
||||
$(ruf t.ruf)
|
||||
=/ wire [%drum %fade i.ruf ~]
|
||||
=. this (se-emit %pass wire %arvo %g %fade i.ruf %slay)
|
||||
$(ruf t.ruf, fur (~(del by fur) i.ruf))
|
||||
::
|
||||
++ se-adze :: update connections
|
||||
^+ .
|
||||
%+ roll
|
||||
@ -495,26 +294,6 @@
|
||||
(se-blit %bel ~)
|
||||
ta-abet:(ta-belt:(se-tame u.gul) bet)
|
||||
::
|
||||
++ se-born :: new server
|
||||
|= [print-on-repeat=? wel=well:gall]
|
||||
^+ +>
|
||||
?: (~(has by ray) q.wel)
|
||||
?. print-on-repeat +>
|
||||
(se-text "[already running {<p.wel>}/{<q.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 by ray) q.wel)
|
||||
(se-text "[fade not running {<p.wel>}/{<q.wel>}]")
|
||||
%= +>
|
||||
ray (~(del by ray) q.wel)
|
||||
==
|
||||
::
|
||||
++ se-drop :: disconnect
|
||||
|= [pej=? gyl=gill:gall]
|
||||
^+ +>
|
||||
@ -755,8 +534,9 @@
|
||||
%c ta-bel
|
||||
%d ?^ buf.say.inp
|
||||
ta-del
|
||||
?: (~(has in (deft-fish our.hid)) gyl)
|
||||
+>(..ta (se-blit qit+~)) :: quit pier
|
||||
:: TODO: reinstate?
|
||||
::?: (~(has in (deft-fish our.hid)) gyl)
|
||||
:: +>(..ta (se-blit qit+~)) :: quit pier
|
||||
+>(..ta (se-klin gyl)) :: unlink app
|
||||
%e +>(pos.inp (lent buf.say.inp))
|
||||
%f (ta-aro %r)
|
||||
|
@ -1,3 +1,4 @@
|
||||
jolt *bill
|
||||
/+ version
|
||||
=, clay
|
||||
=, space:userlib
|
||||
@ -15,7 +16,6 @@
|
||||
+$ 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] ::
|
||||
== ::
|
||||
@ -37,11 +37,23 @@
|
||||
==
|
||||
:: $arak: foreign vat tracker
|
||||
::
|
||||
:: .next is a list of pending commits with future kelvins
|
||||
::
|
||||
+$ arak
|
||||
$: =ship
|
||||
=desk
|
||||
=aeon
|
||||
next=(list [=aeon =weft])
|
||||
=rein
|
||||
==
|
||||
:: $rein: diff from desk manifest
|
||||
::
|
||||
:: .add: agents not in manifest that should be running
|
||||
:: .sub: agents in manifest that should not be running
|
||||
::
|
||||
+$ rein
|
||||
$: add=(set dude:gall)
|
||||
sub=(set dude:gall)
|
||||
==
|
||||
+$ per-desk :: per-desk state
|
||||
$: auto=? :: escalate on failure
|
||||
@ -146,7 +158,7 @@
|
||||
|= =path
|
||||
^- (unit (unit cage))
|
||||
?+ path [~ ~]
|
||||
[%x %kiln %ota ~] ``noun+!>(ota)
|
||||
[%x %kiln %ark ~] ``noun+!>(ark)
|
||||
[%x %kiln %our ~] ``noun+!>(our)
|
||||
[%x %kiln %base-hash ~]
|
||||
=/ ver (base-hash:version our now)
|
||||
@ -200,9 +212,9 @@
|
||||
~> %slog.0^leaf/"kiln: uninstalling {here}"
|
||||
=. vats
|
||||
%- emil
|
||||
%+ turn (get-apps lac)
|
||||
%+ turn (get-apps-have lac)
|
||||
|= =dude:gall
|
||||
[%pass /kiln/vats/uninstall %arvo %g %fade dude %idle]
|
||||
[%pass /kiln/vats/uninstall %arvo %g %idle dude]
|
||||
::
|
||||
kiln(ark (~(del by ark) lac))
|
||||
:: +install: set up desk sync to .lac to install all apps from [her rem]
|
||||
@ -216,7 +228,7 @@
|
||||
vats
|
||||
=? kiln ?=(^ got) (uninstall lac)
|
||||
=: loc lac
|
||||
rak [her rem *aeon next=~]
|
||||
rak [her rem *aeon next=~ *rein]
|
||||
==
|
||||
~> %slog.0^leaf/"kiln: beginning install into {here}"
|
||||
(emit find:pass)
|
||||
@ -259,10 +271,12 @@
|
||||
%download (take-download syn)
|
||||
%merge-main (take-merge-main syn)
|
||||
%merge-kids (take-merge-kids syn)
|
||||
%jolt (take-onto syn)
|
||||
==
|
||||
::
|
||||
++ take-find
|
||||
|= syn=sign-arvo
|
||||
^+ vats
|
||||
?> ?=(%writ +<.syn)
|
||||
?~ p.syn
|
||||
~> %slog.0^leaf/"kiln: cancelled (1) install into {here}, aborting"
|
||||
@ -272,6 +286,7 @@
|
||||
::
|
||||
++ take-sync
|
||||
|= syn=sign-arvo
|
||||
^+ vats
|
||||
?> ?=(%writ +<.syn)
|
||||
?~ p.syn
|
||||
~> %slog.0^leaf/"kiln: cancelled (1) install into {here}, retrying"
|
||||
@ -282,6 +297,7 @@
|
||||
::
|
||||
++ take-download
|
||||
|= syn=sign-arvo
|
||||
^+ vats
|
||||
?> ?=(%writ +<.syn)
|
||||
?~ p.syn
|
||||
~> %slog.0^leaf/"kiln: cancelled (2) install into {here}, retrying"
|
||||
@ -320,6 +336,7 @@
|
||||
::
|
||||
++ take-merge-main
|
||||
|= syn=sign-arvo
|
||||
^+ vats
|
||||
?> ?=(%mere +<.syn)
|
||||
?: ?=([%| %ali-unavailable *] p.syn)
|
||||
=+ "kiln: merge into {here} failed, maybe because sunk; restarting"
|
||||
@ -332,9 +349,9 @@
|
||||
=. vats
|
||||
~> %slog.0^leaf/"merge into {here} succeeded; reviving agents"
|
||||
%- emil
|
||||
%+ turn (get-apps loc)
|
||||
%+ turn (get-apps-want loc rein.rak)
|
||||
|= =dude:gall
|
||||
[%pass /kiln/fade/[dude] %arvo %g %fade dude %jolt]
|
||||
[%pass /kiln/jolt/[dude] %arvo %g %jolt loc dude]
|
||||
?. =(%base loc)
|
||||
vats
|
||||
=. kiln (bump (sy %base %kids ~))
|
||||
@ -342,6 +359,7 @@
|
||||
::
|
||||
++ take-merge-kids
|
||||
|= syn=sign-arvo
|
||||
^+ vats
|
||||
?> ?=(%mere +<.syn)
|
||||
?: ?=([%| %ali-unavailable *] p.syn)
|
||||
~> %slog.0^leaf/"kiln: OTA to %kids failed, maybe peer sunk; restarting"
|
||||
@ -357,6 +375,15 @@
|
||||
merge-kids-fail/[rak p.p.syn]
|
||||
==
|
||||
(emit %give %fact [/vats]~ %kiln-vats-diff !>(fact))
|
||||
::
|
||||
++ take-onto
|
||||
|= syn=sign-arvo
|
||||
^+ vats
|
||||
=/ onto ?>(?=(%onto -.syn) p.syn)
|
||||
?- -.onto
|
||||
%& vats
|
||||
%| (mean p.onto) :: TODO: kill arvo event on failure
|
||||
==
|
||||
--
|
||||
:: +get-ankh: extract $ankh from clay %v response $rant
|
||||
::
|
||||
@ -365,13 +392,25 @@
|
||||
^- ankh
|
||||
?> ?=(%dome p.r.rant)
|
||||
!<(ankh q.r.rant)
|
||||
:: +get-apps: find which apps Gall is running on a desk
|
||||
:: +get-apps-have: find which apps Gall is running on a desk
|
||||
::
|
||||
++ get-apps
|
||||
++ get-apps-have
|
||||
|= =desk
|
||||
^- (list dude:gall)
|
||||
%~ tap in
|
||||
.^((set dude:gall) ge+/(scot %p our)/[desk]/(scot %da now))
|
||||
:: +get-apps-want: find which apps should be running on a desk
|
||||
::
|
||||
:: TODO: preserve list order?
|
||||
::
|
||||
++ get-apps-want
|
||||
|= [=desk =rein]
|
||||
^- (list dude:gall)
|
||||
=/ duz (read-apes .^(=bill cx+(weld pax /desk/bill)))
|
||||
=/ daz ~(tap in duz)
|
||||
=. daz (~(dif in daz) sub.rein)
|
||||
=. daz (~(uni in daz) add.rein)
|
||||
~(tap in daz)
|
||||
:: +get-blockers: find desks that would block a kernel update
|
||||
::
|
||||
++ get-blockers
|
||||
|
@ -4,4 +4,20 @@
|
||||
$% [%apes duz=(list dude:gall)]
|
||||
[%fish duz=(list dude:gall)]
|
||||
==
|
||||
::
|
||||
++ read-apes
|
||||
|= =bill
|
||||
^- (list dude:gall)
|
||||
?~ bill ~
|
||||
?: ?=(%apes -.i.bill)
|
||||
duz.i.bill
|
||||
$(bill t.bill)
|
||||
::
|
||||
++ read-fish
|
||||
|= =bill
|
||||
^- (list dude:gall)
|
||||
?~ bill ~
|
||||
?: ?=(%fish -.i.bill)
|
||||
duz.i.bill
|
||||
$(bill t.bill)
|
||||
--
|
||||
|
@ -1639,11 +1639,11 @@
|
||||
== ::
|
||||
+$ task :: incoming request
|
||||
$~ [%vega ~] ::
|
||||
$% [%conf =desk dap=term] :: start agent
|
||||
[%deal p=sock q=term r=deal] :: full transmission
|
||||
[%goad force=? agent=(unit dude)] :: rebuild agent(s)
|
||||
$% [%deal p=sock q=term r=deal] :: full transmission
|
||||
[%sear =ship] :: clear pending queues
|
||||
[%fade dap=term style=?(%slay %idle %jolt)] :: put app to sleep
|
||||
[%jolt =desk =dude] :: (re)start agent
|
||||
[%idle =dude] :: suspend agent
|
||||
[%nuke =dude] :: delete agent
|
||||
$>(%init vane-task) :: set owner
|
||||
$>(%trim vane-task) :: trim state
|
||||
$>(%vega vane-task) :: report upgrade
|
||||
|
@ -52,7 +52,7 @@
|
||||
task:dill ::
|
||||
== ::
|
||||
$: %g ::
|
||||
$> $? %conf ::
|
||||
$> $? %jolt ::
|
||||
%deal ::
|
||||
%goad ::
|
||||
== ::
|
||||
@ -224,7 +224,7 @@
|
||||
=/ myt (flop (fall tem ~))
|
||||
=/ can (clan:title our)
|
||||
=. tem ~
|
||||
=. +> (pass / %g %conf %base ram)
|
||||
=. +> (pass / %g %jolt %base ram)
|
||||
=? +> ?=(?(%earl %duke %king) can)
|
||||
(ota sein %kids)
|
||||
:: make kids desk publicly readable, so syncs work.
|
||||
|
@ -302,18 +302,6 @@
|
||||
=/ gent (~(got by yokes.state) dap)
|
||||
=* desk q.beak.gent
|
||||
(mo-boot:(mo-abed control-duct.gent) dap ship desk)
|
||||
:: +mo-goad: rebuild agent(s)
|
||||
::
|
||||
++ mo-goad
|
||||
|= agent=(unit dude)
|
||||
^+ mo-core
|
||||
?^ agent
|
||||
~| goad-gone+u.agent
|
||||
(mo-reboot u.agent our)
|
||||
=/ agents=(list term) ~(tap in ~(key by yokes.state))
|
||||
|- ^+ mo-core
|
||||
?~ agents mo-core
|
||||
$(agents t.agents, mo-core (mo-reboot i.agents our))
|
||||
:: +mo-receive-core: receives an app core built by %ford.
|
||||
::
|
||||
:: Presuming we receive a good core, we first check to see if the agent
|
||||
@ -331,15 +319,19 @@
|
||||
|= [dap=term bek=beak =agent]
|
||||
^+ mo-core
|
||||
::
|
||||
=/ existing (~(get by yokes.state) dap)
|
||||
=/ re ?~(existing "" "re")
|
||||
~> %slog.[0 leaf+"gall: {re}loading {<dap>}"]
|
||||
=/ yak (~(get by yokes.state) dap)
|
||||
=/ tex
|
||||
?~ yak "installing"
|
||||
?- -.agent.u.yak
|
||||
%& "reloading"
|
||||
%| "reviving"
|
||||
==
|
||||
~> %slog.[0 leaf+"gall: {tex} {<dap>}"]
|
||||
::
|
||||
?^ existing
|
||||
=. yokes.state
|
||||
(~(put by yokes.state) dap u.existing(beak bek))
|
||||
=/ =routes [disclosing=~ attributing=our]
|
||||
=/ ap-core (ap-abed:ap dap routes)
|
||||
(~(put by yokes.state) dap u.yak(beak bek))
|
||||
=/ ap-core (ap-abed:ap dap `our)
|
||||
=. ap-core (ap-reinstall:ap-core agent)
|
||||
=. mo-core ap-abet:ap-core
|
||||
(mo-clear-queue dap)
|
||||
@ -355,8 +347,7 @@
|
||||
::
|
||||
=/ old mo-core
|
||||
=/ wag
|
||||
=/ =routes [disclosing=~ attributing=our]
|
||||
=/ ap-core (ap-abed:ap dap routes)
|
||||
=/ ap-core (ap-abed:ap dap `our)
|
||||
(ap-upgrade-state:ap-core ~)
|
||||
::
|
||||
=/ maybe-tang -.wag
|
||||
@ -617,8 +608,7 @@
|
||||
?~ agents mo-core
|
||||
::
|
||||
=. mo-core
|
||||
=/ =routes [disclosing=~ attributing=our]
|
||||
=/ app (ap-abed:ap i.agents routes)
|
||||
=/ app (ap-abed:ap i.agents `our)
|
||||
ap-abet:(ap-clog:app ship.sign-arvo)
|
||||
::
|
||||
$(agents t.agents)
|
||||
@ -820,25 +810,25 @@
|
||||
=? new-blocked !=(ship attributing.routes.mov)
|
||||
(~(put to new-blocked) mov)
|
||||
$
|
||||
:: +mo-fade: put app to sleep
|
||||
:: +mo-idle: put agent to sleep
|
||||
::
|
||||
++ mo-fade
|
||||
|= [dap=term style=?(%slay %idle %jolt)]
|
||||
++ mo-idle
|
||||
|= dap=dude
|
||||
^+ mo-core
|
||||
?. |(=(%jolt style) (~(has by yokes.state) dap))
|
||||
?. (~(has by yokes.state) dap)
|
||||
~> %slog.0^leaf/"gall: ignoring %idle for {<dap>}, not running"
|
||||
mo-core
|
||||
=/ app
|
||||
~_ leaf/"gall: fade {<style>} missing agent {<dap>}"
|
||||
(ap-abed:ap dap `routes`[disclosing=~ attributing=our])
|
||||
=. mo-core ap-abet:(ap-fade:app style)
|
||||
=. mo-core
|
||||
?- style
|
||||
%slay mo-core(yokes.state (~(del by yokes.state) dap))
|
||||
%idle mo-core
|
||||
%jolt (mo-boot dap our q.beak:(~(got by yokes.state) dap))
|
||||
==
|
||||
=? mo-core !?=(%jolt style) (mo-subscribe-to-agent-builds now)
|
||||
mo-core
|
||||
ap-abet:ap-idle:(ap-abed:ap dap `our)
|
||||
:: +mo-nuke: delete agent completely
|
||||
::
|
||||
++ mo-nuke
|
||||
|= dap=dude
|
||||
^+ mo-core
|
||||
?. (~(has by yokes.state) dap)
|
||||
~> %slog.0^leaf/"gall: ignoring %nuke for {<dap>}, not running"
|
||||
mo-core
|
||||
=. mo-core ap-abet:ap-nuke:(ap-abed:ap dap `our)
|
||||
mo-core(yokes.state (~(del by yokes.state) dap))
|
||||
:: +mo-peek: call to +ap-peek (which is not accessible outside of +mo).
|
||||
::
|
||||
++ mo-peek
|
||||
@ -1002,8 +992,7 @@
|
||||
?: ?=(%| -.res)
|
||||
(mean p.res)
|
||||
egg(p.old-state `agent`p.res)
|
||||
=/ =routes [disclosing=~ attributing=our]
|
||||
(ap-yoke dap routes yak)
|
||||
(ap-yoke dap `our yak)
|
||||
:: +ap-yoke: initialize agent state, starting from a $yoke
|
||||
::
|
||||
++ ap-yoke
|
||||
@ -1033,38 +1022,27 @@
|
||||
yokes.state running
|
||||
moves moves
|
||||
==
|
||||
:: +ap-fade: put affairs in order.
|
||||
::
|
||||
:: For %gone, remove all incoming and outgoing subscriptions.
|
||||
::
|
||||
++ ap-fade
|
||||
|= style=?(%slay %idle %jolt)
|
||||
++ ap-idle ap-core(agent.yoke |+on-save:ap-agent-core)
|
||||
++ ap-nuke
|
||||
^+ ap-core
|
||||
?- style
|
||||
%jolt ap-core
|
||||
%idle
|
||||
=. agent.yoke |+on-save:ap-agent-core
|
||||
ap-core
|
||||
::
|
||||
%slay
|
||||
=/ out=(list [[=wire =ship =term] ? =path])
|
||||
~(tap by outbound.watches.yoke)
|
||||
=/ inbound-paths=(set path)
|
||||
%- silt
|
||||
%+ turn ~(tap by inbound.watches.yoke)
|
||||
|= [=duct =ship =path]
|
||||
path
|
||||
=/ will=(list card:agent:gall)
|
||||
%+ welp
|
||||
?: =(~ inbound-paths)
|
||||
~
|
||||
[%give %kick ~(tap in inbound-paths) ~]~
|
||||
%+ turn ~(tap by outbound.watches.yoke)
|
||||
|= [[=wire =ship =term] ? =path]
|
||||
[%pass wire %agent [ship term] %leave ~]
|
||||
=^ maybe-tang ap-core (ap-ingest ~ |.([will *agent]))
|
||||
ap-core
|
||||
==
|
||||
=/ out=(list [[=wire =ship =term] ? =path])
|
||||
~(tap by outbound.watches.yoke)
|
||||
=/ inbound-paths=(set path)
|
||||
%- silt
|
||||
%+ turn ~(tap by inbound.watches.yoke)
|
||||
|= [=duct =ship =path]
|
||||
path
|
||||
=/ will=(list card:agent:gall)
|
||||
%+ welp
|
||||
?: =(~ inbound-paths)
|
||||
~
|
||||
[%give %kick ~(tap in inbound-paths) ~]~
|
||||
%+ turn ~(tap by outbound.watches.yoke)
|
||||
|= [[=wire =ship =term] ? =path]
|
||||
[%pass wire %agent [ship term] %leave ~]
|
||||
=^ maybe-tang ap-core (ap-ingest ~ |.([will *agent]))
|
||||
ap-core
|
||||
:: +ap-from-internal: internal move to move.
|
||||
::
|
||||
:: We convert from cards to duct-indexed moves when resolving
|
||||
@ -1703,7 +1681,6 @@
|
||||
::
|
||||
=/ mo-core (mo-abed:mo duct)
|
||||
?- -.task
|
||||
%conf mo-abet:(mo-boot:mo-core dap.task our desk.task)
|
||||
%deal
|
||||
=/ [=sock =term =deal] [p q r]:task
|
||||
?. =(q.sock our)
|
||||
@ -1711,7 +1688,6 @@
|
||||
mo-abet:(mo-send-foreign-request:mo-core q.sock term deal)
|
||||
mo-abet:(mo-handle-local:mo-core p.sock term deal)
|
||||
::
|
||||
%goad mo-abet:(mo-goad:mo-core agent.task)
|
||||
%init [~ gall-payload(system-duct.state duct)]
|
||||
%plea
|
||||
=/ =ship ship.task
|
||||
@ -1728,7 +1704,9 @@
|
||||
mo-abet
|
||||
::
|
||||
%sear mo-abet:(mo-filter-queue:mo-core ship.task)
|
||||
%fade mo-abet:(mo-fade:mo-core dap.task style.task)
|
||||
%jolt mo-abet:(mo-boot:mo-core dude.task our desk.task)
|
||||
%idle mo-abet:(mo-idle:mo-core dude.task)
|
||||
%nuke mo-abet:(mo-nuke:mo-core dude.task)
|
||||
%trim [~ gall-payload]
|
||||
%vega [~ gall-payload]
|
||||
==
|
||||
@ -1807,7 +1785,9 @@
|
||||
~
|
||||
=/ =routes [~ ship]
|
||||
(mo-peek:mo dap routes care path)
|
||||
:: +stay: save without cache
|
||||
:: +stay: save without cache; suspend non-%base agents
|
||||
::
|
||||
:: TODO: superfluous? see +molt
|
||||
::
|
||||
++ stay
|
||||
^- spore
|
||||
@ -1817,9 +1797,11 @@
|
||||
^- egg
|
||||
%= yoke
|
||||
agent
|
||||
?: ?=(%& -.agent.yoke)
|
||||
?: ?=(%| -.agent.yoke)
|
||||
[%| p.agent.yoke]
|
||||
?: =(%base q.beak.yoke)
|
||||
[%& on-save:p.agent.yoke]
|
||||
[%| p.agent.yoke]
|
||||
[%| on-save:p.agent-yoke]
|
||||
==
|
||||
:: +take: response
|
||||
::
|
||||
|
@ -22,9 +22,9 @@
|
||||
(gall-call gall-gate time *roof call-args expected-moves)
|
||||
::
|
||||
-.res
|
||||
:: +test-conf: test %conf; TODO: test clay response
|
||||
:: +test-jolt: test %jolt; TODO: test clay response
|
||||
::
|
||||
++ test-conf
|
||||
++ test-jolt
|
||||
^- tang
|
||||
::
|
||||
=/ =duct ~[/init]
|
||||
@ -33,7 +33,7 @@
|
||||
=/ ship ~nec
|
||||
::
|
||||
=/ call-args
|
||||
=/ =task:gall [%conf dap %home]
|
||||
=/ =task:gall [%jolt dap %home]
|
||||
[duct task]
|
||||
::
|
||||
=/ =move:gall-gate
|
||||
|
Loading…
Reference in New Issue
Block a user