Skip to content

docs: add Node.js deploy guide and runnable example for Datum compute#132

Open
scotwells wants to merge 2 commits into
mainfrom
docs/deploy-guide-node
Open

docs: add Node.js deploy guide and runnable example for Datum compute#132
scotwells wants to merge 2 commits into
mainfrom
docs/deploy-guide-node

Conversation

@scotwells

@scotwells scotwells commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

What this delivers

A self-contained guide that takes a developer from a Node.js HTTP service in source form to a live, reachable Instance on Datum compute, plus a runnable example they can deploy as-is. It lowers the barrier to a first successful Node.js deploy: package the app as a Unikraft unikernel on the base-compat runtime, publish to the metro registry, deploy with datumctl compute deploy, and verify the HTTP response end to end.

Changes

  • Guide now lives at docs/guides/deploy-a-node-app.md (moved out of docs/compute/guides/).
  • Ready-to-deploy example at examples/hello-node/ materializes every file the guide inlines, so a reader can clone and ship without copy-pasting:
    • app.js — the Node HTTP service (responds on / and /healthz)
    • package.json
    • Dockerfile — builds the minimal scratch rootfs with the node interpreter and its shared libraries
    • Kraftfilebase-compat:latest runtime packaging
    • workload.yaml — the Datum Workload manifest
    • README.md — one-line summary, link back to the guide, and the key build + deploy commands

The guide gains a single pointer line directing readers to the example folder.

🤖 Generated with Claude Code

@scotwells scotwells force-pushed the docs/deploy-guide-node branch from a24bf18 to e767314 Compare June 2, 2026 20:43
@scotwells scotwells changed the title docs: add guide for deploying a Node.js service on Datum compute docs: add Node.js deploy guide and runnable example for Datum compute Jun 2, 2026
@scotwells scotwells force-pushed the docs/deploy-guide-node branch from e767314 to 436198a Compare June 2, 2026 20:55
@scotwells scotwells force-pushed the docs/deploy-guide-node branch from 436198a to 10a329f Compare June 2, 2026 20:57
@scotwells scotwells requested review from a team and savme June 2, 2026 21:44
@scotwells scotwells added the documentation Improvements or additions to documentation label Jun 2, 2026
ecv
ecv previously approved these changes Jun 3, 2026
savme
savme previously approved these changes Jun 4, 2026
…guidance

Verified corrections from deploying a real Node app:

- rootfs must be CPIO, not erofs: an erofs initrd does not boot on
  base-compat:latest ((i0 EXP) at 0.00ms, no logs). Drop rootfs.format
  and pass --rootfs-type cpio.
- pin the build stage to linux/amd64: base-compat is x86_64 and the
  rootfs copies x86_64 musl libs, so arm64 hosts must cross-build.
- document the ~150 MiB initrd boot ceiling and rootfs slimming
  (bundle to a single file, drop node_modules/dev deps); -M does not
  affect it.
- add a framework/SSR section (run npm run build, ship built output,
  watch for build tools absent from node:22-alpine).
- add an env vars & secrets section: inject via env secretKeyRef to an
  existing default-namespace Secret; file mounts need erofs (does not
  boot), so prefer env-from-secret on the CPIO runtime.
- note registry publish-vs-pull and the RAM-backed/ephemeral rootfs;
  reframe -M as a build hint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@scotwells scotwells dismissed stale reviews from savme and ecv via 10279d5 June 9, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants