-
-
Notifications
You must be signed in to change notification settings - Fork 40
fix(hailo): detect pre-existing hailo-ollama before installing (#2083) #3002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| ### Changed | ||
|
|
||
| - The Hailo installer (`scripts/install-hailo.sh`) now checks for a pre-existing | ||
| hailo-ollama instance on upstream port 8000 before any install or systemd | ||
| mutation. When found (a server answering `GET /api/tags` with `"models"`), the | ||
| script prints what was detected, reports that it would have built a second | ||
| server on port 7836, and exits — leaving the existing instance untouched. This | ||
| prevents the silent coexistence bug from issue #2083 where an upstream | ||
| hailo-ollama (running on its default `0.0.0.0:8000`) would go unseen while | ||
| taOS built a second server and installed no systemd unit. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -240,6 +240,28 @@ detect_hailo() { | |
| return 0 | ||
| } | ||
|
|
||
| # -------- (1.5) pre-install detection -------------------------------------- | ||
|
|
||
| # Checks for a pre-existing hailo-ollama instance running on upstream port 8000 | ||
| # (Hailo's own default / the Ollama-compatible tags endpoint). When found, logs | ||
| # what was detected and exits — taOS must not silently build a second server. | ||
| # Port 8000 is the Django slot in taOS port hygiene and is already probed as a | ||
| # llama-cpp/vllm candidate, so a coexisting server there also makes those probes | ||
| # ambiguous. See issue #2083. | ||
| detect_preexisting_hailoollama() { | ||
| local url="http://0.0.0.0:8000/api/tags" | ||
| local tags | ||
| tags="$(curl -fs "$url" 2>/dev/null || true)" | ||
| if [[ -n "$tags" ]] && grep -q '"models"' <<<"$tags"; then | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Generic Ollama-compatible check can produce false positives The Reply with |
||
| warn "pre-existing hailo-ollama detected on :8000 (Hailo's default upstream)" | ||
| log "response from $url:" | ||
| echo "$tags" | sed 's/^/ /' || true | ||
| warn "This installer would have built a second server on port $HAILO_OLLAMA_PORT." | ||
| log "The existing instance on :8000 will be left alone (not modified by this script)." | ||
| exit 0 | ||
| fi | ||
| } | ||
|
|
||
| # -------- (2) HailoRT + firmware ----------------------------------------- | ||
|
|
||
| ensure_hailort() { | ||
|
|
@@ -471,6 +493,9 @@ main() { | |
| ;; | ||
| esac | ||
|
|
||
| # Pre-install: check for a pre-existing hailo-ollama on upstream port 8000. | ||
| detect_preexisting_hailoollama | ||
|
|
||
| resolve_target | ||
|
|
||
| if already_installed; then | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: jaylfc/taOS
Length of output: 289
🏁 Script executed:
Repository: jaylfc/taOS
Length of output: 12114
Force the probe to use the local host and bound the request.
curlprobeshttp://0.0.0.0:8000/api/tagswithout proxy bypass or time limits. An ambient proxy can route this guard away from the local server, and an unresponsive listener can block the installer before it installs the managed server. Use127.0.0.1, disable proxies, and set connection and total time limits.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents