Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 79 additions & 4 deletions docs/web-app/explaining.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ empty list says what will fill it, and when.
## A workspace's Runners tab

(routes/workspace.tsx `Runners`, `AddRunner`; components/workspace/runners.tsx, with `PoolCard`;
components/runner-driver.tsx; components/runner-snapshots.tsx; components/workspace/snapshots.tsx; lib/enrollment.ts;
lib/install.ts; lib/pools.ts; lib/pool-setup.ts; lib/snapshots.ts)
components/runner-driver.tsx; components/runner-snapshots.tsx; components/workspace/snapshots.tsx;
components/workspace/microvms.tsx; lib/enrollment.ts; lib/install.ts; lib/microvms.ts; lib/pools.ts;
lib/pool-setup.ts; lib/snapshots.ts)

**Purpose.** Bring machines online for the workspace, see whose each is and whose sessions it runs, and look after
them, after teaching a model that's easy to get wrong: whose runner runs whose sessions, and what a runner sees.
Expand All @@ -80,8 +81,9 @@ them, after teaching a model that's easy to get wrong: whose runner runs whose s
aren't here, "Or add one of yours", whose options say where each works already ("Also runs Side project").
4. **The runners** that are in no pool you see, then **how to bring a machine online** (straight under the form
while there's none), then **pools** (`#enrollment-tokens`, its heading `#pools`): each an enrollment token, for
machines nobody signs in on, with the runners it enrolled under it, then **where sessions' snapshots go**
(`#snapshots`).
machines nobody signs in on, with the runners it enrolled under it, then **sessions in AWS Lambda microVMs**
(`#microvms`), then **where sessions' snapshots go** (`#snapshots`). Runners of microVMs (the `lambda` driver)
are only in their own section, as cards, never among the machines.

**A runner's row.** An 8 px dot; the name and a state word (12 px `ink-4`: "online", "offline", "draining", "driver
not ready", "disabled"); pills only where they matter: "Only your sessions" or "Only {name}'s sessions", "Keeps your
Expand Down Expand Up @@ -216,6 +218,79 @@ what a lower limit does ("Fewer than it has removes none: it enrolls no more unt
says what follows: "Its runners carry the new labels and follow the new placement at once; the sessions they run
carry on." The toast says the result: "AWS large's runners carry the labels aws and large, and pack sessions".

**Sessions in AWS Lambda microVMs** (`MicrovmsSection`, since hyperstructure/fctl#665). Most workspaces
won't have one, so the section explains itself first and stays below the pools, before the snapshots. A runner set
to go first changes which runner takes the workspace's sessions, not where the section is.

- **Beside the heading, the life of a session's microVM, drawn** (`Lifecycle`, `aria-hidden`; a 300 px column from
768 px, under the text on phones): three stages on `canvas` cards in a `surface` frame, "At work" (an accent dot
with its glow: "the session's agent, in a microVM of its own"), "Suspended" (a blue moon: "memory and disk kept ·
no compute", and in blue "▷ a message resumes it in a second or two") and "Gone" (a dashed card with a dashed
circle: "its snapshot kept: a message carries the session on in a new one", or, where the workspace keeps no
snapshots, "a message starts the session again in a new one"), with the settings' whiles between them as arrows:
"↓ 90 seconds with nothing running", "↓ 1 hour suspended". The whiles are the first runner's settings where those
who see them do, else the defaults.
- **The lead** says the same in a paragraph, with the same whiles, and what happens after the let-go: "A runner can run
each of {workspace}'s sessions in a microVM of its own, in your AWS account. A session's microVM suspends once it has
waited 90 seconds with nothing running, and costs no compute while it waits for CI or for you: a message resumes it
as it was, in a second or two. After 1 hour suspended it goes, and the next message carries the session on in a new
microVM, with its conversation and the work it hadn't pushed." Where the workspace keeps no snapshots: "…starts the
session again in a new microVM, from its task and branch: {workspace} keeps no snapshots."
- **Each runner of them, a card** (`MicrovmCard`, `rounded-xl`, `bg-surface/40`, like a pool's): from 640 px a 32 px
`accent-soft` circle with a box; the name, its dot (accent with its glow online, amber draining, red disabled, grey
away) and state word; then **a pip for each microVM it may have** (`FleetBar`, 8 × 12 px, 3 px apart, `role="img"`
with the counts as its label): running in the accent, changing in a pulsing accent, suspended with a session in
blue, warm in grey, free as empty `sunken` boxes; past 40, one bar of the same colors. Then two lines of facts
(`Meta`), each fact whole, so that a phone wraps between them, never inside one: "3 running · 1 suspended · 2 warm
· 14 free of 20", then "AWS Lambda in us-east-1 · fctl-sandbox · 2 GiB, 1 vCPU", with "building its image" in blue
or "its image can't run" in amber when so, and "seen 5m ago" when away. What stops it, as its host says, in amber
under them ("AWS refused running a microVM: the host's role lacks a permission…"), and while it has no settings,
"Its microVMs have no settings yet: until they do, it runs no sessions." in amber, with **Set up** as the primary
button for those who manage it; **Open** otherwise, and the runner's ⋯ menu.
- **While the workspace has none, how to set one up** (`MicrovmSetup`): "To run sessions in microVMs", "One host runs
them all, on a machine that may manage your account's microVMs: an EC2 instance or an ECS task with a role, or any
machine with AWS keys. Nothing reaches it from outside.", then three steps as in **The setup steps**: "Give the
machine's role what it needs" (the IAM policy in a CodeBox, `hostPolicy`), "Install fctl there, and its host for
{workspace}" (`fctl login …`, `fctl host install --driver lambda --workspace {slug}`, then the enrollment token and
`[lambda] role_arn` as the questions that lead to them), "Choose its image, size and whiles" (to a member: who
chooses them), with "The guide" to fctl.sh's.

**A runner's microVMs** open in a wide sheet (`MicrovmsSheet`, `Sheet wide`: 520 px from 768 px, where its settings
take two columns), titled "{runner}'s microVMs", "AWS Lambda in us-east-1 · account 123456789012", read again every 3
seconds while open, since its host says what changed within seconds:

- The pips again, larger (10 × 16 px), and a legend that counts each color ("■ 3 running ■ 1 suspended ■ 2 warm
■ 14 free · of 20 at most", the card's runner; running and free always, the others when there are some), and what stops it in a warn
Banner.
- **Its image** on a `canvas` card: a cloud with a cog (accent ready, blue building, amber else), "fctl-sandbox · 3.0
· fctl 0.40.0 · arm64", "2 GiB, 1 vCPU, bursting to 8 GiB, 4 vCPUs · 32 GB of disk", and its state, live:
"Ready", "Lambda builds it for fctl 0.41.0: sessions run on the version before meanwhile" (blue, with a spinner),
or why it can't run.
- **Its microVMs**, sessions at work first, those that wait next, warm ones last: a 24 px icon (accent dot running,
blue moon suspended, a sparkle warm, a spinner while changing), the session as a link ("playground#4 Retry failed
uploads") or "Waiting for a session", and a phrase of what it does ("Running for 5m", "Warm, just started",
"Suspended for 3m · goes in 55 min") with the first 12 characters of its id in mono, whole in a tooltip; at the
right, a 56 px bar of how much of its 8 hours it has had, amber past 85%.
- **Its host's AWS policy**, for those who manage it: the policy for its region, account, bucket and roles behind
"Show it", open by itself, with its words in amber, while AWS refuses the host something.
- **Its settings**, for those who manage it (a member reads them in a sentence, `settingsWords`): when and by whom
they were saved and what saving does ("Its host runs new microVMs with what you save here; those that run keep
theirs until they go."); the image as two cards of a radio group (`Choice`: "fctl builds it", "From the sandbox
image, in your account, again as fctl updates." or "One of yours", "Built from fctl's template: `fctl host
microvm-image`."), the bucket and build role, or the ARN and version; size and architecture (Selects, disabled for
an image of your own, whose version says its size); "Suspend after" and "Let it go after" as Selects of presets
with the default marked ("The default: time for CI to report"); Warm and At most at once; "Run sessions here first"
as a Switch with what it does; "Network, role, encryption and logs" behind a link until one is set (egress
connectors a line each, the execution role with its warning: "Agents in its microVMs can use its permissions: give
it only what they should have. None: no AWS credentials in them."). Under them, live, the whole of it in a sentence
on `sunken` ("Each session runs in a microVM of 2 GiB, 1 vCPU, which bursts to 8 GiB, 4 vCPUs as it needs. It
suspends once the session has waited 90 seconds with nothing running, and goes 1 hour later: a message before then
resumes it as it was, one after carries the session on in a new one. 2 microVMs wait warm for new sessions, of 20
at most."). The form checks what the server checks (`settingsProblem`) and says it under the field once Save is
pressed, with `noValidate`, so the browser's own bubbles never show; the server's field errors go under theirs. Save
toasts "Saved: {runner}'s host runs new microVMs with these". What another manager saves meanwhile shows, unless
this one changed something.

**Where sessions' snapshots go** (`SnapshotsSection`, `#snapshots`): the tab's last section, for everyone, because
the choice it explains is made on the runners themselves (`[snapshots] url` in host.toml), not by a switch. A 20 px
display heading that names the outcome, "Sessions that resume anywhere"; a lead that says what a snapshot holds and
Expand Down
3 changes: 2 additions & 1 deletion docs/web-app/kit.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ owner shows it by rendering it, and stops on `onClose`, once it has slid away.

**Anatomy.** On phones, along the bottom, as tall as what it holds (up to 88% of the screen, and at
least 40 px short of it), with 18 px top corners, a 36 × 5 px grab handle and an upward shadow; from
768 px, along the right, 340 px wide and the screen's height. The header (19 px title, description,
768 px, along the right, 340 px wide (520 px with `wide`, for a form in two columns, such as a runner's
microVMs and their settings) and the screen's height. The header (19 px title, description,
a 44 px close target around a 28 px circle) stays; the body scrolls, contained, clear of the home
indicator.

Expand Down
7 changes: 6 additions & 1 deletion docs/web-app/transcript.md
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,12 @@ at its foot):
link, then the switch to the other view.

The notes beside the status pill (`lib/status.ts`) come most pressing first: "Reconnecting…", the stall, the disk,
when a paused session resumes, then the status's reason; a phone has room for the first. A note leaves out the word
when a paused session resumes, "microVM suspended", then the status's reason; a phone has room for the first. The
suspended note is calm, as a session that waits is: `ink-3`, after a 12 px blue moon, while the session is idle and
its runner suspended its microVM, and its tooltip says what that means: "Its microVM is suspended while the session
waits with nothing running, and costs no compute. A message resumes it as it was, in a second or two. In 55 min it
goes, and a message after that carries the session on in a new microVM." The message box says it too ("Message the
agent (its microVM resumes for it)…"), and the details' runner row has the moon instead of its dot, and "· suspended". A note leaves out the word
the pill says already (`besidePill`): "Stopped · after being idle", "Stopping · studio is draining". Until fctl#570 the
header said "Stopped · Stopped after being idle". Lists, which show the reason without the pill, keep it whole.

Expand Down