Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ services:
condition: service_healthy
redis:
condition: service_healthy
ollama:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8000/health || exit 1"]
interval: 15s
Expand All @@ -77,8 +75,6 @@ services:
condition: service_healthy
redis:
condition: service_healthy
ollama:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "celery -A app.worker inspect ping || exit 1"]
interval: 30s
Expand Down
24 changes: 24 additions & 0 deletions tests/test_soft_ai_dependency_compose.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from __future__ import annotations

from pathlib import Path


ROOT = Path(__file__).resolve().parents[1]


def _compose_service(compose: str, service_name: str, next_service: str) -> str:
return compose.split(f" {service_name}:", 1)[1].split(f" {next_service}:", 1)[0]


def test_api_and_worker_do_not_wait_on_ollama_health_to_boot() -> None:
compose = (ROOT / "docker-compose.yml").read_text(encoding="utf-8")
api_service = _compose_service(compose, "api", "worker")
worker_service = _compose_service(compose, "worker", "beat")

assert "ollama/ollama:latest" in compose
for service in (api_service, worker_service):
depends_on = service.split("depends_on:", 1)[1].split("healthcheck:", 1)[0]
assert "postgres:" in depends_on
assert "redis:" in depends_on
assert "condition: service_healthy" in depends_on
assert "ollama:" not in depends_on