Skip to content

Commit 98704f3

Browse files
committed
Merge branch '1.3.x'
2 parents b90fe22 + d0c6f7c commit 98704f3

Some content is hidden

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

60 files changed

+178
-2448
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,27 @@ bash docker/dev-app-builder.sh
7373
浏览器打开 http://localhost:8001 测试
7474

7575
## 前端快速开发测试
76-
TODO
76+
本章节给出快速启动之后,本地快速开发测试前端的方法。
77+
78+
### 1. 编译代码
79+
1. 全量编译前端(1 minutes 10 seconds)
80+
编写代码,在项目根目录下,执行以下命令编译:
81+
```shell
82+
cd frontend
83+
npm install --legacy-peer-deps --force --registry=https://registry.npmmirror.com
84+
npm run build:prod
85+
```
86+
87+
### 2. 一键部署修改
88+
在项目根目录下,执行以下命令快速部署(18 seconds):
89+
```shell
90+
cd ..
91+
bash docker/dev-frontend.sh
92+
```
93+
94+
### 3. 测试
95+
浏览器打开 http://localhost:8001 测试
96+
7797

7898
## 源码编译启动
7999

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 & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,6 @@ echo "=== Cleaning up temporary container ==="
5555
docker stop app-builder-tmp
5656
docker rm app-builder-tmp
5757

58-
echo "=== Updating docker-compose configuration ==="
59-
# Create docker-compose configuration for development
60-
cp docker-compose.yml docker-compose.dev.yml
61-
if [[ "$(uname -s)" == "Darwin" ]]; then
62-
sed -i '.bak' "s/app-builder:\${VERSION}/app-builder:dev-latest/g" docker-compose.dev.yml
63-
rm -f docker-compose.dev.yml.bak
64-
else
65-
sed -i "s/app-builder:\${VERSION}/app-builder:dev-latest/g" docker-compose.dev.yml
66-
fi
67-
6858
echo "=== Restarting services ==="
6959
docker-compose -f docker-compose.dev.yml -p app-platform up -d app-builder
7060

@@ -86,6 +76,11 @@ if [ $WAITED -ge $MAX_WAIT ]; then
8676
echo "Warning: Service startup timeout, but continuing execution..."
8777
fi
8878

79+
docker stop db-initializer
80+
docker stop sql-initializer
81+
docker rm db-initializer
82+
docker rm sql-initializer
83+
8984
echo ""
9085
echo "=== Completed! ==="
9186
echo "Development version deployed: ${DEV_VERSION}"

docker/dev-frontend.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
set -eu
3+
4+
export WORKSPACE=$(cd "$(dirname "$(readlink -f "$0")")" && pwd)
5+
BUILD_DIR="${WORKSPACE}/../frontend/build/"
6+
7+
cd ${WORKSPACE}
8+
source .env
9+
10+
# Generate development version tag
11+
BASE_VERSION=${VERSION}
12+
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
13+
GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")
14+
DEV_VERSION="${BASE_VERSION}-dev-${TIMESTAMP}-${GIT_COMMIT}"
15+
16+
echo "=== Version Information ==="
17+
echo "Base Version: ${BASE_VERSION}"
18+
echo "Development Version: ${DEV_VERSION}"
19+
echo "Git Commit: ${GIT_COMMIT}"
20+
21+
# Check local build artifacts
22+
if [ ! -d "$BUILD_DIR" ] || [ -z "$(ls -A "$BUILD_DIR" 2>/dev/null)" ]; then
23+
echo "Error: plugins directory is empty or does not exist: $BUILD_DIR"
24+
exit 1
25+
fi
26+
27+
echo "=== Stopping web service ==="
28+
docker-compose stop web
29+
30+
echo "=== Creating development version image ==="
31+
# Use stable version as base
32+
docker run -d --name web-tmp --entrypoint sleep ${REPO}/jade-web:${BASE_VERSION} infinity
33+
34+
# Copy files
35+
echo "Copying frontend files..."
36+
docker exec web-tmp rm -rf //usr//share//nginx//html
37+
docker exec web-tmp mkdir -p //usr//share//nginx//html
38+
docker cp "$BUILD_DIR"/. web-tmp:/usr/share/nginx/html/
39+
40+
# Commit as development version
41+
echo "Committing development version image: ${DEV_VERSION}"
42+
docker commit --change='ENTRYPOINT ["/init.sh"]' web-tmp ${REPO}/jade-web:${DEV_VERSION}
43+
44+
# Create development tag (for docker-compose convenience)
45+
docker tag ${REPO}/jade-web:${DEV_VERSION} ${REPO}/jade-web:dev-latest
46+
47+
echo "=== Cleaning up temporary container ==="
48+
docker stop web-tmp
49+
docker rm web-tmp
50+
51+
echo "=== Restarting services ==="
52+
docker-compose -f docker-compose.dev.yml -p app-platform up -d web
53+
54+
echo ""
55+
echo "=== Completed! ==="
56+
echo "Development version deployed: ${DEV_VERSION}"
57+
echo "Current tag in use: dev-latest"
58+
echo "Service URL: http://localhost:8001"
59+
echo ""
60+
echo "=== Version Management Commands ==="
61+
echo "View all versions: docker images ${REPO}/jade-web"

docker/docker-compose.dev.yml

Lines changed: 44 additions & 16 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,11 +170,11 @@ 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
149-
image: ${REPO}/jade-web:${VERSION}
177+
image: ${REPO}/jade-web:dev-latest
150178
depends_on:
151179
app-builder:
152180
condition: service_healthy

0 commit comments

Comments
 (0)