Skip to content

fix(selfhost): add a healthcheck to the ollama service - #2548

Merged
JSONbored merged 1 commit into
mainfrom
fix/ollama-healthcheck
Jul 2, 2026
Merged

fix(selfhost): add a healthcheck to the ollama service#2548
JSONbored merged 1 commit into
mainfrom
fix/ollama-healthcheck

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • The ollama service in docker-compose.yml had no healthcheck: block, unlike every other optional backend (qdrant, postgres, tempo, the backup-exporter). Operators following the in-file --profile ollama instructions got no compose-level signal that Ollama finished starting and is accepting API calls before the app starts using it, and there was no way to add a depends_on: ollama: condition: service_healthy gate even if desired later.
  • Added a healthcheck using ollama list — the image ships the ollama CLI but no curl/wget/nc, and ollama list only succeeds once the daemon is actually serving; verified locally against a running ollama/ollama:0.30.10 container.

Closes #2504.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally — this is a docker-compose.yml/test/** change with no src/** lines, so it carries no Codecov patch obligation; the new structural YAML assertion passes.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. — N/A.
  • API/OpenAPI/MCP behavior is updated and tested where needed. — N/A.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. — N/A, no UI changes.
  • Visible UI changes include a UI Evidence section below — N/A, no UI changes.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

Notes

ollama had no healthcheck block, unlike every other optional backend
(qdrant, postgres, tempo, the backup-exporter). Operators following the
in-file --profile ollama instructions got no compose-level signal that
Ollama finished starting and is accepting API calls before the app
starts using it, and there was no way to add a depends_on: ollama:
condition: service_healthy gate even if desired later.

Use `ollama list` as the probe (the image ships the ollama CLI but no
curl/wget/nc) -- it only succeeds once the daemon is actually serving.
@dosubot dosubot Bot added the size:XS label Jul 2, 2026
@loopover-orb

loopover-orb Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-02 09:09:17 UTC

2 files · 1 AI reviewer · no blockers · readiness 77/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
The diff adds a narrowly scoped Docker Compose healthcheck for the optional Ollama service and a structural unit test that verifies the probe command is present. The probe choice is consistent with the stated image constraints and does not change startup ordering or default profile behavior. The visible change is safe enough to proceed; the main gap is that the test only pins part of the healthcheck contract.

Nits — 3 non-blocking
  • nit: test/unit/selfhost-compose-ollama-health.test.ts:24 only asserts the healthcheck command and positive retries, so interval, timeout, and start_period could drift without this regression test noticing.
  • test/unit/selfhost-compose-ollama-health.test.ts:24 should assert the full healthcheck shape from docker-compose.yml, including interval, timeout, start_period, and retries, so the test covers the operator-facing behavior this PR adds.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2504
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (size label size:XS; 1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 65 registered-repo PR(s), 55 merged, 548 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 65 PR(s), 548 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Triage stale or unlinked PRs.
  • No action.
  • Check active issues and PRs before submitting.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.98%. Comparing base (75d7530) to head (0a7aeea).
⚠️ Report is 27 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2548      +/-   ##
==========================================
+ Coverage   95.95%   95.98%   +0.03%     
==========================================
  Files         226      229       +3     
  Lines       25423    25814     +391     
  Branches     9244     9391     +147     
==========================================
+ Hits        24395    24778     +383     
- Misses        417      425       +8     
  Partials      611      611              

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 13fc639 into main Jul 2, 2026
13 checks passed
@JSONbored
JSONbored deleted the fix/ollama-healthcheck branch July 2, 2026 09:21
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

fix(selfhost): add a healthcheck to the ollama service

1 participant