Skip to content

Commit 2980e91

Browse files
author
i2cjak
authored
Merge pull request #158 from i2cjak/backplane/boat-job-warm
boat-job: warm sandbox per thread (reuse, idle window, start guard); PROOF on large by default
2 parents d0d3f36 + 32cfd49 commit 2980e91

4 files changed

Lines changed: 271 additions & 26 deletions

File tree

‎docs/boat.md‎

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,31 @@ take the local "bend" lock or its memory.
66

77
```
88
work_run {note: "check on Boat",
9-
command: "cd <your worktree> && scripts/boat-job.sh --size default --timeout 900 -- scripts/check.sh"}
9+
command: "cd <your worktree> && scripts/boat-job.sh --timeout 900 -- scripts/check.sh"}
1010
```
1111

12+
Size by default: **large (16 GB) for anything that runs PROOF** (`check.sh`,
13+
`check.sh proof`, `PROOF.bend`, the `dev.sh` gates): since #149 the proof
14+
peaks above the 8 GB machine (killed at 7.45 GB on main 851a915b0).
15+
Everything else, `check.sh check` included, runs on default. `--size` wins.
16+
17+
Each thread keeps its sandbox **warm** after a job, for an idle window
18+
(`--idle SECS`, `BOAT_JOB_IDLE`, default 1200, at most 3600; 0 deletes at
19+
once). The thread's next job reuses it (no new Boat start): its lifetime is
20+
set for that job, the previous job's tree is wiped (`build/` too, unless
21+
`--keep-build`), the worktree pushed again, Bend installed only once. A warm
22+
sandbox is used only by its own thread, only when free, and only for a job
23+
of its size or smaller (a default job may use a warm large one, never the
24+
other way). Its lifetime while warm is the idle window + 5 min, so Boat
25+
stops it even if nothing else runs; a sweep deletes ours past the window.
26+
Idle time counts against the daily cap. Runs without a thread (by hand),
27+
cancelled jobs and failed setups delete at once. `--no-reuse` always
28+
starts a new one.
29+
30+
Start guard: past 80% of Boat's hourly or daily start limit
31+
(`BOAT_JOB_START_GUARD`), no new sandbox is started; a job from a thread
32+
with a free warm sandbox still runs. The refusal says so.
33+
1234
Each job gets its own sandbox, deleted when it ends; no lock is needed.
1335
Admission follows Boat's live limits, read before every create: active
1436
sandboxes and the rolling start windows per minute, hour and day (other
@@ -32,8 +54,8 @@ checkout).
3254
## What is verified (default, 8 GB, 4 vCPU)
3355
| command | result | wall | peak RSS |
3456
|---|---|---|---|
35-
| `scripts/check.sh` (type-check + PROOF) | exit 0 | 149 s | 4.29 GB |
36-
| `scripts/check.sh proof` | exit 0 | 98 s | 4.32 GB |
57+
| `scripts/check.sh` (type-check + PROOF) | exit 0 until #149; since then PROOF is OOM-killed at 7.45 GB: use large (the default for it now) | 149 s | 4.29 GB (before #149) |
58+
| `scripts/check.sh proof` | as above | 98 s | 4.32 GB (before #149) |
3759
| `scripts/test.sh` (136 programs) | exit 0 | 294 s | 3.38 GB |
3860
| native `BACKPLANE_LOW_MEM=1 scripts/build-app.sh src/app/main.bend build/backplane` (4 GiB heap hint, one clang at a time; `CC=clang-19`, `libx11-dev`, `libasound2-dev` installed in the job, `BACKPLANE_GOOGLE_BAKE=0`) | exit 0 twice; the built binary starts `--headless` and answers `/hello` | 17–21 min | 6.7–7.1 GB (0.6–1.0 GB left free: tight) |
3961

@@ -54,7 +76,8 @@ Every job's files are in `~/.local/state/backplane/boat/jobs/<job>/`:
5476
flag, manifest hash, Bend version and sha256, sandbox, size, command, exit).
5577

5678
## Options
57-
- `--size small|default|large`: 2 vCPU / 4 GB at half rate, 4 vCPU / 8 GB, or 8 vCPU / 16 GB at twice the rate. Default is default; ask for large only when the job is measured to need it.
79+
- `--size small|default|large`: 2 vCPU / 4 GB at half rate, 4 vCPU / 8 GB, or 8 vCPU / 16 GB at twice the rate. Default: large for PROOF, default for the rest; ask for large otherwise only when the job is measured to need it.
80+
- `--idle SECS`, `--keep-build`, `--no-reuse`: the warm sandbox (above).
5881
- `--timeout SECS` (default 1800): the command's limit; the sandbox lives at most that + 10 min, and never more than 2 h.
5982
- `--artifact PATH` (repeat): copied back from the sandbox before it is deleted.
6083
- `--exclude GLOB` (repeat): more files to keep out of the upload.

0 commit comments

Comments
 (0)