a2d238d92e
Make Zed Agent closer to Cursor: deterministic DevOps path index, live Traefik port probe before blind edits, stop-after-edit, and quieter Russian progress.
36 lines
1.7 KiB
Bash
36 lines
1.7 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
cd "$ROOT"
|
|
PYTHONPATH=router python3 -m py_compile \
|
|
router/agent_hier.py router/router.py router/agent_stream.py \
|
|
router/path_resolve.py router/hierarchical.py
|
|
PYTHONPATH=router python3 -m unittest discover -s test/unit -q
|
|
scp router/agent_hier.py router/router.py router/agent_stream.py \
|
|
router/path_resolve.py router/hierarchical.py \
|
|
eventhub-ift:/opt/ai-router-stack/router/
|
|
scp config/orchestration.yaml eventhub-ift:/opt/ai-router-stack/config/
|
|
ssh -o BatchMode=yes eventhub-ift bash -s <<'REMOTE'
|
|
set -euo pipefail
|
|
cd /opt/ai-router-stack
|
|
set -a; source .env; set +a
|
|
sed -i 's/\r$//' router/*.py config/orchestration.yaml || true
|
|
docker build -f router/Dockerfile -t "${ROUTER_IMAGE:-git.sabilin.com/eventhub/ai-router-gateway:ift}" .
|
|
TS=$(date +%Y%m%d%H%M%S)
|
|
ORCH="orchestration_config_${TS}"
|
|
docker config create "$ORCH" ./config/orchestration.yaml
|
|
OLD_ORCH=$(docker service inspect ai-router_router --format '{{range .Spec.TaskTemplate.ContainerSpec.Configs}}{{println .ConfigName}}{{end}}' | grep orchestration | tail -1 || true)
|
|
RARGS=(--image "${ROUTER_IMAGE:-git.sabilin.com/eventhub/ai-router-gateway:ift}" --force)
|
|
RARGS+=(--config-add "source=${ORCH},target=/app/config/orchestration.yaml")
|
|
[[ -n "${OLD_ORCH:-}" ]] && RARGS+=(--config-rm "$OLD_ORCH")
|
|
docker service update "${RARGS[@]}" ai-router_router >/dev/null
|
|
for i in $(seq 1 40); do
|
|
curl -sf --max-time 5 https://ai-router.ift.calentiq.com/health >/dev/null && break
|
|
sleep 2
|
|
done
|
|
docker exec "$(docker ps -q -f name=ai-router_router | head -1)" \
|
|
grep -E 'path_resolve_' /app/config/orchestration.yaml
|
|
test -f /opt/ai-router-stack/router/path_resolve.py
|
|
echo PATH_RESOLVE_OK
|
|
REMOTE
|