Add development Docker Compose deployment for NeMo Retriever#2306
Add development Docker Compose deployment for NeMo Retriever#2306charlesbluca wants to merge 9 commits into
Conversation
Greptile SummaryThis PR introduces a development-only Docker Compose stack for running NeMo Retriever standalone (without Kubernetes), and fixes a security concern where the embedding API key was previously passed as a CLI argument to
|
| Filename | Overview |
|---|---|
| nemo_retriever/dev/compose/service-mode.compose.yaml | New development-only Docker Compose stack; GPU defaults for nim-answer (7 & 8) still require a 9-GPU host but this was already flagged; otel-collector dependency correctly uses service_started + required: false; previously-flagged API key in command line is resolved in this PR |
| nemo_retriever/src/nemo_retriever/service/vectordb_app.py | Replaces direct --embed-api-key passthrough with resolve_remote_api_key(), resolving credential from NVIDIA_API_KEY/NGC_API_KEY env vars; logic is correct and backward-compatible |
| nemo_retriever/tests/test_service_vectordb_app.py | Adds parametrized test covering env-based and explicit embed API key resolution through main(); covers NVIDIA_API_KEY fallback and explicit override; NGC_API_KEY fallback not exercised here but resolve_remote_api_key is covered elsewhere |
| Dockerfile | Adds /data/vectordb directory creation and chown to nemo user in both service and service-gpu targets; correctly pre-creates the LanceDB mount point owned by the non-root runtime user |
| nemo_retriever/dev/compose/service-mode.local-models.compose.yaml | Structural override for in-container HF inference; replaces retriever and vectordb images with service-gpu target, sets per-container GPU assignments, and mounts shared HF model cache volume |
Sequence Diagram
%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Dev as Developer
participant Compose as Docker Compose
participant Retriever as retriever:7670
participant VectorDB as vectordb:7671
participant NIM as NIM Services (optional)
participant NVIDIA as NVIDIA-hosted APIs
Dev->>Compose: docker compose up --build -d
Compose->>VectorDB: start (NVIDIA_API_KEY in env)
VectorDB->>VectorDB: resolve_remote_api_key reads NVIDIA_API_KEY
VectorDB-->>Compose: healthy (lancedb ready)
Compose->>NIM: start optional NIMs (profile-gated)
NIM-->>Compose: healthy (NGC_API_KEY in env)
Compose->>Retriever: start (depends_on: vectordb healthy)
Retriever-->>Compose: healthy
Dev->>Retriever: POST /v1/ingest
Retriever->>NIM: extract (page elements / OCR / table) or NVIDIA-hosted
alt NIM_EMBED_URL set to self-hosted
Retriever->>NIM: embed
else default hosted
Retriever->>NVIDIA: embed (NVIDIA_API_KEY)
end
Retriever->>VectorDB: POST /v1/ingest (embeddings)
VectorDB->>VectorDB: persist to LanceDB
Dev->>Retriever: POST /v1/query
Retriever->>VectorDB: POST /v1/query
VectorDB->>VectorDB: embed query (env key or local model)
VectorDB-->>Retriever: results
Retriever-->>Dev: QueryResponse
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Dev as Developer
participant Compose as Docker Compose
participant Retriever as retriever:7670
participant VectorDB as vectordb:7671
participant NIM as NIM Services (optional)
participant NVIDIA as NVIDIA-hosted APIs
Dev->>Compose: docker compose up --build -d
Compose->>VectorDB: start (NVIDIA_API_KEY in env)
VectorDB->>VectorDB: resolve_remote_api_key reads NVIDIA_API_KEY
VectorDB-->>Compose: healthy (lancedb ready)
Compose->>NIM: start optional NIMs (profile-gated)
NIM-->>Compose: healthy (NGC_API_KEY in env)
Compose->>Retriever: start (depends_on: vectordb healthy)
Retriever-->>Compose: healthy
Dev->>Retriever: POST /v1/ingest
Retriever->>NIM: extract (page elements / OCR / table) or NVIDIA-hosted
alt NIM_EMBED_URL set to self-hosted
Retriever->>NIM: embed
else default hosted
Retriever->>NVIDIA: embed (NVIDIA_API_KEY)
end
Retriever->>VectorDB: POST /v1/ingest (embeddings)
VectorDB->>VectorDB: persist to LanceDB
Dev->>Retriever: POST /v1/query
Retriever->>VectorDB: POST /v1/query
VectorDB->>VectorDB: embed query (env key or local model)
VectorDB-->>Retriever: results
Retriever-->>Dev: QueryResponse
Reviews (3): Last reviewed commit: "Merge branch 'main' into compose-service..." | Re-trigger Greptile
|
Following up on Greptile item 3: the answer NIM defaults to GPUs 7 and 8 intentionally. The documented combined-profile launch uses a collision-free allocation across the full stack: core NIMs use 0-3, reranker 4, parse 5, caption 6, answer 7-8, and audio 9. Defaulting answer to 0/1 would collide with the core profiles in that configuration. I am keeping the defaults and clarifying the README with the full allocation plus an answer-only example that overrides |
Description
Adds a development-only Docker Compose deployment for running NeMo Retriever without a Kubernetes environment.
The default deployment builds the current checkout and runs the standalone Retriever service with a persistent LanceDB VectorDB and NVIDIA-hosted inference endpoints. Optional profiles and presets support self-hosted NIMs, local Hugging Face GPU models, and OpenTelemetry/Zipkin observability. The stack includes health checks, dependency ordering, configurable ports and GPU assignments, and persistent data and model-cache volumes.
Updates the development documentation with setup, profile composition, data-handling guidance, hardware-gated smoke checks, troubleshooting, and cleanup instructions. Production deployments and split service topology remain supported through the Helm chart.
Also updates the VectorDB launcher to resolve remote embedding credentials from
NVIDIA_API_KEYorNGC_API_KEY, while preserving an explicit--embed-api-keyoverride. This avoids placing the hosted API key in the Compose command line and is covered by a parametrized test.Validation
{"status":"ok","mode":"standalone"}.git diff --check.Checklist