Files
awoooi/scripts/ops/ollama111-fallback-proxy-diagnose.sh
ogt 541a32a9cb
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m38s
CD Pipeline / build-and-deploy (push) Failing after 24m19s
CD Pipeline / post-deploy-checks (push) Has been skipped
feat(sre): enforce typed controlled automation
2026-07-16 17:32:01 +08:00

36 lines
1.4 KiB
Bash

#!/usr/bin/env bash
# Compatibility entrypoint retained for operators; the host110 proxy lane is
# retired. All probes use the canonical direct provider identities.
set -euo pipefail
GCP_A_URL="${GCP_A_URL:-http://34.143.170.20:11434}"
GCP_B_URL="${GCP_B_URL:-http://34.21.145.224:11434}"
HOST111_URL="${HOST111_URL:-http://192.168.0.111:11434}"
PUBLIC_STATUS_URL="${PUBLIC_STATUS_URL:-https://awoooi.wooo.work/api/v1/ai/status}"
CURL_TIMEOUT="${CURL_TIMEOUT:-8}"
probe() {
local provider="$1"
local url="$2"
local code
code="$(curl -sS -o /dev/null -w '%{http_code}' --max-time "${CURL_TIMEOUT}" \
"${url}/api/tags" 2>/dev/null || true)"
case "${code}" in
200) printf 'provider=%s boundary=%s status=healthy http_code=200\n' \
"${provider}" "$3" ;;
*) printf 'provider=%s boundary=%s status=unavailable http_code=%s\n' \
"${provider}" "$3" "${code:-000}" ;;
esac
}
printf 'schema_version=ollama_direct_route_diagnosis_v1 writes_performed=0\n'
probe ollama_gcp_a "${GCP_A_URL}" cloud
probe ollama_gcp_b "${GCP_B_URL}" cloud
probe ollama_local "${HOST111_URL}" local
status_code="$(curl -sS -o /dev/null -w '%{http_code}' --max-time "${CURL_TIMEOUT}" \
"${PUBLIC_STATUS_URL}" 2>/dev/null || true)"
printf 'production_route_readback_http=%s\n' "${status_code:-000}"
printf '%s\n' \
'terminal=read_only provider_order=ollama_gcp_a,ollama_gcp_b,ollama_local,claude,gemini host110_transport_selected=false'