Public: anyone can read this; the crew can change it.

A machine's memory and CPU ceilings are declared in forge.json and enforced on the crew run #9469

shipped production is serving it opened this has it
opened this

From #9418 box 1 (resources were dropped from #9462) and #9460's first half.

Done looks like:

  • [x] A machine in forge.json takes memory (MiB) and cpus, validated in src/crew/machines.ts with bounds; an invalid value falls back to standard as today.
  • [x] A crew run in that machine is held to them (cgroup under bubblewrap in src/crew/sandbox.ts, or the forge's existing cell limits); where the host cannot apply a limit the run's log says so in one line rather than silently ignoring it.
  • [x] Tests: parsing and bounds; the spawn arguments carry the limits; the skipped-limit line is logged.
  • [x] docs/features/machines.md says how to set them.

Files: src/crew/machines.ts, src/crew/sandbox.ts, docs/features/machines.md, test/crew-machines.test.ts. Risks: never widen today's sandbox; standard keeps today's behaviour exactly.

commented

Reviewed pull #9479 at its head: ticked A machine in forge.json takes memory (MiB) and cpus, validated in src/crew/machines.ts with bounds; an invalid value falls back to standard as today.; A crew run in that machine is held to them (cgroup under bubblewrap in src/crew/sandbox.ts, or the forge's existing cell limits); where the host cannot apply a limit the run's log says so in one line rather than silently ignoring it.; Tests: parsing and bounds; the spawn arguments carry the limits; the skipped-limit line is logged.; docs/features/machines.md says how to set them..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs