fix(im_llm): 代理绕过Docker内部hostname
This commit is contained in:
1 parent
96aabc31f6
commit
9a43ee244d
24 files changed
+898
-129
No files matched your search
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
set -uo pipefail
|
||||
CONTAINER="qihu-aiflow"
|
||||
RED='\033[0;31m'; GREEN='\033[0;32m'; NC='\033[0m'
|
||||
fail() { echo -e "${RED}[pre-commit] FAIL: $*${NC}" >&2; exit 1; }
|
||||
|
||||
if ! docker ps --format '{{.Names}}' | grep -qx "$CONTAINER"; then
|
||||
echo "[pre-commit] WARNING: container $CONTAINER not running, skip" >&2; exit 0
|
||||
fi
|
||||
|
||||
AUDIT_JSON=$(curl -s --max-time 15 http://localhost:18080/app/api/health/bug-audit 2>/dev/null)
|
||||
if [ -z "$AUDIT_JSON" ]; then
|
||||
echo "[pre-commit] WARNING: bug-audit not reachable, skip" >&2; exit 0
|
||||
fi
|
||||
|
||||
HEALTHY=$(echo "$AUDIT_JSON" | python3 -c "import json,sys;d=json.load(sys.stdin);dd=d.get('data',d);print(dd.get('healthy',''))" 2>/dev/null)
|
||||
if [ "$HEALTHY" != "True" ]; then
|
||||
echo "$AUDIT_JSON" | python3 -c "import json,sys;d=json.load(sys.stdin);dd=d.get('data',d);[print(' ISSUE:',i) for i in dd.get('issues',[])]" 2>/dev/null
|
||||
fail "bug-audit returned unhealthy"
|
||||
fi
|
||||
echo "[pre-commit] bug-audit PASSED"; exit 0
|
||||
Reference in new issue
Block a user