[AZ-505] Cycle 6 Steps 15-16 perf + deploy report

Step 15 (Performance Test): 8/8 PT scenarios PASS in a single
default-parameter run (exit 0). Adapts scripts/run-performance-tests.sh
for the new TLS+ALPN dev listener via CURL_OPTS=(--cacert ./certs/api.crt).
Report at _docs/06_metrics/perf_2026-05-12_cycle6.md. The clean exit-0
satisfies the cycle-3 perf-harness leftover deletion criterion that
carried across cycles 3-5; leftover file deleted.

Step 16 (Deploy): _docs/03_implementation/deploy_cycle6.md captures the
shipping payload (inventory endpoint, HTTP/2 TLS+ALPN, tiles_leaflet_path
covering index, migration 015), the dev-cert plumbing for local-docker +
integration-tests parity, the production-TLS topology note (terminate at
ingress; never promote the dev cert), and the operator runbook for
promoting cycle-6 past dev.

NU1902 / CA2227 / ASPDEPR002 / Serilog-10.x re-listed as carry-overs
unchanged; admin-team iss/aud confirmation unchanged.

State advanced to Step 17 (Retrospective).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-12 23:02:00 +03:00
parent 5d84d2839e
commit ba3bdb1918
6 changed files with 234 additions and 172 deletions
+25 -11
View File
@@ -17,10 +17,23 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
API_URL="${API_URL:-http://localhost:18980}"
API_URL="${API_URL:-https://localhost:18980}"
PERF_REPEAT_COUNT="${PERF_REPEAT_COUNT:-20}"
PERF_UAV_BATCH_SIZE="${PERF_UAV_BATCH_SIZE:-10}"
# AZ-505 dev TLS: the dev compose stack now binds Kestrel on https://+:8080 with
# a self-signed cert (./certs/api.crt) so ALPN can negotiate HTTP/2. Every curl
# below splats "${CURL_OPTS[@]}" so the cert is trusted (--cacert against the
# dev cert when present, otherwise the host-CA store). Override by exporting
# PERF_CURL_OPTS (whitespace-separated, e.g. PERF_CURL_OPTS="-k --silent") to
# bypass dev-cert logic entirely (useful against a staging cert).
CURL_OPTS=()
if [[ -n "${PERF_CURL_OPTS:-}" ]]; then
read -r -a CURL_OPTS <<<"$PERF_CURL_OPTS"
elif [[ "$API_URL" == https://* && -f "$PROJECT_ROOT/certs/api.crt" ]]; then
CURL_OPTS=(--cacert "$PROJECT_ROOT/certs/api.crt")
fi
cleanup() {
echo "Cleaning up..."
if [[ -n "${PERF_TMP_DIR:-}" && -d "${PERF_TMP_DIR}" ]]; then
@@ -138,7 +151,7 @@ wait_region_completed() {
local elapsed=0
while (( elapsed < timeout_s )); do
local status
status=$(curl -s -H "$AUTH_HEADER" "$API_URL/api/satellite/region/$region_id" | grep -o '"status":"[^"]*"' | head -1 || true)
status=$(curl "${CURL_OPTS[@]}" -s -H "$AUTH_HEADER" "$API_URL/api/satellite/region/$region_id" | grep -o '"status":"[^"]*"' | head -1 || true)
case "$status" in
*completed*) return 0 ;;
*failed*) echo " region $region_id failed during wait" >&2; return 2 ;;
@@ -156,7 +169,7 @@ echo "PT-01: Tile Download Latency (cold) (threshold: 30000ms)"
PT01_LAT="47.461347"
PT01_LON="37.646663"
START=$(date +%s%N)
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -H "$AUTH_HEADER" "$API_URL/api/satellite/tiles/latlon?Latitude=$PT01_LAT&Longitude=$PT01_LON&ZoomLevel=18")
HTTP_CODE=$(curl "${CURL_OPTS[@]}" -s -o /dev/null -w "%{http_code}" -H "$AUTH_HEADER" "$API_URL/api/satellite/tiles/latlon?Latitude=$PT01_LAT&Longitude=$PT01_LON&ZoomLevel=18")
END=$(date +%s%N)
ELAPSED_MS=$(( (END - START) / 1000000 ))
if [[ "$HTTP_CODE" == "200" ]]; then
@@ -169,7 +182,7 @@ fi
echo ""
echo "PT-02: Cached Tile Retrieval Latency (threshold: 500ms)"
START=$(date +%s%N)
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -H "$AUTH_HEADER" "$API_URL/api/satellite/tiles/latlon?Latitude=47.461747&Longitude=37.647063&ZoomLevel=18")
HTTP_CODE=$(curl "${CURL_OPTS[@]}" -s -o /dev/null -w "%{http_code}" -H "$AUTH_HEADER" "$API_URL/api/satellite/tiles/latlon?Latitude=47.461747&Longitude=37.647063&ZoomLevel=18")
END=$(date +%s%N)
ELAPSED_MS=$(( (END - START) / 1000000 ))
@@ -186,7 +199,7 @@ echo "PT-03: Region Processing 200m / zoom 18 (threshold: 60000ms)"
PT03_ID=$(uuidgen | tr '[:upper:]' '[:lower:]')
PT03_BODY="{\"id\":\"$PT03_ID\",\"latitude\":47.461747,\"longitude\":37.647063,\"sizeMeters\":200,\"zoomLevel\":18,\"stitchTiles\":false}"
START=$(date +%s%N)
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "$AUTH_HEADER" -d "$PT03_BODY" "$API_URL/api/satellite/request")
HTTP_CODE=$(curl "${CURL_OPTS[@]}" -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "$AUTH_HEADER" -d "$PT03_BODY" "$API_URL/api/satellite/request")
if [[ "$HTTP_CODE" == "200" || "$HTTP_CODE" == "202" ]]; then
if wait_region_completed "$PT03_ID" 60; then
END=$(date +%s%N)
@@ -207,7 +220,7 @@ echo "PT-04: Region Processing 500m / zoom 18 + stitch (threshold: 120000ms)"
PT04_ID=$(uuidgen | tr '[:upper:]' '[:lower:]')
PT04_BODY="{\"id\":\"$PT04_ID\",\"latitude\":47.461747,\"longitude\":37.647063,\"sizeMeters\":500,\"zoomLevel\":18,\"stitchTiles\":true}"
START=$(date +%s%N)
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "$AUTH_HEADER" -d "$PT04_BODY" "$API_URL/api/satellite/request")
HTTP_CODE=$(curl "${CURL_OPTS[@]}" -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "$AUTH_HEADER" -d "$PT04_BODY" "$API_URL/api/satellite/request")
if [[ "$HTTP_CODE" == "200" || "$HTTP_CODE" == "202" ]]; then
if wait_region_completed "$PT04_ID" 120; then
END=$(date +%s%N)
@@ -233,7 +246,7 @@ for i in 1 2 3 4 5; do
LAT=$(awk "BEGIN { printf \"%.6f\", 47.461747 + 0.001 * $i }")
LON=$(awk "BEGIN { printf \"%.6f\", 37.647063 + 0.001 * $i }")
BODY="{\"id\":\"$rid\",\"latitude\":$LAT,\"longitude\":$LON,\"sizeMeters\":200,\"zoomLevel\":18,\"stitchTiles\":false}"
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "$AUTH_HEADER" -d "$BODY" "$API_URL/api/satellite/request")
HTTP_CODE=$(curl "${CURL_OPTS[@]}" -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "$AUTH_HEADER" -d "$BODY" "$API_URL/api/satellite/request")
if [[ "$HTTP_CODE" != "200" && "$HTTP_CODE" != "202" ]]; then
echo " ✗ PT-05: enqueue $i HTTP $HTTP_CODE (expected 200/202)"
FAIL=$((FAIL + 1))
@@ -263,7 +276,7 @@ ROUTE_ID=$(uuidgen | tr '[:upper:]' '[:lower:]')
BODY="{\"id\":\"$ROUTE_ID\",\"name\":\"Perf Test\",\"regionSizeMeters\":300,\"zoomLevel\":18,\"points\":[{\"lat\":48.276067,\"lon\":37.384458},{\"lat\":48.270740,\"lon\":37.374029}]}"
START=$(date +%s%N)
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "$AUTH_HEADER" -d "$BODY" "$API_URL/api/satellite/route")
HTTP_CODE=$(curl "${CURL_OPTS[@]}" -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "$AUTH_HEADER" -d "$BODY" "$API_URL/api/satellite/route")
END=$(date +%s%N)
ELAPSED_MS=$(( (END - START) / 1000000 ))
@@ -292,7 +305,7 @@ for ((i=0; i<PERF_REPEAT_COUNT; i++)); do
lon=$(awk -v base="$PT07_BASE_LON" -v idx="$i" 'BEGIN { printf "%.6f", base + 0.002 * idx }')
body="{\"id\":\"$rid\",\"latitude\":$lat,\"longitude\":$lon,\"sizeMeters\":200,\"zoomLevel\":18,\"stitchTiles\":false}"
start=$(date +%s%N)
code=$(curl -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "$AUTH_HEADER" -d "$body" "$API_URL/api/satellite/request")
code=$(curl "${CURL_OPTS[@]}" -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "$AUTH_HEADER" -d "$body" "$API_URL/api/satellite/request")
if [[ "$code" != "200" && "$code" != "202" ]]; then
echo " ✗ PT-07 cold #$i: enqueue HTTP $code"
PT07_FAILED=$((PT07_FAILED + 1))
@@ -316,7 +329,7 @@ for ((i=0; i<PERF_REPEAT_COUNT; i++)); do
lon=$(awk -v base="$PT07_BASE_LON" -v idx="$i" 'BEGIN { printf "%.6f", base + 0.002 * idx }')
body="{\"id\":\"$rid\",\"latitude\":$lat,\"longitude\":$lon,\"sizeMeters\":200,\"zoomLevel\":18,\"stitchTiles\":false}"
start=$(date +%s%N)
code=$(curl -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "$AUTH_HEADER" -d "$body" "$API_URL/api/satellite/request")
code=$(curl "${CURL_OPTS[@]}" -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "$AUTH_HEADER" -d "$body" "$API_URL/api/satellite/request")
if [[ "$code" != "200" && "$code" != "202" ]]; then
echo " ✗ PT-07 warm #$i: enqueue HTTP $code"
PT07_FAILED=$((PT07_FAILED + 1))
@@ -394,7 +407,8 @@ else
done
metadata_json="{\"items\":[$items_json]}"
curl_args=( -s -o "$PERF_TMP_DIR/pt08_resp.json" -w "%{http_code}"
curl_args=( "${CURL_OPTS[@]}"
-s -o "$PERF_TMP_DIR/pt08_resp.json" -w "%{http_code}"
-X POST
-H "$AUTH_HEADER"
-F "metadata=$metadata_json;type=application/json" )