Add a loam runner and make it sluice's runner #13
No reviewers
Labels
No labels
terraform-plane
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jhgaylor/sluice!13
Loading…
Reference in a new issue
No description provided.
Delete branch "loam-runner"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
moor and every sandpitd are being retired (home-cloud #226). sluice runs every stage in a moor sandbox, so it needs another substrate before then. This gives it a loam runner instead of shutting it down. sluice's
Runnerinterface (start,exec,putFile,getFile,destroy,health) maps one-to-one onto loam's public API.What changes
src/runner/loam.ts:LoamRunner, selected byRUNNER=loam, sitting next toMoorRunner. It usesPOST /v1/sandboxes(image by digest, resources,sluice/*labels,idle.action: none, a deletedeadlinein place of moor's TTL),exec/run(bash -c, assprite, up to 3600 s),fs/file(assprite,mkdir,mode),DELETE, andwhoamifor health. A 409 on the run's sandbox name deletes the leftover sandbox and creates it again. A 503capacityrequeues the run through the existingisCapacity.spriteuser and/home/sprite/.sluicelayout that moor sandboxes had. Secrets still go in as files, and stages still run detached and get polled (stream.ts). The path constants move frommoor.tstotypes.ts, and the bootstrap-script loader moves tobootstrap.ts.images/sandbox/DockerfileisFROM ghcr.io/arugula-salad/loam-guest@sha256:a0a0513e…(thebasetemplate's digest from loam'sdeploy/k8s/templates.jsonon main). It adds thespriteuser and runsscripts/sandbox-bootstrap.shat build time: terraform 1.14.0, tofu 1.13.1, node 22, choudoufu, terragucci, chant and hcl2json, all pinned and checksummed. I built it locally and it works: terragucci 0.3.1, node v22.23.3..forgejo/workflows/sandbox-image.ymlbuilds that image toghcr.io/arugula-salad/sluice-sandbox, because loam only accepts images by digest from that registry. The tag is the tree hash of its inputs, so the image is rebuilt only when they change. The workflow pins the digest intok8s/deployment.yamlasLOAM_IMAGE.LOAM_IMAGEempty), the runner uses loam'sbasetemplate, createsspriteas root and cold-bootstraps. That's slower, but it works. The bootstrap script now removes a different node major's bundled npm before installing node 22, since loam-guest ships node 24.k8s/deployment.yaml:RUNNER=loam, plusLOAM_API_URLandLOAM_IMAGE. TheMOOR_*values stay, so settingRUNNER=moorrolls back while moor still runs.RUNNER=loamwithLOAM_TOKEN.estates.runnergainsloam; the column is text, so no migration is needed.docs/OPERATIONS.mdhas a new section, "The runner: loam", covering setup, the switch, how to verify it, rollback and the cleanup once moor is gone. SPEC, ARCHITECTURE and README are updated to match.test/loam-runner.test.tsruns against an in-process fake loam: create body, prepare/bootstrap, buffered and detached exec, files, the 409 path, capacity, connection retries and timeouts. The production-config test covers loam.test/setup.tsnow stripsSECRETS_KEY, so a local.envno longer fails that test.bun test: 376 pass, 0 fail.Why not loam's brokered secrets
The clone token is minted per run, and the cloud credentials are web-identity token files that the SDKs send in request bodies. A project-wide secret injected into request heads can carry neither. Both stay as files, as they were on moor.
Before merging (merging is the switch)
sluicewith keysluice-runner, created by loam's admin. Its secret goes into Infisical (project sluice → prod) asLOAM_TOKEN.GHCR_TOKENonjhgaylor/sluice: a GitHub token withwrite:packageson arugula-salad. loam's nodes must be able to pullghcr.io/arugula-salad/sluice-sandbox, either with the org ghcr credential or by making the package public (it holds nothing secret). Without this secret, runs still work through the cold-bootstrap fallback, just slowly.terragucci-hello-world, then one onsluice-kubernetes-hello, which proves a loam sandbox can reachk8s.inevitable.fyithrough the hairpin.This must land, and be verified, before moor's sandpitd stops (home-cloud #226). After that there's no rollback.
🤖 Generated with Claude Code
WIP: Add a loam runner and make it sluice's runnerto Add a loam runner and make it sluice's runner2f2bcbaa20412c384bee