Add Woodpecker validation and tag-release pipelines (ADR 0008) #43

Merged
svc-agent-writer merged 2 commits from feat/41-release-delivery into main 2026-11-02 11:21:14 +00:00

Summary

Adds CI and a tag-based release to the repo, as ruled in the #41 grill and recorded in ADR 0008.

 .woodpecker/
+├── validation.yaml        # push to main + PRs: make check, no secret
+└── release.yaml          # refs/tags/v* only: tag → assemble → image → publish
 scripts/
+├── release-tag-check.sh   # annotated vX.Y.Z[-rc.N] tag, on main, at this commit
+├── release-assemble.sh    # Containerfile resolver + builder on the runtime base → 6 layer tarballs
+├── release-image.sh       # crane: base + layers + Containerfile config → image.tar
+└── release-publish.sh     # refuse an existing version, push, check digest, print digest last
 docs/adr/
+└── 0008-release-and-delivery.md
 tests/test_deploy.py
+   test_ci_lanes_pin_the_containerfile_amd64_base
+   test_release_bake_sets_the_containerfile_runtime_config
 README.md
+   ## Releases and deploy
push tag v0.1.0-rc.5            (protected tag rule: only piers)
  tag        annotated? well-formed? points at this commit? on main?
  assemble   venv at /opt/peoplemind, model, user → users venv onnxruntime phonenumbers numpy models
  image      crane mutate python:3.12-slim-bookworm@amd64 + layers
             user peoplemind, entrypoint peoplemind, cmd api --config …, 8420/tcp
  publish    crane digest :0.1.0-rc.5 → exists? refuse and print it
             push → registry digest == built digest → print digest

The bake mirrors dev/ops-gateway's daemonless crane lane. It keeps the Containerfile's split of onnxruntime, phonenumbers and numpy into their own layers, because the registry proxy refuses a request over 100 MB.

Evidence

  • Before: no CI, and releases built by hand with make image-amd64. Starbase pins a bare commit (?ref=902eed7…).
    After: make check reports 300 passed, 3 skipped and 4 deselected, including the two new guards.

  • Bake dry run. I ran release-assemble.sh and release-image.sh locally in the lane's pinned amd64 images. Then I loaded the result into podman and ran the deployment acceptance suite against it:

    PEOPLEMIND_IMAGE=…:0.0.0-dryrun pytest -m integration tests/test_deploy.py
      test_compose_up_health_green_with_vcard_fixture            PASSED
      test_litestream_restore_passes_check                       PASSED
      test_image_runs_non_root_without_credentials               PASSED
      test_kustomize_example_overlay_has_no_secret_in_configmap  PASSED
    

    The baked config matches the Containerfile:

    • User is peoplemind and WorkingDir is /opt/peoplemind.
    • The entrypoint is peoplemind, and Cmd is api --config /etc/peoplemind/config.toml.
    • PATH starts with the venv, followed by the base's own PATH.
    • PYTHONUNBUFFERED=1 is set, and 8420/tcp is exposed.

    The running image has uid=1000, / at 0755 and a read-only model.

  • What the dry run caught before commit:

    • Staging layers on the workspace volume lost modes and owners: /etc/passwd came out 0600.
    • A ./ tar entry would have set the image root to 0700.
    • The bake now stages on the container filesystem and tars only named top-level directories.
  • Not yet proven; CI proves it:

    • The validation lane goes green on the site runner. This PR's run is that check.
    • The tag and publish steps, the refusal of an existing version, and the secret's images match. These need the first real v0.1.0-rc.5 push after merge.
    • In the dry run, uv export segfaulted under qemu amd64 emulation, so I ran the resolver natively. The site runners are native amd64.

Merge Danger

Door: two-way

Merging adds files and publishes nothing. The release lane does nothing until the operator pushes a v* tag. Reverting the PR removes both lanes.

The tag convention in ADR 0008 is harder to reverse once consumers pin ?ref=v…. That decision was ruled in the #41 grill, and dev/mail-mind-mcp#132 applies the same convention.

Blast Radius: CI-only

  • Every future PR gets a ci/woodpecker/pr/validation status. It is not yet a required check (runbook §9).
  • After merge, the first v* tag publishes git.groupthink.asia/dev/people-mind-mcp:<version> with the svc-oci-writer token. Before that:
    • the protected-tag rule limits v* to piers;
    • the secret is scoped to events: ["tag"] and the crane image.

Closes #41

🤖 Generated with Claude Code

