Skip to content

Commit 1c429dd

Browse files
committed
chore: Use Jina optionaly
1 parent dc5674c commit 1c429dd

3 files changed

Lines changed: 30 additions & 17 deletions

File tree

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ QDRANT_URL := http://localhost:6333
22
SEMCODE_URL := http://localhost:8090
33

44
.PHONY: qdrant-clean qdrant-dashboard index-code index-history \
5-
docker-build-restart docker-up docker-logs docker-logs-semcode
5+
docker-build-restart docker-build-restart-jina docker-up docker-up-jina docker-logs docker-logs-semcode
66

77
qdrant-clean:
88
curl -sf -X DELETE $(QDRANT_URL)/collections/code_symbols && \
@@ -25,9 +25,15 @@ index-history:
2525
docker-build-restart:
2626
docker compose down && docker compose up --build -d
2727

28+
docker-build-restart-jina:
29+
docker compose --profile jina down && docker compose --profile jina up --build -d
30+
2831
docker-up:
2932
docker compose up -d
3033

34+
docker-up-jina:
35+
docker compose --profile jina up -d
36+
3137
docker-logs:
3238
docker compose logs -f
3339

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,25 @@ code, etc.).
6464
## Running
6565

6666
```bash
67+
# Jina embeddings (default — local TEI container)
68+
docker-compose --profile jina up
69+
# or: make docker-up-jina
70+
71+
# Hosted provider (Voyage / OpenAI) or local Ollama — no TEI container
6772
docker-compose up
73+
# or: make docker-up
6874
```
6975

70-
This starts three services with health checks and persistent volumes:
76+
`jina-embeddings` only starts when the `jina` profile is active. For any other provider, omit
77+
`--profile jina` and set `EMBEDDINGS_PROVIDER` plus the relevant API key in `.env`.
78+
79+
Services started with health checks and persistent volumes:
7180

72-
| Service | Port | Volume | Purpose |
73-
|---------------------------|------------------------------|----------------------------------|------------------------|
74-
| **Qdrant** | `6333` (HTTP), `6334` (gRPC) | `qdrant_data` | Vector DB |
75-
| **Jina Embeddings** (TEI) | `8087` | `embeddings_cache` | Embedding model server |
76-
| **semcode MCP** | `8090` | mounts `./config.yaml` read-only | MCP + HTTP server |
81+
| Service | Profile | Port | Volume | Purpose |
82+
|----------------------------|---------|------------------------------|----------------------------------|------------------------|
83+
| **Qdrant** | always | `6333` (HTTP), `6334` (gRPC) | `qdrant_data` | Vector DB |
84+
| **Jina Embeddings** (TEI) | `jina` | `8087` | `embeddings_cache` | Embedding model server |
85+
| **semcode MCP** | always | `8090` | mounts `./config.yaml` read-only | MCP + HTTP server |
7786

7887
The MCP server starts with empty collections — trigger an initial index by calling the `reindex` MCP tool
7988
or `POST /reindex` (see below).
@@ -200,10 +209,9 @@ the existing Qdrant collection, the server fails fast at startup with a clear er
200209
offending collection. To switch, drop both collections (`code_symbols` and `git_commits`) via the
201210
Qdrant UI or API, then reindex. There is no automatic migration.
202211

203-
**Hosted-only setup (no local TEI container):** in `docker-compose.yaml`, comment out the entire
204-
`jina-embeddings` service block, the `jina-embeddings` entry under `semcode.depends_on`, and the
205-
`JINA_URL` line under `semcode.environment`. Then set `EMBEDDINGS_PROVIDER` and the relevant API
206-
key in `.env`.
212+
**Hosted-only setup (no local TEI container):** set `EMBEDDINGS_PROVIDER` and the relevant API key
213+
in `.env`, then start without the `jina` profile (`docker-compose up` / `make docker-up`). The
214+
`jina-embeddings` container will not start.
207215

208216
## Qdrant collections
209217

docker-compose.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ services:
1313
retries: 5
1414

1515
# Jina Code V2 served by HuggingFace Text Embeddings Inference. Default
16-
# embedding backend. To use a hosted provider instead (Voyage / OpenAI) or a
17-
# local Ollama install, set EMBEDDINGS_PROVIDER + the relevant API key in
18-
# .env, then comment out:
19-
# 1. this entire `jina-embeddings` service
20-
# 2. the `jina-embeddings` entry under `semcode.depends_on`
21-
# 3. the JINA_URL line under `semcode.environment`
16+
# embedding backend — only started when the `jina` profile is active.
17+
# For hosted providers (Voyage / OpenAI) or a local Ollama install, omit
18+
# --profile jina and set EMBEDDINGS_PROVIDER + the relevant API key in .env.
2219
jina-embeddings:
20+
profiles: [jina]
2321
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.6
2422
platform: linux/amd64
2523
container_name: jina-embeddings
@@ -51,6 +49,7 @@ services:
5149
condition: service_healthy
5250
jina-embeddings:
5351
condition: service_healthy
52+
required: false
5453
volumes:
5554
- ./config.yaml:/app/config.yaml:ro
5655
- fastembed_cache:/fastembed_cache

0 commit comments

Comments
 (0)