Skip to content

Commit

Permalink
Merge pull request #266 from tloncorp/hm/promote-1-24
Browse files Browse the repository at this point in the history
ops: promote 1.24.0
  • Loading branch information
arthyn authored Mar 26, 2024
2 parents 874bd5d + 01be491 commit 90a1752
Show file tree
Hide file tree
Showing 11 changed files with 161 additions and 64 deletions.
1 change: 0 additions & 1 deletion .github/workflows/deploy-kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
required: false
default: develop
description: Enter the tag to deploy
default: staging
jobs:
build-frontend:
runs-on: ubuntu-latest
Expand Down
52 changes: 37 additions & 15 deletions desk/app/docket.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
|%
+$ card card:agent:gall
+$ app-state
$: %4
$: %5
:: local
charges=(map desk charge)
==
Expand Down Expand Up @@ -65,13 +65,18 @@
?. ?=(%3 -.old) `old
:_ old(- %4) :_ ~
[%pass /reinstall %agent [our.bowl dap.bowl] %poke %reinstall-groups !>(~)]
?> ?=(%4 -.old)
=^ cards-4 old
?. ?=(%4 -.old) `old
:_ old(- %5) :_ ~
=/ =cage [%kiln-suspend !>(`desk`%garden)]
[%pass /suspend %agent [our.bowl %hood] %poke cage]
?> ?=(%5 -.old)
=/ cards-tire [~(tire pass /tire) ~]
=. -.state old
:: inflate-cache needs to be called after the state is set
::
=. +.state inflate-cache
[:(weld cards-1 cards-2 cards-3 cards-tire) this]
[:(weld cards-1 cards-2 cards-3 cards-4 cards-tire) this]
::
++ inflate-cache
^- cache
Expand All @@ -87,9 +92,11 @@
state-1
state-2
state-3
state-4
app-state
==
::
+$ state-4 [%4 (map desk charge)]
+$ state-3 [%3 (map desk charge)]
+$ state-2 [%2 (map desk charge)]
+$ state-1 [%1 (map desk charge)]
Expand Down Expand Up @@ -250,6 +257,7 @@
[%kiln ~] `state
[%charge @ *] (take-charge i.t.wire t.t.wire)
[%reinstall *] `state
[%suspend ~] `state
==
[cards this]
::
Expand Down Expand Up @@ -656,28 +664,40 @@
?~ file [glob 'file without filename' err]
?~ type [glob (cat 3 'file without type: ' u.file) err]
?^ code [glob (cat 3 'strange encoding: ' u.code) err]
=/ filp (rush u.file fip)
?~ filp [glob (cat 3 'strange filename: ' u.file) err]
=/ filp (fip u.file)
:: ignore metadata files and other "junk"
::TODO consider expanding coverage
::
?: =('.DS_Store' (rear `path`u.filp))
?: =('DS_Store' (rear filp))
[glob err]
:: make sure to exclude the top-level dir from the path
::
:_ err
%+ ~(put by glob) (slag 1 `path`u.filp)
%+ ~(put by glob) (slag 1 filp)
[u.type (as-octs:mimes:html body)]
::
++ split-at
=| fst=tape
|= [=tape char=@tD]
=. tape (flop tape)
|-
^+ [fst fst]
?~ tape [(flop fst) (flop tape)]
?: =(i.tape char)
[(flop fst) (flop t.tape)]
$(tape t.tape, fst (snoc fst i.tape))
::
++ fip
=, de-purl:html
;: cook
|=(pork (weld q (drop p)))
deft
|=(a=cord (rash a (more fas smeg)))
crip
(star ;~(pose (cold '%20' (just ' ')) next))
==
|= fil=@t
^- path
=/ [ext=tape fil=tape] (split-at (trip fil) '.')
=- (snoc - (crip ext))
%+ turn
(scan fil (most fas (star ;~(less fas next))))
|= t=^tape
%- crip
(en-urlt:html t)
::
::
++ inline-js-response
|= js=cord
Expand All @@ -703,6 +723,8 @@
?: =(suffix /desk/js)
%- inline-js-response
(rap 3 'window.desk = "' u.des '";' ~)
=? suffix !(~(has by glob) suffix)
(turn suffix |=(s=@t (crip (en-urlt:html (trip s)))))
=/ requested
?: (~(has by glob) suffix) suffix
/index/html
Expand Down
11 changes: 3 additions & 8 deletions desk/app/vitals.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
%landscape
%vitals-connection-check
%noun
!>(ship)
!>((some ship))
==
?: ?=(%pending -.status.u.stat)
cor
Expand All @@ -153,17 +153,14 @@
%landscape
%vitals-connection-check
%noun
!>(ship)
!>((some ship))
==
::
:: public pokes
::
%ship
=+ !<(=ship vase)
?< =(our ship)
?< =(~ (find ~[our] (saxo:title our now ship)))
?. ?=([%live *] (scry-qos:lib our now ship))
!!
?> ?=([%live *] (scry-qos:lib our now ship))
cor
==
++ watch
Expand All @@ -187,14 +184,12 @@
?+ path [~ ~]
::
[%x %sponsor ~]
?< ?=(%czar (clan:title our))
%- some
%- some
:- %vitals-qos
!> (scry-qos:lib our now (sein:title our now our))
::
[%x %galaxy ~]
?< ?=(%czar (clan:title our))
%- some
%- some
:- %vitals-qos
Expand Down
4 changes: 2 additions & 2 deletions desk/desk.docket-0
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
:~ title+'Landscape'
info+'An app launcher for Urbit.'
color+0xee.5432
glob-http+['https://bootstrap.urbit.org/glob-0v7.c3mlj.gm8sb.1cmkv.ugntt.pg185.glob' 0v7.c3mlj.gm8sb.1cmkv.ugntt.pg185]
glob-http+['https://bootstrap.urbit.org/glob-0v3.0dqi8.1csij.8dv08.lhglb.45fpk.glob' 0v3.0dqi8.1csij.8dv08.lhglb.45fpk]
::glob-ames+~zod^0v0
base+'landscape'
version+[1 20 0]
version+[1 24 0]
website+'https://tlon.io'
license+'MIT'
==
22 changes: 12 additions & 10 deletions desk/lib/vitals.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@
++ scry-qos
|= [=ship =time peer=ship]
^- qos:ames
%- simplify-qos
.^ ship-state:ames
%ax
(scot %p ship)
%$
(scot %da time)
%peers
(scot %p peer)
~
==
:: a ship is not guaranteed by %ames to know itself, so we fake it
?: =(ship peer)
[%live time]
:: .^(* /ax/=//=/peers/[peer]) crashes if the peer is unknown, so we
:: check the source map beforehand and fake an %unborn if we can see
:: a crash coming
=/ ames-peers=path /ax/(scot %p ship)//(scot %da time)/peers
=/ peers .^((map ^ship ?(%alien %known)) ames-peers)
?. (~(has by peers) peer)
[%unborn time]
=/ pqos .^(ship-state:ames (snoc ames-peers (scot %p peer)))
(simplify-qos pqos)
--
39 changes: 39 additions & 0 deletions desk/sur/vitals.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,43 @@
$: =ship
=result
==
::
+$ ship-state
$% [%idle ~]
[%poking ~]
[%http until=@da]
[%waiting until=@da]
==
::
+$ ping
$% [%0 ships=(map ship [=rift =ship-state])]
$: %1
ships=(set ship)
nonce=@ud
$= plan
$~ [%nat ~]
$% [%nat ~]
[%pub ip=(unit @t)]
==
==
::
$: %2
ships=(set ship)
nonce=@ud
$= plan
$~ [%nat ~]
$% [%nat ~]
[%pub ip=(unit @t)]
[%off ~]
[%one ~]
==
==
::
$: %3
mode=?(%formal %informal)
pokes=@ud
timer=(unit [=wire date=@da])
galaxy=@p
==
==
--
3 changes: 2 additions & 1 deletion desk/sys.kelvin
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
[%zuse 412]
[%zuse 412]
[%zuse 411]
7 changes: 6 additions & 1 deletion desk/ted/make-glob.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
%+ turn paths
|= pax=path
^- [path mime]
:- (slag (lent dir) pax)
:-
?> ?=(^ pax)
%+ turn t.pax
|= seg=@t
^- @t
(crip (en-urlt:html (trip seg)))
=/ mar=mark (rear pax)
=+ .^(vas=vase %cr (weld home pax))
=+ .^(=tube:clay %cc (weld home /[mar]/mime))
Expand Down
69 changes: 54 additions & 15 deletions desk/ted/vitals/connection-check.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
|= arg=vase
=/ m (strand ,vase)
^- form:m
=+ !<(target=ship arg)
=+ !<([~ target=ship] arg)
;< our=@p bind:m get-our:io
|^
:: early exit; check if we have live path to target
;< now=@da bind:m get-time:io
;< tqos=qos:ames bind:m (get-qos target)
;< now=@da bind:m get-time:io
?: ?& ?=(%live -.tqos)
(gth last-contact.tqos (sub now info-timeout:vitals))
==
Expand All @@ -33,8 +33,9 @@
:: set pending to %trying-local
;< ~ bind:m (update-status [%trying-local ~])
:: check if we can contact our own galaxy
;< =ping:vitals bind:m (scry:io ping:vitals ~[%gx %ping %noun])
;< gqos=qos:ames bind:m (scry:io qos:ames ~[%gx %vitals %galaxy %vitals-qos])
?. ?=(%live -.gqos)
?: !(galaxy-reachable ping gqos)
(post-result [%no-our-galaxy last-contact.gqos])
:: set pending to %trying-target
;< ~ bind:m (update-status [%trying-target ~])
Expand All @@ -45,23 +46,30 @@
:: if we're a moon, check if we can contact our planet
::
:: NN: failing to contact our sponsor is only a failure condition for moons,
:: since currently only moons receive additional routing help from their
:: sponsors
:: since currently only moons require the direct sponsor to be online for
:: peers to grab the moon keys
:: NN: we do this after the initial target check because if we're a moon and
:: our planet is down, it's useful to talk to ships that still have live
:: wires (e.g. for troubleshooting); thus, by waiting to perform this
:: check, we don't report %no-our-planet for every connectivity check
:: when attempting to track down a live peer from whom to seek help
::
;< sqos=qos:ames
;< moon-sponsor-reachable=?
bind:m
=/ mm (strand ,qos:ames)
=/ mm (strand ,?)
^- form:mm
?. ?=(%earl (clan:title our))
(pure:mm [%live *@da])
(scry:io qos:ames ~[%gx %vitals %sponsor %vitals-qos])
?. ?=(%live -.sqos)
(post-result [%no-our-planet last-contact.sqos])
(pure:mm %.y)
=/ sponsor=@p (end 5 our)
;< ~ bind:mm (update-status [%trying-sponsor sponsor])
;< pchek=(unit) bind:mm (check-online sponsor target-timeout:vitals)
?: ?=([%$ %$] pchek)
(pure:mm %.y)
(pure:mm %.n)
::
?: !moon-sponsor-reachable
;< pqos=qos:ames bind:m (scry:io qos:ames ~[%gx %vitals %sponsor %vitals-qos])
(post-result [%no-our-planet last-contact.pqos])
:: early exit; if target is a galaxy, there's nothing more we can check
?: ?=(%czar (clan:title target))
(galaxy-down target)
Expand Down Expand Up @@ -92,6 +100,30 @@
?: u.live
[%no-sponsor-hit i.sponsors]
[%no-sponsor-miss i.sponsors]
::
++ galaxy-reachable
|= [=ping:vitals =qos:ames]
^- ?
?- -.ping
%0
?=(%live -.qos)
::
%1
?: ?=(%pub -.plan.ping)
%.y
?=(%live -.qos)
::
%2
?. ?=(%nat -.plan.ping)
%.y
?=(%live -.qos)
::
%3
?: ?=(%informal mode.ping)
%.y
?=(%live -.qos)
==
::
++ update-status
|= =pending:vitals
=/ m (strand ,~)
Expand All @@ -103,13 +135,20 @@
!>
^- update:vitals
[target now %pending pending]
:: thread version of +scry-qos in /=landscape=/lib/vitals/hoon
++ get-qos
|= =ship
|= peer=ship
=/ m (strand ,qos:ames)
^- form:m
;< state=ship-state:ames
bind:m
(scry:io ship-state:ames ~[%ax %$ %peers (scot %p ship)])
;< now=@da bind:m get-time:io
?: =(our peer)
(pure:m [%live now])
;< peers=(map ship ?(%alien %known)) bind:m
(scry:io (map ship ?(%alien %known)) ~[%ax %$ %peers])
?. (~(has by peers) peer)
(pure:m [%unborn now])
;< state=ship-state:ames bind:m
(scry:io ship-state:ames ~[%ax %$ %peers (scot %p peer)])
(pure:m (simplify-qos:lib-vitals state))
++ galaxy-down
|= galaxy=ship
Expand Down
Loading

0 comments on commit 90a1752

Please sign in to comment.