## Summary Adds CI and a tag-based release to the repo, as ruled in the #41 grill and recorded in ADR 0008. ```diff .woodpecker/ +├── validation.yaml # push to main + PRs: make check, no secret +└── release.yaml # refs/tags/v* only: tag → assemble → image → publish scripts/ +├── release-tag-check.sh # annotated vX.Y.Z[-rc.N] tag, on main, at this commit +├── release-assemble.sh # Containerfile resolver + builder on the runtime base → 6 layer tarballs +├── release-image.sh # crane: base + layers + Containerfile config → image.tar +└── release-publish.sh # refuse an existing version, push, check digest, print digest last docs/adr/ +└── 0008-release-and-delivery.md tests/test_deploy.py + test_ci_lanes_pin_the_containerfile_amd64_base + test_release_bake_sets_the_containerfile_runtime_config README.md + ## Releases and deploy ``` ```text push tag v0.1.0-rc.5 (protected tag rule: only piers) tag annotated? well-formed? points at this commit? on main? assemble venv at /opt/peoplemind, model, user → users venv onnxruntime phonenumbers numpy models image crane mutate python:3.12-slim-bookworm@amd64 + layers user peoplemind, entrypoint peoplemind, cmd api --config …, 8420/tcp publish crane digest :0.1.0-rc.5 → exists? refuse and print it push → registry digest == built digest → print digest ``` The bake mirrors dev/ops-gateway's daemonless crane lane. It keeps the Containerfile's split of onnxruntime, phonenumbers and numpy into their own layers, because the registry proxy refuses a request over 100 MB. ## Evidence - **Before:** no CI, and releases built by hand with `make image-amd64`. Starbase pins a bare commit (`?ref=902eed7…`). **After:** `make check` reports 300 passed, 3 skipped and 4 deselected, including the two new guards. - **Bake dry run.** I ran `release-assemble.sh` and `release-image.sh` locally in the lane's pinned amd64 images. Then I loaded the result into podman and ran the deployment acceptance suite against it: ```text PEOPLEMIND_IMAGE=…:0.0.0-dryrun pytest -m integration tests/test_deploy.py test_compose_up_health_green_with_vcard_fixture PASSED test_litestream_restore_passes_check PASSED test_image_runs_non_root_without_credentials PASSED test_kustomize_example_overlay_has_no_secret_in_configmap PASSED ``` The baked config matches the Containerfile: - `User` is `peoplemind` and `WorkingDir` is `/opt/peoplemind`. - The entrypoint is `peoplemind`, and `Cmd` is `api --config /etc/peoplemind/config.toml`. - `PATH` starts with the venv, followed by the base's own `PATH`. - `PYTHONUNBUFFERED=1` is set, and `8420/tcp` is exposed. The running image has `uid=1000`, `/` at `0755` and a read-only model. - **What the dry run caught before commit:** - Staging layers on the workspace volume lost modes and owners: `/etc/passwd` came out `0600`. - A `./` tar entry would have set the image root to `0700`. - The bake now stages on the container filesystem and tars only named top-level directories. - **Not yet proven; CI proves it:** - The validation lane goes green on the site runner. This PR's run is that check. - The `tag` and `publish` steps, the refusal of an existing version, and the secret's `images` match. These need the first real `v0.1.0-rc.5` push after merge. - In the dry run, `uv export` segfaulted under qemu amd64 emulation, so I ran the resolver natively. The site runners are native amd64. ## Merge Danger **Door:** two-way Merging adds files and publishes nothing. The release lane does nothing until the operator pushes a `v*` tag. Reverting the PR removes both lanes. The tag convention in ADR 0008 is harder to reverse once consumers pin `?ref=v…`. That decision was ruled in the #41 grill, and dev/mail-mind-mcp#132 applies the same convention. **Blast Radius:** CI-only - Every future PR gets a `ci/woodpecker/pr/validation` status. It is not yet a required check (runbook §9). - After merge, the first `v*` tag publishes `git.groupthink.asia/dev/people-mind-mcp:<version>` with the `svc-oci-writer` token. Before that: - the protected-tag rule limits `v*` to `piers`; - the secret is scoped to `events: ["tag"]` and the crane image. Closes #41 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ADR 0008 records the #41 grill: a v-prefixed tag names a release, a
Woodpecker tag lane bakes and publishes an immutable image, and the
protected tag rule bounds the publish token.

Refs #41

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add Woodpecker validation and tag-release pipelines
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
a683a7183a
validation.yaml runs make check on pushes to main and on pull requests,
on the Containerfile's amd64 base, with no secret. release.yaml runs on
v* tags: it checks the tag is annotated, well-formed and on main, bakes
the image daemonlessly with crane in the ops-gateway shape, refuses a
version that already exists, and prints the digest last.

The bake stages each layer on the container's own filesystem so modes
and owners survive, and never tars the image root. make check now fails
when the lanes' base digest or uv pin drift from the Containerfile, or
when the bake's user, entrypoint or command differ from it.

Refs #41

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
svc-agent-writer deleted branch feat/41-release-delivery 2026-11-02 11:21:14 +00:00
Sign in to join this conversation.
No description provided.