Skip to content

feat(chart): build hosts — the chart can create the build-cache claim - #7189

Closed
rbuergi wants to merge 3 commits into
mainfrom
feat/build-host-cache-apparmor
Closed

rbuergi wants to merge 3 commits into
mainfrom
feat/build-host-cache-apparmor

Conversation

@rbuergi

@rbuergi rbuergi commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

The maintainer chose two prerequisites for the standing build hosts (2026-10-25): a cache volume the chart creates, and an AppArmor profile rather than the node-wide sysctl. This PR adds the first. The second's loader is node-level setup, so it lands in the estate's CI-runners lane, not here.

  • buildHosts.cache.create renders the build-cache RWX claim. storageClass and size are required, and the claim is kept on uninstall (helm.sh/resource-policy: keep). It is opt-in, so every estate renders unchanged.
  • The AppArmor profile is not the chart's. An operator Job applies the chart and holds no write on DaemonSets, by design (operator-rbac.yaml's scope note: platform setup is installed by an approved lane, never by a lifecycle run). The first revision of this PR shipped a loader DaemonSet, and the operator's every kind the chart renders is writable check turned red on it; that revision is removed. The record names the profile through the existing sandbox.appArmorProfile: Localhost / appArmorLocalhostProfile: mw-build-host. The chart test now refuses any node-level DaemonSet rendered by the chart.

Tests:

  • test-build-hosts.sh: the claim's shape and keep policy, nothing rendered without cache.create, no DaemonSet, and a refusal for cache.create without a class.
  • operator/test/run-tests.sh: green, including the RBAC coverage check.
  • BuildHosts §3 and §6 are updated.

🤖 Generated with Claude Code

… and load an AppArmor profile granting userns

buildHosts.cache.create renders the shared RWX build-cache claim (storageClass and size required,
kept on uninstall). buildHosts.sandbox.appArmorLoader ships one profile, mw-build-host (unconfined
apart from granting userns, since RuntimeDefault denies the mount bwrap needs), and a privileged
DaemonSet on the hosts' pools loads it with the runner image's apparmor_parser. The host pods then
run under Localhost/mw-build-host, and naming any other profile beside the loader is refused. The runner image
gains apparmor (parser >= 4, asserted). Both are opt-in, so every estate renders unchanged.
Chart test: the claim, the loader and the pods' profile, plus two refusals; a profile that drops
userns turns it red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 25, 2026 11:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The constant loader checksum allows profile-only upgrades to leave stale kernel policy loaded while readiness remains green.

1 open issue
What changed in this PR

This PR adds opt-in infrastructure for standing build hosts: a chart-managed shared cache and an AppArmor loader that enables sandbox user namespaces.

Changes:

  • Adds a retained ReadWriteMany cache claim with required storage class and size.
  • Adds an AppArmor profile and loader DaemonSet, plus parser support in the runner image.
  • Extends chart checks, refusal fixtures, and documentation; live-node compatibility remains unverified.
File Description
src/​MeshWeaver.Documentation/​Data/​Architecture/​BuildHosts.md Documents cache creation, profile loading, and pending live verification.
deploy/​helm/​values.yaml Adds opt-in cache and loader settings.
deploy/​helm/​templates/​build-host/​cache-pvc.yaml Creates the retained shared cache claim.
deploy/​helm/​templates/​build-host/​apparmor-loader.yaml Defines the AppArmor profile and loader DaemonSet.
deploy/​helm/​templates/​build-host/​_build-hosts.tpl Validates cache settings and selects the loader’s profile.
deploy/​build-host/​Dockerfile Installs AppArmor and checks parser version 4.
deploy/​aks/​scripts/​testdata/​values.build-hosts-loader.yaml Provides a cache-and-loader fixture.
deploy/​aks/​scripts/​testdata/​values.build-hosts-loader-other-profile.yaml Tests refusal of a conflicting profile.
deploy/​aks/​scripts/​testdata/​values.build-hosts-cache-no-class.yaml Tests refusal of a missing storage class.
deploy/​aks/​scripts/​test-build-hosts.sh Checks rendered resources, opt-in behavior, and refusals.

Review effort: Balanced

rbuergi and others added 2 commits October 25, 2026 13:06
… not the chart's

An operator Job applies the chart and holds no write on DaemonSets, by design. Loading a kernel
profile onto a node pool is node-level setup that the estate's CI-runners lane applies, never an
instance release. The chart keeps the cache claim; the pods name the profile through the existing
sandbox.appArmorProfile Localhost / appArmorLocalhostProfile keys. The loader, its fixture and the
runner image's apparmor package are removed, and the chart test now refuses any node-level
DaemonSet rendered by the chart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rbuergi rbuergi changed the title feat(chart): build hosts — chart-created build-cache claim and an AppArmor loader granting userns feat(chart): build hosts — the chart can create the build-cache claim Oct 25, 2026
@github-actions
github-actions Bot requested a balanced review from Copilot October 25, 2026 12:07
@rbuergi
rbuergi enabled auto-merge (squash) October 25, 2026 12:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No blocking correctness issues remain; the retained feedback is a non-blocking documentation-convention correction.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment on lines +532 to +533
profile that grants `userns` to the build container. **Decided (maintainer, 2026-10-25): the
profile.** The estate's CI-runners lane loads it onto the CI pools and the record names it (§3). Whether a host on the
@rbuergi
rbuergi disabled auto-merge October 25, 2026 12:20
@rbuergi

rbuergi commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Closing this one: core's chart is frozen, and chart edits now go to Systemorph/MeshWeaver.Deploy. The content isn't dropped. The buildHosts.cache.create claim, its chart-test cases and the cache-no-class refusal will be re-opened against MeshWeaver.Deploy, together with the versioned-server chart half of #7191, once Deploy carries the build-host chart (the port of #7143 and #7159). The AppArmor loader already moved out, to Systemorph/Memex#828. Both review points here are addressed there: it reloads on a profile change, and the doc carries no dated decision marker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants