refactor: update K8s, CI, Docker, Prometheus, scripts, and FXT CLI for api rename

- K8s: rename api-gateway → api manifests, delete web-gateway, update network policies
- CI: rename compile/deploy jobs, delete web-gateway jobs
- Docker: rename service in compose files
- Prometheus: update scrape targets and alert rules
- Scripts: update binary references in build/test/cert scripts
- FXT CLI: rename api_gateway_url → api_url (with serde alias for compat)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-03-04 23:46:36 +01:00
parent 3492b61faf
commit 57e22c01a8
37 changed files with 142 additions and 517 deletions

View File

@@ -23,7 +23,7 @@ TIMESTAMP=$(date -u +"%Y%m%d-%H%M%S")
# Services built with Dockerfile.service (--build-arg SERVICE=<name>)
STANDARD_SERVICES=(
api-gateway
api
trading-service
trading-agent-service
ml-training-service
@@ -37,7 +37,6 @@ DRY_RUN=false
PARALLEL=1
SELECTED_SERVICES=()
SKIP_STANDARD=false
SKIP_WEBGW=false
SKIP_TRAINING=false
TAG_LATEST=true
@@ -49,7 +48,6 @@ Options:
--no-push Build only, don't push to registry
--dry-run Show what would be built
--services "s1 s2" Build only these standard services
--skip-webgw Skip web-gateway build
--skip-training Skip training image build
--parallel N Run N builds concurrently (default: 1)
--no-latest Don't tag images as :latest
@@ -62,7 +60,6 @@ while [[ $# -gt 0 ]]; do
--no-push) DO_PUSH=false; shift ;;
--dry-run) DRY_RUN=true; shift ;;
--services) IFS=' ' read -ra SELECTED_SERVICES <<< "$2"; shift 2 ;;
--skip-webgw) SKIP_WEBGW=true; shift ;;
--skip-training) SKIP_TRAINING=true; shift ;;
--parallel) PARALLEL="$2"; shift 2 ;;
--no-latest) TAG_LATEST=false; shift ;;
@@ -74,7 +71,6 @@ done
# If --services was given, use only those; otherwise use all standard services
if [[ ${#SELECTED_SERVICES[@]} -gt 0 ]]; then
SERVICES=("${SELECTED_SERVICES[@]}")
SKIP_WEBGW=true
SKIP_TRAINING=true
else
SERVICES=("${STANDARD_SERVICES[@]}")
@@ -195,16 +191,6 @@ else
done
fi
# ---------------------------------------------------------------------------
# Build web-gateway (Dockerfile.web-gateway)
# ---------------------------------------------------------------------------
if [[ "$SKIP_WEBGW" != "true" ]]; then
echo ""
echo "--- Web Gateway ---"
build_and_tag "web-gateway" "infra/docker/Dockerfile.web-gateway" || true
fi
# ---------------------------------------------------------------------------
# Build training image (Dockerfile.training)
# ---------------------------------------------------------------------------
@@ -227,10 +213,6 @@ if [[ "$DO_PUSH" == "true" ]]; then
push_image "$svc"
done
if [[ "$SKIP_WEBGW" != "true" ]]; then
push_image "web-gateway"
fi
if [[ "$SKIP_TRAINING" != "true" ]]; then
push_image "training"
fi

View File

@@ -87,23 +87,23 @@ check "QuestDB HTTP health" \
"
# --- 4. Services ----------------------------------------------------------
section "Services (gRPC + web-gateway)"
section "Services (gRPC + API gateway)"
for svc in "${GRPC_SERVICES[@]}"; do
check "Pod '${svc}' is Running" \
bash -c "kubectl -n ${NAMESPACE} get pods -l app=${svc} --field-selector=status.phase=Running --no-headers 2>/dev/null | grep -q ."
done
check "Pod 'web-gateway' is Running" \
bash -c "kubectl -n ${NAMESPACE} get pods -l app=web-gateway --field-selector=status.phase=Running --no-headers 2>/dev/null | grep -q ."
check "Pod 'api' is Running" \
bash -c "kubectl -n ${NAMESPACE} get pods -l app=api --field-selector=status.phase=Running --no-headers 2>/dev/null | grep -q ."
# --- 5. Web gateway health ------------------------------------------------
section "Web Gateway Health"
# --- 5. API gateway health ------------------------------------------------
section "API Gateway Health"
check "web-gateway /health returns 200" \
check "api /health returns 200" \
bash -c "
CLUSTER_IP=\$(kubectl -n ${NAMESPACE} get svc web-gateway -o jsonpath='{.spec.clusterIP}' 2>/dev/null)
PORT=\$(kubectl -n ${NAMESPACE} get svc web-gateway -o jsonpath='{.spec.ports[0].port}' 2>/dev/null)
CLUSTER_IP=\$(kubectl -n ${NAMESPACE} get svc api -o jsonpath='{.spec.clusterIP}' 2>/dev/null)
PORT=\$(kubectl -n ${NAMESPACE} get svc api -o jsonpath='{.spec.ports[0].port}' 2>/dev/null)
kubectl -n ${NAMESPACE} run smoke-curl --rm -i --restart=Never --image=curlimages/curl -- \
curl -sf http://\${CLUSTER_IP}:\${PORT}/health
"