backup stack: ollama-intel-arc [2026-09-02]

This commit is contained in:
moonside committed 2026-09-02 04:01:34 +00:00
1 parent 9f06992444
commit 45fcd2f96f
1 file changed
+89 -20
+89 -20
View File
@@ -13,14 +13,37 @@
# 1. /dev/dri -> /dev/dxg (WSL2 has no DRI node)
# 2. + /usr/lib/wsl mount (d3d12/dxcore shims)
# 3. Host port 11435 (avoids Windows-host Ollama on 11434)
# 4. Bind mounts, not named volumes
# 4. Named volumes (see note below)
# 5. + Open WebUI, pointed at both this Ollama and llm-scaler-vllm
# 6. + ollama-init sidecar (auto-pulls + warms the default model on startup)
# 6. + ollama-init sidecar (warms the default model, pulls only if absent)
#
# Create the bind-mount dirs first, or Docker makes them root-owned:
# mkdir -p /home/fireball/docker/{ollama,sycl-cache,open-webui}
# WHY NAMED VOLUMES INSTEAD OF /home/fireball/docker/... BINDS:
# The binds worked - but only when the stack was started from inside the
# Ubuntu distro. Started from PowerShell, the Docker Desktop GUI, or
# Portainer, that same path resolves inside the docker-desktop utility VM,
# whose filesystem is rebuilt on every Docker Desktop start. That is what
# happened here: Open WebUI wrote its database into the utility VM, the
# reboot discarded it, and the next Ubuntu-side start found an empty
# directory and initialized fresh (alembic ran clean against an empty DB,
# and the container Created timestamp matches webui.db's mtime exactly).
# Ollama meanwhile found its August partial blob on the distro and resumed it
# forever, because a partial download writes no manifest and so stays
# invisible to `ollama list`.
#
# Run from WSL Ubuntu:
# Named volumes live on Docker's managed data disk, so the launch context
# stops mattering. Bind mounts would also be fine IF the stack is always
# started from Ubuntu - this just removes the need to remember.
#
# Back them up with:
# docker run --rm -v ollama-data:/src -v /home/fireball/backup:/dst \
# alpine tar czf /dst/ollama-data.tgz -C /src .
#
# BEFORE FIRST RUN: raise Docker Desktop's virtual disk limit
# Settings -> Resources -> Virtual disk limit. It reported 24G with 5.4G free,
# which cannot hold a 17 GB pull - the partial and the final blob coexist
# during the download. That is why the pull stalled. Give it 150 GB+.
#
# Run from WSL Ubuntu (or anywhere, now that the volumes are named):
# docker compose -f docker-compose.ollama-sycl-wsl.yml up -d
services:
ollama-sycl:
@@ -30,8 +53,9 @@ services:
devices:
- /dev/dxg:/dev/dxg
volumes:
- /home/fireball/docker/ollama:/root/.ollama
- /home/fireball/docker/sycl-cache:/root/.cache
- ollama-data:/root/.ollama
- sycl-cache:/root/.cache
# Stays a bind: read-only host path, not stateful data.
- /usr/lib/wsl:/usr/lib/wsl:ro
ports:
- 11435:11434
@@ -62,28 +86,44 @@ services:
start_period: 120s
# Runs once per `docker compose up`, after ollama-sycl reports healthy.
# Pulls the default model (no-op if already on disk - /api/pull checks the
# manifest) then issues an empty-prompt generate to force it into VRAM
# immediately, so OLLAMA_KEEP_ALIVE=-1 keeps it resident from boot instead
# of waiting on the first real request. Exits after; does not restart/loop.
#
# Checks /api/tags FIRST and pulls only when the model is genuinely absent.
# The old version called /api/pull unconditionally, which always contacts the
# registry; while the download was incomplete there was no manifest, so every
# boot silently resumed the same partial and never converged.
#
# Then issues an empty-prompt generate to force the model into VRAM
# immediately, so OLLAMA_KEEP_ALIVE=-1 keeps it resident from boot instead of
# waiting on the first real request. Exits after; does not restart/loop.
#
# $$ is compose's escape for a literal $ passed through to the shell.
ollama-init:
image: curlimages/curl:latest
container_name: ollama-init
depends_on:
ollama-sycl:
condition: service_healthy
environment:
- MODEL=gemma4:26b
entrypoint: ["/bin/sh", "-c"]
command: >
"curl -s http://ollama-sycl:11434/api/pull -d '{\"name\":\"gemma4:26b\"}' &&
curl -s http://ollama-sycl:11434/api/generate -d '{\"model\":\"gemma4:26b\",\"prompt\":\"\",\"keep_alive\":-1}'"
command:
- |
curl -sf http://ollama-sycl:11434/api/tags | grep -q "$$MODEL" \
|| curl -s http://ollama-sycl:11434/api/pull -d "{\"name\":\"$$MODEL\"}"
curl -s http://ollama-sycl:11434/api/generate \
-d "{\"model\":\"$$MODEL\",\"prompt\":\"\",\"keep_alive\":-1}"
restart: "no"
open-webui:
image: ghcr.io/open-webui/open-webui:latest
# Pinned to the digest currently running and known good. :latest on a stack
# with a SQLite database means an unattended pull can hand you a schema
# change you did not choose. Update deliberately: pull the new tag, back up
# the volume, then bump this line.
image: ghcr.io/open-webui/open-webui@sha256:c792953395b43d4f49085fa4026850c5e923578345ebeaf56eabd980bcfc273a
container_name: open-webui
restart: unless-stopped
volumes:
- /home/fireball/docker/open-webui:/app/backend/data
- open-webui-data:/app/backend/data
depends_on:
- ollama-sycl
ports:
@@ -94,15 +134,44 @@ services:
- ENABLE_OLLAMA_API=True
- OLLAMA_BASE_URL=http://ollama-sycl:11434
# llm-scaler-vllm via the host gateway. Adjust the port to match your
# vllm serve. Set ENABLE_OPENAI_API=False when that stack is down, or
# Open WebUI hangs on load waiting for an unreachable endpoint.
# vllm serve. Flip this to False while that stack is down - otherwise the
# logs fill with "Cannot connect to host host.docker.internal:8000" and
# Open WebUI stalls on load waiting for an unreachable endpoint.
- ENABLE_OPENAI_API=True
- OPENAI_API_BASE_URL=http://host.docker.internal:8000/v1
- OPENAI_API_KEY=dummy
- ENABLE_SIGNUP=False
- WEBUI_SECRET_KEY=dOxZYTTZgXKMHkqLBIQVImayQXAVWdzGBPuFJKggzcgvgPJPXpWzqzKaUOIOGGIr
# ROTATE THIS - the previous value was pasted into a chat window.
# Generate with: openssl rand -hex 32
- WEBUI_SECRET_KEY=CHANGEME_openssl_rand_hex_32
# Pre-selects this model in the chat UI for new sessions. Matches the
# model ollama-init pre-loads into VRAM above.
- DEFAULT_MODELS=gemma4:26b
#
# Web search. DuckDuckGo is reached through the `ddgs` metasearch engine,
# which has its own backend selector. Set DDGS_BACKEND=auto to rotate
# providers if you start hitting rate limits.
#
# CAUTION: these are PersistentConfig values. They seed the database on
# FIRST startup only and are ignored afterwards - the admin UI becomes the
# source of truth. They will take on a fresh volume. To make this file
# always win instead, set ENABLE_PERSISTENT_CONFIG=False (admin UI toggles
# then stop persisting at all).
#
# Neither of these is settable here - do them in the UI after setup:
# Settings -> Interface -> Web Search in Chat -> Always
# Workspace -> Models -> gemma4:26b -> Capabilities -> Default Features
# -> check Web Search (native mode will not inject search_web
# without it, even with the chat toggle on)
- ENABLE_WEB_SEARCH=True
- WEB_SEARCH_ENGINE=ddgs
- DDGS_BACKEND=duckduckgo
- WEB_SEARCH_RESULT_COUNT=3
- WEB_SEARCH_CONCURRENT_REQUESTS=2
extra_hosts:
- host.docker.internal:host-gateway
- host.docker.internal:host-gateway
volumes:
ollama-data:
sycl-cache:
open-webui-data: