Skip to content

Commit a5099fb

Browse files
committed
[docker & docs] Migration guide update (#818)
update migration guide (include link in README.md) edit compose.base.yml to be cross os friendly (using relative path)
1 parent ec29447 commit a5099fb

File tree

3 files changed

+137
-18
lines changed

3 files changed

+137
-18
lines changed

MIGRATION_GUIDE.md

Lines changed: 116 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,116 @@
1-
# Migration Guide
1+
# JamAIBase v1 to v2 migration guide
2+
3+
## Overview
4+
5+
This guide helps migrate your JamAIBase instance from v1 to v2.
6+
7+
## Pre-requisites
8+
9+
- During migration, you will need to have both instances of JamAIBase running concurrently
10+
- For the existing v1 JamAIBase, please re-launch with the new port mapping, to prevent clashing with the v2 instance.
11+
12+
## Launching v1 with updated port mapping
13+
14+
- Update the .env
15+
16+
```
17+
API_PORT=26969
18+
```
19+
20+
- Update the docker/compose.cpu.yml
21+
22+
```
23+
# under the owl service
24+
# from
25+
# image: jamai/owl
26+
# to
27+
image: jamai/owl:v1
28+
```
29+
30+
- Launch v1 JamAIBase with a subset of the services
31+
32+
```
33+
cd /path/to/your/v1/dir
34+
docker compose --env-file .env -f docker/compose.cpu.yml up --scale infinity=0 --scale starling=0 --scale frontend=0 --scale docling=0
35+
```
36+
37+
> if on windows (powershell)
38+
39+
```
40+
cd C:\path\to\your\v1\dir
41+
docker compose -p jamai --env-file .env -f docker/compose.cpu.yml up --scale infinity=0 --scale starling=0 --scale frontend=0 --scale docling=0
42+
```
43+
44+
---
45+
46+
## Launching v2
47+
48+
- Launch v2 JamAIBase
49+
50+
```
51+
cd /path/to/your/v2/dir
52+
docker compose -p jamai --env-file .env -f docker/compose.oss.yml up
53+
```
54+
55+
> if on windows (powershell)
56+
57+
```
58+
cd C:\path\to\your\v2\dir
59+
docker compose -p jamai --env-file .env -f docker/compose.oss.yml up
60+
```
61+
62+
## Run the migration
63+
64+
- Install JamAIBase locally
65+
66+
```
67+
cd /path/to/your/v2/dir
68+
cd services/api
69+
pip install -e .
70+
cd -
71+
cd clients/python
72+
pip install -e .
73+
```
74+
75+
> if on windows (powershell)
76+
77+
```
78+
cd C:\path\to\your\v2\dir
79+
80+
cd services\api
81+
pip install -e .
82+
83+
cd ..\..
84+
cd clients\python
85+
pip install -e .
86+
```
87+
88+
- Run the migration scripts
89+
90+
```
91+
# Check your v1 db path
92+
export OWL_V1_DB=/path/to/your/v1/db/main.db
93+
export OWL_V1_FILE=/path/to/your/v1/file # path to your v1 file directory
94+
export OWL_REDIS_HOST=localhost
95+
export OWL_DB_PATH=postgresql+psycopg://owlpguser:owlpgpassword@localhost:5432/jamaibase_owl
96+
97+
python scripts/oss_migrate.py --db_v1_path ${OWL_V1_DB} --migrate --reset --api_base_dst http://localhost:6969/api --api_base_src http://localhost:26969/api --v1_file_path ${OWL_V1_FILE} --s3_endpoint_dst http://localhost:9000
98+
```
99+
100+
> if on windows (powershell)
101+
102+
```
103+
# Set environment variables for the current PowerShell session
104+
# Use Windows-style paths for your files and databases
105+
$env:OWL_V1_DB = "C:\path\to\your\v1\db\main.db"
106+
$env:OWL_V1_FILE = "C:\path\to\your\v1\file"
107+
$env:OWL_REDIS_HOST = "localhost"
108+
$env:OWL_DB_PATH = "postgresql+psycopg://owlpguser:owlpgpassword@localhost:5432/jamaibase_owl"
109+
110+
# Run the migration script
111+
# Note the use of '.\' to execute a script in the current directory
112+
# and $env:VAR_NAME to reference environment variables
113+
python .\scripts\oss_migrate.py --db_v1_path $env:OWL_V1_DB --migrate --reset --api_base_dst http://localhost:6969/api --api_base_src http://localhost:26969/api --v1_file_path $env:OWL_V1_FILE --s3_endpoint_dst http://localhost:9000
114+
```
115+
116+
- If everything is successful, you can close the v1 instance

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ JamAI Base is an open-source RAG (Retrieval-Augmented Generation) backend platfo
1717

1818
![JamAI Base Demo](jamaibase.webp)
1919

20+
## Migration Guide from v1 to v2
21+
22+
Refer to [Migration Guide](./MIGRATION_GUIDE.md)
23+
2024
## Key Features
2125

2226
- Embedded database (SQLite) and vector database (LanceDB)

docker/compose.base.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ services:
1414
# https://docs.docker.com/compose/compose-file/compose-file-v3/#network_mode
1515
# network_mode: "host"
1616
# volumes:
17-
# - ${PWD}/docker_data/dragonfly:/data
17+
# - ../docker_data/dragonfly:/data
1818
networks:
1919
- jamai
2020

2121
otel-collector:
2222
image: otel/opentelemetry-collector-contrib:0.113.0
2323
command: ["--config=/etc/otelcol/config.yaml"]
2424
volumes:
25-
- ${PWD}/docker/otel_configs/otel-collector-config.yaml:/etc/otelcol/config.yaml
25+
- ./otel_configs/otel-collector-config.yaml:/etc/otelcol/config.yaml
2626
networks:
2727
- jamai
2828

@@ -32,7 +32,7 @@ services:
3232
- "--selfScrapeInterval=15s"
3333
- "--retentionPeriod=100y"
3434
volumes:
35-
- ${PWD}/docker_data/vm_data:/victoria-metrics-data
35+
- ../docker_data/vm_data:/victoria-metrics-data
3636
networks:
3737
- jamai
3838
healthcheck:
@@ -47,7 +47,7 @@ services:
4747
command:
4848
- "--auth.config=/etc/config.yml"
4949
volumes:
50-
- ${PWD}/docker/vmauth/config.yml:/etc/config.yml
50+
- ./vmauth/config.yml:/etc/config.yml
5151
networks:
5252
- jamai
5353
healthcheck:
@@ -62,7 +62,7 @@ services:
6262
command:
6363
- "--retentionPeriod=100y"
6464
volumes:
65-
- ${PWD}/docker_data/vl_data:/victoria-logs-data
65+
- ../docker_data/vl_data:/victoria-logs-data
6666
networks:
6767
- jamai
6868
healthcheck:
@@ -82,8 +82,8 @@ services:
8282
victorialogs:
8383
condition: service_healthy
8484
volumes:
85-
- ${PWD}/docker/vmagent/streamingAggregation.yaml:/etc/config/streamingAggregation.yaml
86-
- ${PWD}/docker_data/vmagent:/tmp/vmagent
85+
- ./vmagent/streamingAggregation.yaml:/etc/config/streamingAggregation.yaml
86+
- ../docker_data/vmagent:/tmp/vmagent
8787
command:
8888
# - "--promscrape.config=/etc/prometheus/prometheus.yml"
8989
- "--remoteWrite.url=http://vmauth:8427/vm/api/v1/write"
@@ -99,11 +99,11 @@ services:
9999
clickhouse:
100100
image: clickhouse:24.10.2.80
101101
volumes:
102-
- ${PWD}/docker_data/ch_data:/var/lib/clickhouse/
103-
- ${PWD}/docker_data/ch_logs:/var/log/clickhouse-server/
104-
- ${PWD}/docker/ch_configs/clickhouse_config.xml:/etc/clickhouse-server/config.d/custom_config.xml
105-
- ${PWD}/docker/ch_configs/clickhouse_user_config.xml:/etc/clickhouse-server/users.d/custom_config.xml
106-
- ${PWD}/docker/ch_configs/create_ch_prom_db.sh:/docker-entrypoint-initdb.d/create_ch_prom_db.sh
102+
- ../docker_data/ch_data:/var/lib/clickhouse/
103+
- ../docker_data/ch_logs:/var/log/clickhouse-server/
104+
- ./ch_configs/clickhouse_config.xml:/etc/clickhouse-server/config.d/custom_config.xml
105+
- ./ch_configs/clickhouse_user_config.xml:/etc/clickhouse-server/users.d/custom_config.xml
106+
- ./ch_configs/create_ch_prom_db.sh:/docker-entrypoint-initdb.d/create_ch_prom_db.sh
107107
environment:
108108
- CLICKHOUSE_ALWAYS_RUN_INITDB_SCRIPTS=1
109109
- CLICKHOUSE_USER=${CLICKHOUSE_USER:-owluser}
@@ -146,7 +146,7 @@ services:
146146
PGPASSWORD: owlpgpassword
147147
PGDATABASE: jamaibase_owl
148148
volumes:
149-
- ${PWD}/docker_data/postgres_db:/var/lib/postgresql/data
149+
- ../docker_data/postgres_db:/var/lib/postgresql/data
150150
networks:
151151
- jamai
152152
healthcheck:
@@ -201,7 +201,7 @@ services:
201201
networks:
202202
- jamai
203203
volumes:
204-
- ${PWD}/docker_data/minio:/data
204+
- ../docker_data/minio:/data
205205

206206
docling:
207207
image: ghcr.io/embeddedllm/docling-serve:20250528
@@ -230,9 +230,9 @@ services:
230230
networks:
231231
- jamai
232232
volumes:
233-
- ${PWD}/docker_data/owl/db:/usr/src/app/db
234-
- ${PWD}/docker_data/owl/logs:/usr/src/app/logs
235-
- ${PWD}/docker_data/owl/file:/usr/src/app/file
233+
- ../docker_data/owl/db:/usr/src/app/db
234+
- ../docker_data/owl/logs:/usr/src/app/logs
235+
- ../docker_data/owl/file:/usr/src/app/file
236236
depends_on:
237237
dragonfly:
238238
condition: service_healthy

0 commit comments

Comments
 (0)