quality / changes (push) Successful in 7s
quality / commitlint (push) Skipped
quality / openapi (push) Successful in 30s
quality / web (push) Successful in 1m3s
quality / api (push) Successful in 1m15s
quality / linux-agent-smoke (push) Failing after 27s
quality / docker-check (push) Failing after 2m28s
CD / quality (push) Failing after 5m52s
CD / publish (push) Skipped
Implement reliable agent apply, telemetry v2, analytics retention, guarded rollouts, enrollment, labels and webhooks. Improve ReUI frontend data safety and bounded list loading, and add Docker smoke, recovery and resource checks. Document local verification and pending native acceptance.
40 lines
2.2 KiB
Bash
40 lines
2.2 KiB
Bash
#!/usr/bin/env sh
|
|
# Linux/Docker host, isolated fixture only. Pass the same image to repeat a run.
|
|
set -eu
|
|
image="${1:?Usage: runtime.sh IMAGE OUTPUT_DIR}"
|
|
out="${2:?OUTPUT_DIR required}"
|
|
[ ! -e "$out" ] || { echo 'Use a new output directory for each baseline run' >&2; exit 1; }
|
|
mkdir -p "$out"
|
|
id="evofw-bench-$(date +%s)-$$"
|
|
volume="$id-data"
|
|
cleanup() {
|
|
docker logs "$id" >"$out/container.log" 2>&1 || true
|
|
[ -z "${sampler:-}" ] || { kill "$sampler" 2>/dev/null || true; wait "$sampler" 2>/dev/null || true; }
|
|
docker rm -f "$id" >/dev/null 2>&1 || true
|
|
docker volume rm "$volume" >/dev/null 2>&1 || true
|
|
}
|
|
trap cleanup EXIT HUP INT TERM
|
|
docker version >"$out/docker-version.txt"
|
|
docker info >"$out/docker-info.txt"
|
|
docker image inspect "$image" >"$out/image.json"
|
|
if docker volume inspect "$volume" >/dev/null 2>&1; then echo 'Refusing reused benchmark volume' >&2; exit 1; fi
|
|
docker volume create "$volume" >/dev/null
|
|
started="$(date +%s)"
|
|
docker run -d --name "$id" --cpus 2 --memory 4g --publish 127.0.0.1::8080 \
|
|
--mount "type=volume,src=$volume,dst=/data" -e EVOFW_ALLOW_UNSAFE=true -e AUTH_REQUIRED=false "$image" >/dev/null
|
|
attempts=0
|
|
until docker exec "$id" node -e "fetch('http://127.0.0.1:8080/ready').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))" >/dev/null 2>&1; do
|
|
attempts=$((attempts + 1)); [ "$attempts" -lt 120 ] || exit 1; sleep 1
|
|
done
|
|
printf '{"coldReadySeconds":%s,"cpus":2,"memoryBytes":4294967296}\n' "$(( $(date +%s) - started ))" >"$out/startup.json"
|
|
docker exec -i "$id" node --input-type=module <scripts/bench/fixture.mjs >"$out/fixture.json"
|
|
# Includes CPU, memory, block IO and PIDs. Metrics are raw observations, no claimed gains.
|
|
(while docker inspect -f '{{.State.Running}}' "$id" 2>/dev/null | grep -q true; do docker stats --no-stream --format '{{json .}}' "$id"; sleep 1; done) >"$out/stats.jsonl" &
|
|
sampler=$!
|
|
port="$(docker port "$id" 8080/tcp | sed 's/.*://')"
|
|
BENCH_P95_LIMIT_MS="${BENCH_P95_LIMIT_MS:-500}" BENCH_URL="http://127.0.0.1:$port" node scripts/bench/load.mjs >"$out/load.json" || load_failed=true
|
|
cat "$out/load.json"
|
|
docker exec "$id" sh -c 'ls -ln /data/app.db*; cat /proc/1/status; cat /proc/1/io' >"$out/db-process.txt"
|
|
sh deploy/docker/backup.sh "$id" "$out/backup.db"
|
|
[ "${load_failed:-false}" = false ]
|