kiln: first stab at ota inside +vats

This commit is contained in:
Ted Blackman 2021-07-09 01:08:33 -04:00
parent db49cbee92
commit ad15da2e7b

View File

@ -219,6 +219,7 @@
:: ::
++ reset ++ reset
^+ vats ^+ vats
~> %slog.0^leaf/"kiln: resetting tracking for {here}"
=. ark (~(del by ark) loc) =. ark (~(del by ark) loc)
(install loc [ship desk]:rak) (install loc [ship desk]:rak)
:: +bump: handle kernel kelvin upgrade :: +bump: handle kernel kelvin upgrade
@ -234,6 +235,7 @@
~> %slog.0^leaf/"kiln: desks blocked upgrade {<ded>}" ~> %slog.0^leaf/"kiln: desks blocked upgrade {<ded>}"
!! !!
=/ liv (skip ~(tap by ark) |=([d=desk *] (~(has in except) d))) =/ liv (skip ~(tap by ark) |=([d=desk *] (~(has in except) d)))
~> %slog.0^leaf/"kiln: bump {<liv>}"
=< kiln =< kiln
|- ^+ vats |- ^+ vats
?~ liv vats ?~ liv vats
@ -277,12 +279,34 @@
reset reset
~> %slog.0^leaf/"kiln: finished downloading update for {here}" ~> %slog.0^leaf/"kiln: finished downloading update for {here}"
=. aeon.rak +(aeon.rak) =. aeon.rak +(aeon.rak)
=/ kel (get-kelvin (get-ankh u.p.syn)) ::
?. =(kel [%zuse zuse]) ?. =(%base loc)
~> %slog.0^leaf/"kiln: future version {<kel>}, enqueueing" =/ kel (get-kelvin (get-ankh u.p.syn))
=. next.rak :_(next.rak [(dec aeon.rak) kel]) ?. =(kel [%zuse zuse])
(emit sync:pass) ~> %slog.0^leaf/"kiln: future version {<kel>}, enqueueing"
~> %slog.0^leaf/"kiln: merging into {here}" =. 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 {<blockers>}"
=- (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) (emil ~[merge sync]:pass)
:: ::
++ take-merge ++ take-merge
@ -296,11 +320,15 @@
=+ "kiln: merge into {here} failed, waiting for next revision" =+ "kiln: merge into {here} failed, waiting for next revision"
%- (slog leaf/- p.p.syn) %- (slog leaf/- p.p.syn)
vats vats
~> %slog.0^leaf/"merge into {here} succeeded; reviving agents" =. vats
%- emil ~> %slog.0^leaf/"merge into {here} succeeded; reviving agents"
%+ turn (get-apps loc) %- emil
|= =dude:gall %+ turn (get-apps loc)
[%pass /kiln/fade/[dude] %arvo %g %fade dude %jolt] |= =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 :: +get-ankh: extract $ankh from clay %v response $rant
:: ::