Kernel Images is a sandboxed cloud browser infrastructure platform. The Go server (under server/) provides a REST API for screen recording, process execution, file management, and a CDP (Chrome DevTools Protocol) WebSocket proxy. Everything runs inside a single Docker container orchestrated by supervisord.
- Lint:
cd server && go vet ./... - Unit tests (skip e2e):
cd server && go test -v -race $(go list ./... | grep -v /e2e$) - Full tests (requires Docker + pre-built images):
cd server && make test - Build server:
cd server && make build - Build headless image:
cd /workspace && DOCKER_BUILDKIT=1 docker build -f images/chromium-headless/image/Dockerfile -t kernel-headless-test . - Run headless container:
docker run -d --name kernel-headless -p 10001:10001 -p 9222:9222 --shm-size=2g kernel-headless-test - See
server/README.mdandserver/Makefilefor additional commands and configuration.
The Cloud VM runs inside a Firecracker microVM. Docker requires:
fuse-overlayfsstorage driver (configured in/etc/docker/daemon.json)iptables-legacy(not nftables)- Start daemon with
sudo dockerd &>/tmp/dockerd.log &thensudo chmod 666 /var/run/docker.sock
-
UKC_METROmust be the full API URL (e.g.,https://api.<region>.<domain>/v1), not just the metro short name. The kraft CLI defaults to*.kraft.cloudbut this org uses a custom domain — check theUKC_METROenvironment variable for the correct value. -
Some kraft cloud subcommands need
--metro "<full-url>"explicitly even when theUKC_METROenv var is set. -
CDP proxy on port 9222 routes ALL WebSocket connections to the browser-level endpoint (ignores request path). Use
Target.createTarget+Target.attachToTargetwithflatten: truefor page-level interaction. Playwright/Puppeteer handle this automatically. -
The default recorder cannot be restarted after stop+delete within the same process lifetime. Restart the container or use a custom
recorder_id. -
The server (
make dev) only runs inside the Docker container — it exits on bare host because it waits for Chromium devtools upstream on port 9223. -
Image naming convention: Cursor Cloud agents use
onkernel/cursor-agent-<type>:latestfor test images pushed to KraftCloud. Always check quota withkraft cloud quotabefore pushing. Never auto-delete images — present them to the user for approval. -
Image storage quota is tight (~80 GiB limit). Old
kernel-cuandchromium-headlessversions consume most of it. -
E2e tests use
testcontainers-goand require Docker + pre-built images. SetE2E_CHROMIUM_HEADFUL_IMAGEandE2E_CHROMIUM_HEADLESS_IMAGEenv vars to point to the correct image tags. -
Go version: The project requires Go 1.25.0 (per
server/go.mod). The system Go may be older — ensure/usr/local/go/binis on PATH. -
Build headful image:
cd /workspace && DOCKER_BUILDKIT=1 docker build -f images/chromium-headful/Dockerfile -t kernel-headful-test .— this takes significantly longer than headless (~10 min) due to Xorg dependencies, Mutter, and the WebRTC client build. The headfulrun-docker.shruns interactively (-it); for background use, run with-dinstead. -
/process/execAPI schema: Thecommandfield is a single string (the binary name), not an array. Arguments go in the separateargsarray field. Responsestdout_b64/stderr_b64are base64-encoded.