Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

ci: full docker-compose integration test + drop ollama model pre-pull (#3886)

LearningCircuit4540adaac24c
diff --git a/.github/workflows/compose-integration-test.yml b/.github/workflows/compose-integration-test.yml
new file mode 100644
index 0000000000..7026ed7aec
--- /dev/null
+++ b/.github/workflows/compose-integration-test.yml
@@ -0,0 +1,177 @@
+name: Compose Integration Test
+
+# Brings up the bundled docker-compose.yml end-to-end in CI and verifies the
+# whole stack (searxng, ollama, local-deep-research) reaches a healthy state.
+# This is the test that would have caught #3874 (broken cap_drop on searxng)
+# before users hit it. See #3886 for the rationale.
+#
+# Cost: ~3-6 min per run depending on cache state. Runs only via the release
+# pipeline (`release.yml` includes it as `compose-integration-gate`) and on
+# manual dispatch. NOT inside `release-gate.yml`, because release-gate runs
+# daily and the failure modes here (compose/image changes) are tied to
+# actual release events, not time. NOT on pull_request — too expensive for
+# per-PR feedback latency.
+#
+# Tests the docker-compose.yml as users actually run it — no test-only
+# overrides. The model pre-pull was removed from the compose itself in this
+# same PR so the stack starts in seconds rather than waiting on a multi-GB
+# download that the test doesn't need.
+
+on:
+ workflow_call:
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ compose-up:
+ name: docker compose up + healthcheck
+ runs-on: ubuntu-latest
+ timeout-minutes: 25
+
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
+ with:
+ egress-policy: audit
+
+ - name: Checkout
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
+
+ # Build the LDR image from the working tree and tag it as the name the
+ # bundled compose references. Compose then uses the local image instead
+ # of pulling the published one — so we test the current code path, not
+ # whatever's on Docker Hub.
+ - name: Build LDR image with the published tag
+ uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
+ with:
+ context: .
+ # Same target as docker-tests.yml's `ldr-prod` build, so its cache
+ # layers (scope=ldr-prod, populated by ci-gate during the same
+ # release pipeline) are reusable here. Explicit target guards
+ # against future Dockerfile reorderings making the default stage
+ # something other than `ldr`.
+ target: ldr
+ load: true
+ tags: localdeepresearch/local-deep-research:latest
+ # Read from both our own scope and the shared `ldr-prod` scope —
+ # whichever has the layers wins. Falls back to a fresh build if
+ # neither does (e.g. on a brand-new branch). Only write to our
+ # own scope so we don't poison the cross-workflow cache.
+ cache-from: |
+ type=gha,scope=compose-integration
+ type=gha,scope=ldr-prod
+ cache-to: type=gha,mode=max,scope=compose-integration
+
+ - name: Bring up the stack
+ # `docker compose up -d` pulls any image it doesn't have locally
+ # (default pull_policy: missing), so ollama and searxng are pulled
+ # inline. The LDR image is the locally-built one from the previous
+ # step — compose sees it's already present and uses it as-is.
+ run: docker compose up -d
+
+ - name: Wait for the stack to be healthy and serving
+ # Budget: 6 min covers cold daemon startup + LDR migrations + flask
+ # boot + slow CI runners. Without the model pull this completes in
+ # ~1-2 min on a warm runner.
+ #
+ # Container resolution: always via `docker compose ps -q <service>`
+ # so we don't couple to compose's `container_name:` values. If those
+ # drift, this still works.
+ run: |
+ set -euo pipefail
+ deadline=$(( $(date +%s) + 360 ))
+
+ cid_for() { docker compose ps -q "$1" 2>/dev/null || true; }
+ status() {
+ local cid=$1
+ [ -n "$cid" ] || { echo missing; return; }
+ docker inspect -f "{{if .State.Health}}{{.State.Health.Status}}{{else}}{{.State.Status}}{{end}}" "$cid" 2>/dev/null || echo missing
+ }
+
+ while :; do
+ now=$(date +%s)
+ if [ "$now" -ge "$deadline" ]; then
+ echo "::error::Timed out after 6 min waiting for stack to be healthy"
+ docker compose ps
+ exit 1
+ fi
+
+ ollama_id=$(cid_for ollama)
+ searxng_id=$(cid_for searxng)
+ ldr_id=$(cid_for local-deep-research)
+
+ ollama_h=$(status "$ollama_id")
+ searxng_h=$(status "$searxng_id")
+ ldr_h=$(status "$ldr_id")
+
+ echo "[$(date -u +%H:%M:%S)] ollama=$ollama_h searxng=$searxng_h ldr=$ldr_h"
+
+ # All three services have healthchecks: ollama and searxng via
+ # docker-compose.yml, LDR via the Dockerfile (HEALTHCHECK at
+ # Dockerfile:306, probing /api/v1/health). status() returns the
+ # health status when one is defined, so require "healthy" for
+ # all three — strictly stronger signal than "running".
+ if [ "$ollama_h" = "healthy" ] && [ "$searxng_h" = "healthy" ] && [ "$ldr_h" = "healthy" ]; then
+ echo "All services healthy."
+ break
+ fi
+
+ # Fail fast on any container exiting non-zero rather than burning
+ # the whole 6 min budget.
+ for svc in ollama searxng local-deep-research; do
+ cid=$(cid_for "$svc")
+ [ -n "$cid" ] || continue
+ s=$(docker inspect -f '{{.State.Status}}' "$cid" 2>/dev/null || true)
+ if [ "$s" = "exited" ] || [ "$s" = "dead" ]; then
+ echo "::error::Container for service $svc has exited"
+ exit 1
+ fi
+ done
+
+ sleep 10
+ done
+
+ - name: Probe LDR HTTP endpoint
+ # Avoids `curl ... | grep` so we don't need pipefail to surface curl
+ # failures — the HTTP code is captured directly via -w and checked
+ # with a case statement. `|| echo "000"` means a curl error (network,
+ # connection refused, etc.) gets a sentinel code we can log on retry.
+ run: |
+ set -euo pipefail
+ for i in $(seq 1 30); do
+ code=$(curl -fsS -o /dev/null -w "%{http_code}" http://localhost:5000/ 2>/dev/null || echo "000")
+ case "$code" in
+ 200|301|302|303|307|308)
+ echo "LDR is serving on :5000 (HTTP $code)"
+ exit 0
+ ;;
+ esac
+ echo "Waiting for LDR HTTP (attempt $i/30, last code: $code)..."
+ sleep 5
+ done
+ echo "::error::LDR HTTP probe failed after ~150s"
+ exit 1
+
+ - name: Dump compose state and logs
+ if: always()
+ run: |
+ echo "::group::docker compose ps"
+ docker compose ps || true
+ echo "::endgroup::"
+
+ for svc in ollama searxng local-deep-research; do
+ echo "::group::$svc logs"
+ docker compose logs --no-color --tail=500 "$svc" || true
+ echo "::endgroup::"
+ done
+
+ - name: Tear down
+ if: always()
+ run: docker compose down -v --remove-orphans
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index ae093b56af..76b4d96a44 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -177,6 +177,23 @@ jobs:
permissions:
contents: read
+ # ============================================================================
+ # COMPOSE INTEGRATION GATE (Required) - Bundled docker-compose smoke test
+ # ============================================================================
+ # Brings up the bundled docker-compose.yml end-to-end and verifies the whole
+ # stack (searxng, ollama, local-deep-research) reaches a healthy state.
+ # Would have caught #3874 (broken cap_drop on SearXNG) before users hit it.
+ # Only runs at release time — not on the daily release-gate cron — because
+ # the failure modes are tied to actual compose / image changes that ride
+ # along with releases.
+ # ============================================================================
+ compose-integration-gate:
+ needs: [version-check]
+ if: needs.version-check.outputs.should_release == 'true'
+ uses: ./.github/workflows/compose-integration-test.yml
+ permissions:
+ contents: read
+
# ============================================================================
# VULTURE DEAD CODE GATE (Advisory) - Detects unreachable / unused code
# ============================================================================
@@ -191,10 +208,10 @@ jobs:
contents: read
build:
- needs: [version-check, release-gate, ci-gate, test-gate, e2e-test-gate, responsive-test-gate, compat-test-gate, vulture-gate]
+ needs: [version-check, release-gate, ci-gate, test-gate, e2e-test-gate, responsive-test-gate, compat-test-gate, compose-integration-gate, vulture-gate]
# test-gate (Playwright WebKit), responsive-test-gate, and vulture-gate are advisory
- # release-gate, ci-gate, e2e-test-gate, and compat-test-gate are required
- if: ${{ !cancelled() && needs.release-gate.result == 'success' && needs.ci-gate.result == 'success' && needs.e2e-test-gate.result == 'success' && needs.compat-test-gate.result == 'success' }}
+ # release-gate, ci-gate, e2e-test-gate, compat-test-gate, and compose-integration-gate are required
+ if: ${{ !cancelled() && needs.release-gate.result == 'success' && needs.ci-gate.result == 'success' && needs.e2e-test-gate.result == 'success' && needs.compat-test-gate.result == 'success' && needs.compose-integration-gate.result == 'success' }}
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
diff --git a/docker-compose.yml b/docker-compose.yml
index fbecad65d9..84fb294cbd 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -179,18 +179,15 @@ services:
# For AMD GPU support (future), use docker-compose.amd.override.yml
container_name: ollama_service
- entrypoint: "/scripts/ollama_entrypoint.sh ${MODEL:-gemma3:12b}"
- # Healthcheck probes the daemon, not a specific model.
- # `ollama list` succeeds as soon as the API server is responsive (returns
- # an empty list if no models are installed). Considered-and-rejected:
- # `ollama show ${MODEL:-...}` — that gates "healthy" on the configured
- # model finishing its pull, which (a) blocked LDR boot for 10+ minutes
- # while gemma3:12b downloads, (b) misleadingly reported the daemon as
- # broken when only the model was missing, and (c) gated LDR boot on
- # ollama even for users running LM Studio / OpenAI / llama.cpp who don't
- # use ollama at all (LDR depends_on ollama: service_healthy). The
- # entrypoint still pulls the configured model in the background; the
- # first request just waits for the pull to finish if it's still running.
+ # No custom entrypoint — uses the upstream image default (`ollama serve`).
+ # Considered-and-rejected: pre-pulling ${MODEL:-gemma3:12b} via
+ # scripts/ollama_entrypoint.sh on container start. That had three
+ # problems: (a) wasted ~5-10 min and ~7-8 GB on every fresh boot,
+ # (b) penalised users running LM Studio / OpenAI / llama.cpp who don't
+ # use ollama at all, and (c) coupled the compose to an opinionated
+ # default model. Users who choose ollama pull their model explicitly
+ # (`docker exec ollama_service ollama pull <model>`) or let LDR pull on
+ # first use. Healthcheck below probes the daemon (model-agnostic, #3885).
healthcheck:
test: [ "CMD", "ollama", "list" ]
interval: 10s
@@ -201,7 +198,6 @@ services:
OLLAMA_KEEP_ALIVE: '30m'
volumes:
- ollama_data:/root/.ollama
- - ldr_scripts:/scripts
networks:
- ldr-network
security_opt: