Skip to content

docs: add Go deploy guide and runnable example for Datum compute#130

Open
scotwells wants to merge 1 commit into
mainfrom
docs/deploy-guide-go
Open

docs: add Go deploy guide and runnable example for Datum compute#130
scotwells wants to merge 1 commit into
mainfrom
docs/deploy-guide-go

Conversation

@scotwells
Copy link
Copy Markdown
Contributor

@scotwells scotwells commented Jun 2, 2026

Take a Go HTTP service from source code to a live, reachable Instance on Datum compute. A developer can clone the example, run two commands, and watch a real Instance come up — no guesswork about the unikernel build, the metro registry, or the workload manifest.

What's included

  • Guide at docs/guides/deploy-a-go-app.md — the full source-to-running walkthrough: building the static-PIE unikernel image, publishing it to the metro registry, deploying with datumctl compute deploy, verifying the HTTP response, updating, and troubleshooting.
  • Runnable example at examples/hello-go/ — a ready-to-deploy folder so a developer goes from clone to a running Instance without copying snippets out of the docs:
    • main.go, go.mod — the minimal Go HTTP service
    • Dockerfile — the musl static-PIE build with a self-check that fails fast on a wrong-shaped binary
    • Kraftfile — the Unikraft Cloud app-elfloader runtime config
    • workload.yaml — the Datum compute Workload manifest
    • README.md — one-line description, link back to the guide, and the build + deploy commands

The guide links to the example, and the example links back to the guide, so either entry point leads to the other.

🤖 Generated with Claude Code

@scotwells scotwells force-pushed the docs/deploy-guide-go branch from 49af239 to 02f253d Compare June 2, 2026 20:43
@scotwells scotwells changed the title docs: add guide for deploying a Go service on Datum compute docs: add Go deploy guide and runnable example for Datum compute Jun 2, 2026
@scotwells scotwells force-pushed the docs/deploy-guide-go branch from 02f253d to 2497bc0 Compare June 2, 2026 20:53
scotwells added a commit that referenced this pull request Jun 2, 2026
The Go, Rust, Node.js, Python, PHP, and Ruby deploy guides and their
runnable examples/ apps have moved to their own focused PRs (#130-#135).
Dropping them here keeps this PR scoped to the ConfigMap/Secret mount
feature and shrinks the diff for reviewers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@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
Copy link
Copy Markdown

@ecv ecv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well shit!

@@ -0,0 +1,356 @@
# Deploy a Go Web Service on Datum Compute

> Last verified: 2026-06-02 against the `hello-go` example and the live `kraft` / `datumctl compute` CLIs.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unikraft not kraft :)

Comment on lines +149 to +151
```sh
docker run -d --name buildkit --privileged moby/buildkit:latest
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have the unikraft CLI installed and Docker Desktop, you don't need to run buildkit separately. Otherwise also expose the ports:

docker run -d --name buildkitd --privileged -p 1234:1234 moby/buildkit:latest --addr tcp://0.0.0.0:1234

export BUILDKIT_HOST=localhost:1234

Comment on lines +155 to +164
Use `kraft` only to build and publish the image — you deploy the running workload with `datumctl compute` in the next step. The `--no-start` (`-S`) flag builds the unikernel package and pushes it to the metro registry **without** starting an instance, so `kraft` never runs your workload. It pushes to `index.unikraft.io/datum/<name>`. The `-M` flag sets the memory allocation in MiB and is required.

```sh
export KRAFTKIT_NO_CHECK_UPDATES=true

kraft cloud --metro "$UKC_METRO" --token "$UKC_TOKEN" \
--buildkit-host docker-container://buildkit \
deploy --no-start -M 512 --name hello-go \
--runtime base:latest --rootfs ./Dockerfile .
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unikraft build . -o datum/hello-go:latest

Comment on lines +343 to +344
- The `kraft cloud deploy` command completed without errors and printed the image reference.
- The image name in `workload.yaml` matches exactly what `kraft cloud deploy` reported, including the `latest` tag.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unikraft run

Comment on lines +25 to +28
kraft cloud --metro "$UKC_METRO" --token "$UKC_TOKEN" \
--buildkit-host docker-container://buildkit \
deploy --no-start -M 512 --name hello-go \
--runtime base:latest --rootfs ./Dockerfile .
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unikraft build . -o datum/hello-go:latest

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.

4 participants