Fix fidelity job: reach sidecars via shared netns, not ip (#69)
All checks were successful
CD / Build and push images (push) Successful in 57s
CI / Lint, typecheck, test (push) Successful in 3m2s
CI / Auth e2e pack (push) Successful in 4m1s
CI / Import/export fidelity gate (push) Successful in 50s
CI / Build container images (push) Has been skipped
CD / Deploy to Test (push) Successful in 9s
CD / Smoke tests against Test (push) Successful in 1m8s
CD / Promote to Int (push) Has been skipped

The runner image has no iproute2, so `ip -4 route` failed (exit 127) and the
readiness curl never got a gateway — the job died before the tests ran.
Attach the pandoc/Gotenberg sidecars to the job container's own network
namespace (`--network container:$(cat /etc/hostname)`) and reach them at
localhost, dropping the `ip`/host-gateway plumbing and published ports.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EwZ4jR4KFAPvpjWevfUGX1
This commit is contained in:
Claude Opus 4.8 2026-07-10 15:18:53 +02:00
parent 756d0627e2
commit ec469e1bc2

View File

@ -377,34 +377,34 @@ jobs:
run: pnpm --filter @dorfteich/api exec prisma generate run: pnpm --filter @dorfteich/api exec prisma generate
# Start the pinned sidecars with `docker run` (pandoc-server needs the # Start the pinned sidecars with `docker run` (pandoc-server needs the
# `server` arg, which Actions `services:` cannot pass). Their published # `server` arg, which Actions `services:` cannot pass) and attach them to
# ports are reached from this job container via the Docker host gateway — # THIS job container's network namespace, so they are reachable at
# robust regardless of the runner's per-job network name. Uncommon host # localhost — no dependency on `ip`/gateway routing (the minimal runner
# ports avoid colliding with anything else on the runner. # image has no iproute2). Sharing the netns means no published ports.
- name: Start pinned pandoc + Gotenberg sidecars - name: Start pinned pandoc + Gotenberg sidecars
run: | run: |
# Clear any leftovers from an earlier interrupted run so the named # Clear any leftovers from an earlier interrupted run so the named
# containers never collide, and nothing leaks on the shared host. # containers never collide, and nothing leaks on the shared host.
docker rm -f fidelity-pandoc fidelity-gotenberg 2>/dev/null || true docker rm -f fidelity-pandoc fidelity-gotenberg 2>/dev/null || true
docker run -d --name fidelity-pandoc -p 13030:3030 pandoc/core:3.6 server JOB_ID=$(cat /etc/hostname)
docker run -d --name fidelity-gotenberg -p 13000:3000 gotenberg/gotenberg:8 docker run -d --name fidelity-pandoc \
GW=$(ip -4 route show default | awk '{print $3; exit}') --network "container:${JOB_ID}" pandoc/core:3.6 server
echo "SIDECAR_HOST=$GW" >> "$GITHUB_ENV" docker run -d --name fidelity-gotenberg \
--network "container:${JOB_ID}" gotenberg/gotenberg:8
for i in $(seq 1 30); do for i in $(seq 1 30); do
curl -sf "http://$GW:13030/version" >/dev/null && break curl -sf http://localhost:3030/version >/dev/null && break
sleep 1 sleep 1
done done
for i in $(seq 1 30); do for i in $(seq 1 30); do
curl -sf "http://$GW:13000/health" >/dev/null && break curl -sf http://localhost:3000/health >/dev/null && break
sleep 1 sleep 1
done done
curl -sf "http://$GW:13030/version" curl -sf http://localhost:3030/version
curl -sf "http://$GW:13000/health" curl -sf http://localhost:3000/health
- name: Run fidelity suite (import + export snapshots, PDF smoke) - name: Run fidelity suite (import + export snapshots, PDF smoke)
run: | run: |
PANDOC_URL="http://${SIDECAR_HOST}:13030" \ PANDOC_URL=http://localhost:3030 GOTENBERG_URL=http://localhost:3000 \
GOTENBERG_URL="http://${SIDECAR_HOST}:13000" \
pnpm --filter @dorfteich/api exec vitest run \ pnpm --filter @dorfteich/api exec vitest run \
src/import-export/import.fixtures.test.ts \ src/import-export/import.fixtures.test.ts \
src/import-export/export.fidelity.test.ts \ src/import-export/export.fidelity.test.ts \