arm64 base guard + HAPROXY_NBTHREAD per-host thread knob (2026.11.8) #22

Merged
jknapp merged 4 commits from fix/multiarch-arm64-base-guard into main 2026-11-20 04:45:56 +00:00
Owner

arm64 base guard + HAPROXY_NBTHREAD knob (VERSION 2026.11.8)

1. arm64 verification guard (original scope)

  • Dockerfile: base-architecture guard (dpkg --print-architecture vs TARGETARCH) so a flattened amd64 base can never silently build an "arm64" image.
  • scripts/verify-image-arch.py (+ test): ELF machine check of haproxy, bash, python3.12, psutil .so, plus config arch. Fail closed.
  • build-push.yaml: verify amd64 (fatal, nothing published) and arm64 before assembling; an arm64 mismatch is kept out of the tags (amd64-only) and the job is failed.
  • Mirror precondition MET: mirror-base-image run 5745 succeeded; python:3.12-slim and golang:1.25 in the in-house registry are now real multi-platform indexes with genuine amd64 + arm64 entries (arm64 python3.12 / go binaries verified as AArch64).

2. HAPROXY_NBTHREAD per-host thread knob

HAPROXY_NBTHREAD (container env, integer 1-64) renders nbthread N in global ONLY when set; unset or invalid = not rendered, config byte-identical to 2026.11.7 (verified against main's hap_header.tpl, with and without Coraza). Why: 2026-11-19 sdbees watchdog aborts (thread spinning on a server lock held by a TLS-check thread stalled in a page fault); nbthread 1 removes the class. The WHP side (/etc/whp/edge-nbthread -> env at recreate) is a separate PR in cloud-hosting-platform/whp.
Tests: scripts/test-nbthread-knob.py + real haproxy -c scenarios nbthread-1 / nbthread-bad in validate-rendered-config.py (both in the image build gate). Release candidate: release/2026.11.8 -> :2026.11.8-rc.

🤖 Generated with Claude Code

https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6

## arm64 base guard + HAPROXY_NBTHREAD knob (VERSION 2026.11.8) ### 1. arm64 verification guard (original scope) - Dockerfile: base-architecture guard (`dpkg --print-architecture` vs TARGETARCH) so a flattened amd64 base can never silently build an "arm64" image. - scripts/verify-image-arch.py (+ test): ELF machine check of haproxy, bash, python3.12, psutil .so, plus config arch. Fail closed. - build-push.yaml: verify amd64 (fatal, nothing published) and arm64 before assembling; an arm64 mismatch is kept out of the tags (amd64-only) and the job is failed. - Mirror precondition MET: mirror-base-image run 5745 succeeded; python:3.12-slim and golang:1.25 in the in-house registry are now real multi-platform indexes with genuine amd64 + arm64 entries (arm64 python3.12 / go binaries verified as AArch64). ### 2. HAPROXY_NBTHREAD per-host thread knob `HAPROXY_NBTHREAD` (container env, integer 1-64) renders `nbthread N` in `global` ONLY when set; unset or invalid = not rendered, config byte-identical to 2026.11.7 (verified against main's hap_header.tpl, with and without Coraza). Why: 2026-11-19 sdbees watchdog aborts (thread spinning on a server lock held by a TLS-check thread stalled in a page fault); `nbthread 1` removes the class. The WHP side (`/etc/whp/edge-nbthread` -> env at recreate) is a separate PR in cloud-hosting-platform/whp. Tests: scripts/test-nbthread-knob.py + real `haproxy -c` scenarios `nbthread-1` / `nbthread-bad` in validate-rendered-config.py (both in the image build gate). Release candidate: `release/2026.11.8` -> `:2026.11.8-rc`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
jknapp added 1 commit 2026-11-20 02:27:49 +00:00
The in-house python:3.12-slim mirror tag was still a flattened amd64-only
manifest, so the linux/arm64 build ran on an amd64 base and published x86-64
binaries labelled arm64 (haproxy-manager-base:latest, :2026.11.6-rc).

- Dockerfile: fail the build when dpkg arch != TARGETARCH (no-op when correct)
- scripts/verify-image-arch.py (+ test): ELF e_machine of haproxy, bash, python,
  psutil .so per platform digest
- build-push.yaml: verify amd64 (fatal) and arm64 before assembling; an arm64
  mismatch is excluded from the tags and fails the job

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
jknapp added 1 commit 2026-11-20 03:30:09 +00:00
feat: HAPROXY_NBTHREAD per-host thread-count knob (global nbthread, only when set)
HAProxy Manager Build and Push / Build-and-Push (push) Successful in 22m41s
8ab6fdcef0
2026-11-19 sdbees: with nbthread 4 a thread spun on a server lock held by a
TLS health-check thread stalled in a page fault under memory pressure ->
watchdog abort of the whole edge. nbthread 1 removes the failure class.

HAPROXY_NBTHREAD (container env, integer 1-64) renders `nbthread N` in the
global section ONLY when set. Unset/invalid = not rendered: every other host's
config is byte-identical to before (verified against main's template, with and
without Coraza). Invalid values are ignored with a warning, never rendered.

Tests: scripts/test-nbthread-knob.py (parse, render, unset byte-identity vs the
template minus the block, no cpu-map/thread-groups), run in the image build; real
haproxy -c of nbthread 1 (+SPOE+QUIC) and of a bad value in
validate-rendered-config.py. VERSION 2026.11.8 (with the arm64 base guard).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
jknapp changed title from ci: refuse arm64 images containing non-arm64 binaries (base-arch guard + ELF verification) to arm64 base guard + HAPROXY_NBTHREAD per-host thread knob (2026.11.8) 2026-11-20 03:30:40 +00:00
jknapp added 1 commit 2026-11-20 03:45:05 +00:00
docs: nbthread comment names the real plumbing (lib-edge-container.sh)
HAProxy Manager Build and Push / Build-and-Push (push) Failing after 33m19s
4cb4ad39f8
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
jknapp added 1 commit 2026-11-20 04:20:51 +00:00
test: scale the cert-scripts subprocess timeout for emulated (non-x86) builds
HAProxy Manager Build and Push / Build-and-Push (push) Successful in 23m53s
f0a737832c
With python:3.12-slim now a real multi-arch index, the arm64 leg really runs
the image gate under QEMU (~30x slower). test-cert-scripts.py took 229 s there
and its 200-iteration bash loop exceeded a flat 120 s timeout (CI run 5756),
and the whole arm64 step then hit its 30-minute ceiling (run 5758). x86 keeps
120 s; other machines get 900 s.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
jknapp merged commit 2774399add into main 2026-11-20 04:45:56 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cloud-hosting-platform/haproxy-manager-base#22