Repository navigation
74 lines (66 loc) · 2.74 KB
/
Copy pathperf-regression.yml
File metadata and controls
74 lines (66 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Performance Regression
on:
pull_request:
branches: [main]
permissions:
contents: read
jobs:
perf-smoke:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.11"
- name: Install dependencies
run: bash scripts/ci_sync.sh perf
- name: Run entity perf smoke gate
shell: bash
env:
# DuckDB-profile perf gate: the 500 ms p99 threshold was calibrated on the
# embedded engine. The shipped ClickHouse path is exercised by the E2E
# workflow's ClickHouse lane, not by this latency gate.
SERVING_BACKEND: duckdb
DUCKDB_PATH: .artifacts/perf-smoke/agentflow-perf.duckdb
AGENTFLOW_USAGE_DB_PATH: .artifacts/perf-smoke/agentflow-api-usage.duckdb
AGENTFLOW_AUTH_DISABLED: "true"
AGENTFLOW_API_KEYS: ""
AGENTFLOW_API_KEYS_FILE: ""
AGENTFLOW_ADMIN_KEY: ""
REDIS_URL: redis://localhost:6379
OTEL_SDK_DISABLED: "true"
PYTHONUNBUFFERED: "1"
run: |
set -euo pipefail
mkdir -p .artifacts/perf-smoke
docker compose up -d --wait redis
python tests/load/run_load_test.py --duckdb-path "$DUCKDB_PATH" --seed-data --seed-only
python -m uvicorn agentflow_runtime.serving.api.main:app --host 127.0.0.1 --port 8012 > .artifacts/perf-smoke/api.log 2>&1 &
api_pid=$!
trap 'kill "$api_pid" 2>/dev/null || true; docker compose stop redis >/dev/null 2>&1 || true' EXIT
python scripts/wait_for_services.py --url http://127.0.0.1:8012 --timeout 120
python scripts/profile_entity.py \
--host http://127.0.0.1:8012 \
--entity-type order \
--entity-id ORD-20260404-1001 \
--iterations 2000 \
--concurrency 16 \
--output .artifacts/perf-smoke/entity-profile.json
python - <<'PY'
import json
from pathlib import Path
payload = json.loads(
Path(".artifacts/perf-smoke/entity-profile.json").read_text(encoding="utf-8")
)
p99_ms = float(payload["p99_ms"])
if p99_ms > 500:
raise SystemExit(f"p99_ms {p99_ms:.1f} exceeds perf-smoke gate 500 ms")
print(f"p99_ms {p99_ms:.1f} is within perf-smoke gate 500 ms")
PY
- name: Upload performance artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: perf-smoke-results
path: .artifacts/perf-smoke/