Add hotpatch apply and revert for caproni

Closes #29 (closed)

hotpatch apply|verify|revert|status now runs on a caproni rig (the Helm chart on k3s) with the omnibus interface and the same per-service proof.

Apply writes the patched files into a ConfigMap and mounts each one by subPath onto every workload that runs the code: webservice, sidekiq and toolbox. A pod-template annotation carrying the tree digest forces the roll, because a subPath mount never sees a ConfigMap edit. Each pod is proven by hashing the files from inside it, stock before the roll and patched after. Revert removes the overlay, rolls and re-proves stock. A workload that stays stock fails the run and is named.

flowchart LR
  A[apply diff] --> B[prove stock in each pod]
  B --> C[ConfigMap and subPath mounts]
  C --> D[roll and wait ready]
  D --> E[hash files in each pod]
  E -->|any pod stock| F[fail, name the workload]
  E -->|all patched| G[state records per-workload proof]
  G --> H[revert: remove overlay, roll]
  H --> I[hash files in each pod, expect stock]

The hotpatch-per-service probe now covers caproni through a per-base script in probes.json. gce/patched-code.md is a pointer at the recipe, which pays for the new words; the word budget stays under its ceiling.

Proof

  • hotpatch-caproni-selftest.sh on a fake kubectl: apply, per-pod proof, a workload that stays stock, bad and unsupported diffs, revert, readiness. 76 checks.
  • Live on one caproni rig: a harmless edit to lib/gitlab/abuse.rb plus a new lib/sim_hotpatch_marker.rb. Per-pod hash was stock (5446ce33a6d4), then patched (348f0ec6897f) on webservice, sidekiq and toolbox, then stock again after revert. Sign-in returned 200 on all 118 samples across the apply, verify and revert. probe hotpatch-per-service passed with the patch applied. The rig is torn down.
  • A first apply with a marker file that broke Zeitwerk naming failed loudly, left the old webservice pod serving, and revert restored stock from that failed state.

Merge request reports

Loading
Loading