ADR-0066: evo-server --ops-listen serves /livez (loop responding, never authority), /readyz (200 only while the host holds the lease with a verified recovered head) and /metrics (Prometheus text: 30 fixed series for readiness, phase, lease epoch/remaining, simulated/committed ticks, commit lag, checkpoint age, tick debt, queue use and bounds, and counters; the only labels are a 6-value phase and 4-value drop reason). The dependency-free OpsServer runs on the host loop with no thread: GET on exact paths, 405/404/400/431 responses, 8 connections with excess refused on accept, 4 KiB requests, 1 s deadlines, 16 KiB responses. HostStatus/phase types moved to the portable evo::ops library with a Windows-tested renderer. evo-server now refuses to start without its required identity and connection settings. Adds the server-runtime Docker target (evo-server + pinned libpq, UID 10001, no credentials), a CI server-image job with smoke script and optional publishing, and a Kubernetes example outside Argo. Validated: Windows CTest 59/59; Linux Debug/Release/clang-tidy/ASan CTest 59/59; PostgreSQL suites under Release, clang-tidy and ASan with real process probes; two ops mutations caught. Docker build/smoke and Gitea CI not executed locally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
1.0 KiB
Bash
27 lines
1.0 KiB
Bash
#!/usr/bin/env bash
|
|
# Smoke test for the evo-server image (M7.8, ADR-0066). Runs the image with the
|
|
# same restrictions a cluster uses; no network, no credentials, read-only root.
|
|
set -euo pipefail
|
|
image="${1:?image reference}"
|
|
run() {
|
|
docker run --rm --network none --read-only --cap-drop ALL \
|
|
--security-opt no-new-privileges "$@"
|
|
}
|
|
# Without configuration the server refuses to start (usage, exit 2), and never
|
|
# falls back to any default region or database.
|
|
set +e
|
|
usage="$(run "$image" 2>&1)"
|
|
code=$?
|
|
set -e
|
|
test "$code" -eq 2
|
|
grep -q '^usage: evo-server ' <<<"$usage"
|
|
# Non-root, every shared library resolved, no credential material in the image.
|
|
run --entrypoint /bin/sh "$image" -c '
|
|
set -eu
|
|
test "$(id -u)" = 10001 && test "$(id -g)" = 10001
|
|
! ldd /usr/local/bin/evo-server | grep -q "not found"
|
|
test -z "$(find / -xdev \( -name "*pgpass*" -o -name "pg_service.conf" -o -name "*.pem" \
|
|
-o -name "*.key" \) -not -path "/etc/ssl/*" -not -path "/usr/share/*" -print 2>/dev/null)"
|
|
'
|
|
echo "server image smoke passed: $image"
|