fix: accept auth-protected OmniRoute health
Homelab Main / validate (push) Waiting to run Details
Homelab Main / running-update (push) Blocked by required conditions Details
Homelab Main / debian-ops (push) Blocked by required conditions Details

This commit is contained in:
juvenal.diaz 2026-10-08 08:44:05 -06:00
parent e0882d0779
commit d7d9e4822f
1 changed files with 6 additions and 2 deletions

View File

@ -5339,6 +5339,7 @@ deploy_ai_stack() {
local port="${LAB_OMNIROUTE_PORT:-20128}"
local container_name="${LAB_OMNIROUTE_CONTAINER_NAME:-omniroute}"
local existing_workdir
local models_status
require_debian_server "deploy-ai-stack"
@ -5380,10 +5381,13 @@ deploy_ai_stack() {
sudo docker compose --env-file "${install_dir}/.env" ps
)
if curl -fsS --connect-timeout 2 --max-time 5 "http://127.0.0.1:${port}/v1/models" >/dev/null 2>&1; then
models_status="$(curl -sS -o /dev/null -w '%{http_code}' --connect-timeout 2 --max-time 5 "http://127.0.0.1:${port}/v1/models" 2>/dev/null || true)"
if [[ "${models_status}" == "200" ]]; then
echo "AI gateway OpenAI-compatible endpoint is reachable at http://127.0.0.1:${port}/v1."
elif [[ "${models_status}" == "401" ]]; then
echo "AI gateway OpenAI-compatible endpoint is reachable and auth-protected at http://127.0.0.1:${port}/v1."
else
echo "AI gateway container started, but /v1/models did not respond yet; check logs with:" >&2
echo "AI gateway container started, but /v1/models returned HTTP ${models_status:-000}; check logs with:" >&2
echo " cd ${install_dir} && sudo docker compose --env-file .env logs --tail=120" >&2
fi