mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-27 21:05:34 +00:00
feat: NVIDIA GPU Docker support with compose override (#93)
* feat: nvidia gpu config for docker * refactor: split NVIDIA GPU support into compose override Address review feedback: - Revert --engine ollama from base Dockerfile CMD (breaks non-Ollama users) - Keep bookworm pin and OLLAMA_HOST fix in base config - Move GPU-specific config (/proc, /sys mounts, deploy.resources.reservations) into new docker-compose.gpu.nvidia.yml override, matching the existing ROCm pattern (docker-compose.gpu.rocm.yml) - Restore Ollama port to standard 11434 - Remove commented-out GPU blocks from base docker-compose.yml - Add Ollama healthcheck with depends_on condition to base compose - Remove run.sh from repo root - Rewrite README Docker section to document CPU, NVIDIA, and ROCm patterns Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Jon Saad-Falcon <41205309+jonsaadfalcon@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Jon Saad-Falcon
Claude Opus 4.6
parent
04c28ef7ed
commit
16f601c7d7
@@ -68,6 +68,28 @@ uv run jarvis doctor
|
||||
|
||||
`jarvis init` auto-detects your hardware and recommends the best engine. After init, it prints engine-specific next steps. Run `uv run jarvis doctor` at any time to diagnose configuration or connectivity issues.
|
||||
|
||||
## Docker
|
||||
|
||||
A Docker Compose configuration bundles Jarvis with Ollama:
|
||||
|
||||
```bash
|
||||
# CPU-only (default)
|
||||
docker compose -f deploy/docker/docker-compose.yml up -d
|
||||
|
||||
# NVIDIA GPU (requires NVIDIA Container Toolkit)
|
||||
docker compose -f deploy/docker/docker-compose.yml \
|
||||
-f deploy/docker/docker-compose.gpu.nvidia.yml up -d
|
||||
|
||||
# AMD GPU (requires ROCm)
|
||||
docker compose -f deploy/docker/docker-compose.yml \
|
||||
-f deploy/docker/docker-compose.gpu.rocm.yml up -d
|
||||
|
||||
# Pull a model into Ollama
|
||||
docker compose -f deploy/docker/docker-compose.yml exec ollama ollama pull qwen3:8b
|
||||
```
|
||||
|
||||
Services: Jarvis on `:8000`, Ollama on `:11434`.
|
||||
|
||||
## Development
|
||||
|
||||
From source, you need to make sure Rust is installed on System:
|
||||
|
||||
@@ -8,7 +8,7 @@ COPY frontend/ .
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Build Python package
|
||||
FROM python:3.12-slim AS builder
|
||||
FROM python:3.12-slim-bookworm AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY pyproject.toml README.md ./
|
||||
@@ -21,7 +21,7 @@ RUN pip install --no-cache-dir uv && \
|
||||
uv pip install --system ".[server]"
|
||||
|
||||
# Stage 3: Runtime
|
||||
FROM python:3.12-slim
|
||||
FROM python:3.12-slim-bookworm
|
||||
|
||||
COPY --from=builder /usr/local /usr/local
|
||||
COPY --from=builder /app /app
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# NVIDIA GPU override — use with:
|
||||
# docker compose -f deploy/docker/docker-compose.yml -f deploy/docker/docker-compose.gpu.nvidia.yml up
|
||||
|
||||
services:
|
||||
jarvis:
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: deploy/docker/Dockerfile.gpu
|
||||
volumes:
|
||||
- /proc:/proc:ro
|
||||
- /sys:/sys:ro
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: all
|
||||
capabilities: [gpu]
|
||||
|
||||
ollama:
|
||||
image: ollama/ollama:latest
|
||||
environment:
|
||||
- NVIDIA_VISIBLE_DEVICES=all
|
||||
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: all
|
||||
capabilities: [gpu]
|
||||
@@ -1,5 +1,3 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
jarvis:
|
||||
build:
|
||||
@@ -9,17 +7,24 @@ services:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- OPENJARVIS_ENGINE_DEFAULT=ollama
|
||||
- OPENJARVIS_OLLAMA_HOST=http://ollama:11434
|
||||
- OLLAMA_HOST=http://ollama:11434
|
||||
depends_on:
|
||||
- ollama
|
||||
ollama:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
|
||||
ollama:
|
||||
image: ollama/ollama
|
||||
image: ollama/ollama:latest
|
||||
ports:
|
||||
- "11434:11434"
|
||||
volumes:
|
||||
- ollama-models:/root/.ollama
|
||||
healthcheck:
|
||||
test: ["CMD", "ollama", "list"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
|
||||
Reference in New Issue
Block a user