Skip to content

Commit dc85584

Browse files
authored
[docker] update quick dev guide to latest (#519)
1 parent d572d9a commit dc85584

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+95
-2436
lines changed

docker/.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ APIKEY=${APIKEY}
1010

1111
# 部署配置 / Deployment configuration
1212
# ModelEngine 开源版本号 / ModelEngine opensource version
13-
VERSION=opensource-1.2.4
13+
VERSION=opensource-1.3.0
1414

1515
# 用户自定义数据库密码 / User-configured database password
1616
DB_PASSWORD=ModelEngine@123
@@ -25,4 +25,4 @@ WEB_PORT=8001
2525
IS_UPGRADE=false
2626

2727
# 阿里云镜像仓 / Aliyun Cloud Image Repo
28-
REPO="crpi-62znuv6vkgxcv731.cn-hangzhou.personal.cr.aliyuncs.com/modelengine-hub"
28+
REPO="crpi-62znuv6vkgxcv731.cn-hangzhou.personal.cr.aliyuncs.com/modelengine-hub"

docker/deploy.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
set -eux
33
export WORKSPACE=$(cd "$(dirname "$(readlink -f "$0")")" && pwd)
44

5-
bash ${WORKSPACE}/import_model.sh
65
echo "=== Deploying... ==="
76
cd ${WORKSPACE}
87
mkdir -p app-platform-tmp/app-builder
@@ -13,5 +12,7 @@ echo "Starting service..."
1312
docker-compose -p app-platform up -d
1413
echo "Service started"
1514
docker stop db-initializer
15+
docker stop sql-initializer
1616
docker rm db-initializer
17+
docker rm sql-initializer
1718
echo "=== Finished ==="

docker/dev-app-builder.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ if [ $WAITED -ge $MAX_WAIT ]; then
8686
echo "Warning: Service startup timeout, but continuing execution..."
8787
fi
8888

89+
docker stop db-initializer
90+
docker stop sql-initializer
91+
docker rm db-initializer
92+
docker rm sql-initializer
93+
8994
echo ""
9095
echo "=== Completed! ==="
9196
echo "Development version deployed: ${DEV_VERSION}"

docker/docker-compose.dev.yml

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,36 @@ services:
1717
POSTGRES_PASSWORD: ${DB_PASSWORD}
1818
LOG_HOME: /log/app
1919
volumes:
20-
- ./sql:/home/sql
21-
- ./shell/initDB.sh:/home/initDB.sh
2220
- "./app-platform-tmp/jade-db:/var/lib/postgresql/data"
2321
- "./app-platform-tmp/log:/log/app/postgresql"
2422
ports:
2523
- "${DB_PORT}:5432"
2624

25+
sql-initializer:
26+
container_name: sql-initializer
27+
hostname: sql-initializer
28+
image: ${REPO}/app-builder:dev-latest
29+
networks:
30+
my-net:
31+
ipv4_address: 172.0.0.97
32+
volumes:
33+
- ./app-platform-tmp/sql:/opt/appbuilder/sql
34+
entrypoint: ["/bin/bash", "-c"]
35+
command: |
36+
"
37+
rm -rf /opt/appbuilder/sql/*
38+
mv -f /opt/sql/* /opt/appbuilder/sql/
39+
"
40+
2741
db-initializer:
2842
container_name: db-initializer
2943
hostname: db-initializer
3044
image: ${REPO}/postgres:15.2-${VERSION}
45+
depends_on:
46+
jade-db:
47+
condition: service_healthy
48+
sql-initializer:
49+
condition: service_completed_successfully
3150
networks:
3251
my-net:
3352
ipv4_address: 172.0.0.99
@@ -39,13 +58,15 @@ services:
3958
DB_PORT: 5432
4059
DB_USER: postgres
4160
IS_UPGRADE: ${IS_UPGRADE}
61+
APIKEY: ${APIKEY}
4262
volumes:
43-
- ./shell/initDB.sh:/home/initDB.sh
44-
- ./sql:/home/sql
45-
entrypoint: ["/bin/bash", "-c"]
63+
- ./app-platform-tmp/sql:/opt/sql
64+
entrypoint: ["/bin/bash", "-c"]
4665
command: |
47-
" chmod +x /home/initDB.sh
48-
bash /home/initDB.sh app_builder /home/sql
66+
"
67+
chmod +x /opt/initDB.sh
68+
sed -i "s#TODO#${APIKEY}#g" /opt/sql/init/data/tr_init_models.sql
69+
bash /opt/initDB.sh app_builder /opt/sql
4970
"
5071
restart: "no"
5172

@@ -54,8 +75,8 @@ services:
5475
hostname: app-builder
5576
image: ${REPO}/app-builder:dev-latest
5677
depends_on:
57-
jade-db:
58-
condition: service_healthy
78+
db-initializer:
79+
condition: service_completed_successfully
5980
healthcheck:
6081
test: ["CMD", "curl", "-f", "http://app-builder:8004/fit/check"]
6182
interval: 30s
@@ -81,8 +102,15 @@ services:
81102
LOG_HOME: /log/app
82103
LOG_NUM: 4320
83104
LOG_SIZE: "50M"
84-
app-engine.ttl.businessData: 15
85-
app-engine.ttl.nonBusinessData: 1
105+
app-engine.ttl.businessData: 360
106+
app-engine.ttl.nonBusinessData: 180
107+
task.expiredDays: 360
108+
model.imageExtractor.model: THUDM/GLM-4.1V-9B-Thinking
109+
model.imageExtractor.url: https://api.siliconflow.cn/v1
110+
model.audioTranscriptions.model: TeleAI/TeleSpeechASR
111+
model.audioTranscriptions.url: https://api.siliconflow.cn/v1
112+
model.imageExtractor.apiKey: ${APIKEY}
113+
model.audioTranscriptions.apiKey: ${APIKEY}
86114
volumes:
87115
- "./app-platform-tmp/fit-runtime:/var/store/tools"
88116
- "./app-platform-tmp/log:/log/app/app-builder"
@@ -97,7 +125,7 @@ services:
97125
image: ${REPO}/fit-runtime-java:${VERSION}
98126
depends_on:
99127
app-builder:
100-
condition: service_healthy
128+
condition: service_healthy
101129
networks:
102130
my-net:
103131
ipv4_address: 172.0.0.101
@@ -116,14 +144,14 @@ services:
116144
- "./app-platform-tmp/log:/log/app/runtime-java"
117145
ports:
118146
- "8090:8090"
119-
147+
120148
fit-runtime-python:
121149
container_name: fit-runtime-python
122150
hostname: fit-runtime-python
123151
image: ${REPO}/fit-runtime-python:${VERSION}
124152
depends_on:
125153
app-builder:
126-
condition: service_healthy
154+
condition: service_healthy
127155
networks:
128156
my-net:
129157
ipv4_address: 172.0.0.102
@@ -142,7 +170,7 @@ services:
142170
- "./app-platform-tmp/log:/log/app/runtime-python"
143171
ports:
144172
- "9666:9666"
145-
173+
146174
web:
147175
container_name: web
148176
hostname: web

docker/docker-compose.yml

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,36 @@ services:
1717
POSTGRES_PASSWORD: ${DB_PASSWORD}
1818
LOG_HOME: /log/app
1919
volumes:
20-
- ./sql:/home/sql
21-
- ./shell/initDB.sh:/home/initDB.sh
2220
- "./app-platform-tmp/jade-db:/var/lib/postgresql/data"
2321
- "./app-platform-tmp/log:/log/app/postgresql"
2422
ports:
2523
- "${DB_PORT}:5432"
2624

25+
sql-initializer:
26+
container_name: sql-initializer
27+
hostname: sql-initializer
28+
image: ${REPO}/app-builder:${VERSION}
29+
networks:
30+
my-net:
31+
ipv4_address: 172.0.0.97
32+
volumes:
33+
- ./app-platform-tmp/sql:/opt/appbuilder/sql
34+
entrypoint: ["/bin/bash", "-c"]
35+
command: |
36+
"
37+
rm -rf /opt/appbuilder/sql/*
38+
mv -f /opt/sql/* /opt/appbuilder/sql/
39+
"
40+
2741
db-initializer:
2842
container_name: db-initializer
2943
hostname: db-initializer
3044
image: ${REPO}/postgres:15.2-${VERSION}
45+
depends_on:
46+
jade-db:
47+
condition: service_healthy
48+
sql-initializer:
49+
condition: service_completed_successfully
3150
networks:
3251
my-net:
3352
ipv4_address: 172.0.0.99
@@ -39,13 +58,15 @@ services:
3958
DB_PORT: 5432
4059
DB_USER: postgres
4160
IS_UPGRADE: ${IS_UPGRADE}
61+
APIKEY: ${APIKEY}
4262
volumes:
43-
- ./shell/initDB.sh:/home/initDB.sh
44-
- ./sql:/home/sql
45-
entrypoint: ["/bin/bash", "-c"]
63+
- ./app-platform-tmp/sql:/opt/sql
64+
entrypoint: ["/bin/bash", "-c"]
4665
command: |
47-
" chmod +x /home/initDB.sh
48-
bash /home/initDB.sh app_builder /home/sql
66+
"
67+
chmod +x /opt/initDB.sh
68+
sed -i "s#TODO#${APIKEY}#g" /opt/sql/init/data/tr_init_models.sql
69+
bash /opt/initDB.sh app_builder /opt/sql
4970
"
5071
restart: "no"
5172

@@ -54,8 +75,8 @@ services:
5475
hostname: app-builder
5576
image: ${REPO}/app-builder:${VERSION}
5677
depends_on:
57-
jade-db:
58-
condition: service_healthy
78+
db-initializer:
79+
condition: service_completed_successfully
5980
healthcheck:
6081
test: ["CMD", "curl", "-f", "http://app-builder:8004/fit/check"]
6182
interval: 30s
@@ -81,8 +102,15 @@ services:
81102
LOG_HOME: /log/app
82103
LOG_NUM: 4320
83104
LOG_SIZE: "50M"
84-
app-engine.ttl.businessData: 15
85-
app-engine.ttl.nonBusinessData: 1
105+
app-engine.ttl.businessData: 360
106+
app-engine.ttl.nonBusinessData: 180
107+
task.expiredDays: 360
108+
model.imageExtractor.model: THUDM/GLM-4.1V-9B-Thinking
109+
model.imageExtractor.url: https://api.siliconflow.cn/v1
110+
model.audioTranscriptions.model: TeleAI/TeleSpeechASR
111+
model.audioTranscriptions.url: https://api.siliconflow.cn/v1
112+
model.imageExtractor.apiKey: ${APIKEY}
113+
model.audioTranscriptions.apiKey: ${APIKEY}
86114
volumes:
87115
- "./app-platform-tmp/fit-runtime:/var/store/tools"
88116
- "./app-platform-tmp/log:/log/app/app-builder"
@@ -97,7 +125,7 @@ services:
97125
image: ${REPO}/fit-runtime-java:${VERSION}
98126
depends_on:
99127
app-builder:
100-
condition: service_healthy
128+
condition: service_healthy
101129
networks:
102130
my-net:
103131
ipv4_address: 172.0.0.101
@@ -116,14 +144,14 @@ services:
116144
- "./app-platform-tmp/log:/log/app/runtime-java"
117145
ports:
118146
- "8090:8090"
119-
147+
120148
fit-runtime-python:
121149
container_name: fit-runtime-python
122150
hostname: fit-runtime-python
123151
image: ${REPO}/fit-runtime-python:${VERSION}
124152
depends_on:
125153
app-builder:
126-
condition: service_healthy
154+
condition: service_healthy
127155
networks:
128156
my-net:
129157
ipv4_address: 172.0.0.102
@@ -142,7 +170,7 @@ services:
142170
- "./app-platform-tmp/log:/log/app/runtime-python"
143171
ports:
144172
- "9666:9666"
145-
173+
146174
web:
147175
container_name: web
148176
hostname: web

docker/import_model.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

docker/shell/initDB.sh

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)