Skip to content

Commit fbc7f2b

Browse files
authored
[app-builder] optimize quick start dev (ModelEngine-Group#475)
1 parent b6a85fa commit fbc7f2b

File tree

5 files changed

+35
-22
lines changed

5 files changed

+35
-22
lines changed

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
| 内存 | 4+ GB |
3737
| 软件 | 安装 Docker & Docker Compose |
3838

39-
### 2. Docker Compose 启动
39+
### 2. Docker Compose 启动(拉取镜像以及启动服务时间大约 3 minutes)
4040
克隆项目并进入项目根目录,执行以下命令:/ Clone the repository and enter the project root directory, then run the following commands:
4141
```shell
4242
# 用户按需配置环境变量,例如模型名称、基础 URL 和 APIKEY等 / Configure environment variables as needed, including model name, base URL and APIKEY
@@ -47,24 +47,34 @@ bash docker/deploy.sh
4747
4848
> 如需修改数据库密码,二次启动前需要删除`docker/app-platform-tmp`目录
4949
50-
## 本地快速开发测试
50+
## 后端快速开发测试
5151
本章节给出快速启动之后,本地快速开发测试的方法。
5252

5353
### 1. 编译代码
54+
1.1. 全量编译(2 minutes 30 seconds)
5455
编写代码,在项目根目录下,执行以下命令编译:
5556
```shell
5657
mvn clean install
5758
```
5859

60+
1.2. 增量编译(10 seconds)
61+
编写代码,在修改的插件目录下,执行以下命令编译:
62+
```shell
63+
mvn clean install
64+
```
65+
5966
### 2. 一键部署修改
60-
在项目根目录下,执行以下命令快速部署:
67+
在项目根目录下,执行以下命令快速部署(3 minutes 30 seconds)
6168
```shell
6269
bash docker/dev-app-builder.sh
6370
```
6471

6572
### 3. 测试
6673
浏览器打开 http://localhost:8001 测试
6774

75+
## 前端快速开发测试
76+
TODO
77+
6878
## 源码编译启动
6979

7080
### 安装数据库

docker/.env.example

Lines changed: 4 additions & 1 deletion
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.3.0
13+
VERSION=opensource-1.2.4
1414

1515
# 用户自定义数据库密码 / User-configured database password
1616
DB_PASSWORD=ModelEngine@123
@@ -23,3 +23,6 @@ WEB_PORT=8001
2323

2424
# 是否升级模式 / Upgrade or not
2525
IS_UPGRADE=false
26+
27+
# 阿里云镜像仓 / Aliyun Cloud Image Repo
28+
REPO="crpi-62znuv6vkgxcv731.cn-hangzhou.personal.cr.aliyuncs.com/modelengine-hub"

docker/dev-app-builder.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ docker-compose stop app-builder
3535

3636
echo "=== Creating development version image ==="
3737
# Use stable version as base
38-
docker run -d --name app-builder-tmp --entrypoint sleep modelengine/app-builder:${BASE_VERSION} infinity
38+
docker run -d --name app-builder-tmp --entrypoint sleep ${REPO}/app-builder:${BASE_VERSION} infinity
3939

4040
# Copy files
4141
echo "Copying plugins..."
@@ -46,10 +46,10 @@ docker cp "$SHARED_DIR"/. app-builder-tmp:/opt/fit-framework/shared/
4646

4747
# Commit as development version
4848
echo "Committing development version image: ${DEV_VERSION}"
49-
docker commit --change='ENTRYPOINT ["/opt/fit-framework/bin/start.sh"]' app-builder-tmp modelengine/app-builder:${DEV_VERSION}
49+
docker commit --change='ENTRYPOINT ["/opt/fit-framework/bin/start.sh"]' app-builder-tmp ${REPO}/app-builder:${DEV_VERSION}
5050

5151
# Create development tag (for docker-compose convenience)
52-
docker tag modelengine/app-builder:${DEV_VERSION} modelengine/app-builder:dev-latest
52+
docker tag ${REPO}/app-builder:${DEV_VERSION} ${REPO}/app-builder:dev-latest
5353

5454
echo "=== Cleaning up temporary container ==="
5555
docker stop app-builder-tmp
@@ -59,10 +59,10 @@ echo "=== Updating docker-compose configuration ==="
5959
# Create docker-compose configuration for development
6060
cp docker-compose.yml docker-compose.dev.yml
6161
if [[ "$(uname -s)" == "Darwin" ]]; then
62-
sed -i '.bak' "s/modelengine\/app-builder:\${VERSION}/modelengine\/app-builder:dev-latest/g" docker-compose.dev.yml
62+
sed -i '.bak' "s/app-builder:\${VERSION}/app-builder:dev-latest/g" docker-compose.dev.yml
6363
rm -f docker-compose.dev.yml.bak
6464
else
65-
sed -i "s/modelengine\/app-builder:\${VERSION}/modelengine\/app-builder:dev-latest/g" docker-compose.dev.yml
65+
sed -i "s/app-builder:\${VERSION}/app-builder:dev-latest/g" docker-compose.dev.yml
6666
fi
6767

6868
echo "=== Restarting services ==="
@@ -93,4 +93,4 @@ echo "Current tag in use: dev-latest"
9393
echo "Service URL: http://localhost:8001"
9494
echo ""
9595
echo "=== Version Management Commands ==="
96-
echo "View all versions: docker images modelengine/app-builder"
96+
echo "View all versions: docker images ${REPO}/app-builder"

docker/docker-compose.dev.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ services:
22
jade-db:
33
container_name: jade-db
44
hostname: jade-db
5-
image: modelengine/postgres:15.2-${VERSION}
5+
image: ${REPO}/postgres:15.2-${VERSION}
66
healthcheck:
77
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
88
interval: 10s
@@ -27,7 +27,7 @@ services:
2727
db-initializer:
2828
container_name: db-initializer
2929
hostname: db-initializer
30-
image: modelengine/postgres:15.2-${VERSION}
30+
image: ${REPO}/postgres:15.2-${VERSION}
3131
networks:
3232
my-net:
3333
ipv4_address: 172.0.0.99
@@ -52,7 +52,7 @@ services:
5252
app-builder:
5353
container_name: app-builder
5454
hostname: app-builder
55-
image: modelengine/app-builder:dev-latest
55+
image: ${REPO}/app-builder:dev-latest
5656
depends_on:
5757
jade-db:
5858
condition: service_healthy
@@ -94,7 +94,7 @@ services:
9494
fit-runtime-java:
9595
container_name: fit-runtime-java
9696
hostname: fit-runtime-java
97-
image: modelengine/fit-runtime-java:${VERSION}
97+
image: ${REPO}/fit-runtime-java:${VERSION}
9898
depends_on:
9999
app-builder:
100100
condition: service_healthy
@@ -120,7 +120,7 @@ services:
120120
fit-runtime-python:
121121
container_name: fit-runtime-python
122122
hostname: fit-runtime-python
123-
image: modelengine/fit-runtime-python:${VERSION}
123+
image: ${REPO}/fit-runtime-python:${VERSION}
124124
depends_on:
125125
app-builder:
126126
condition: service_healthy
@@ -146,7 +146,7 @@ services:
146146
web:
147147
container_name: web
148148
hostname: web
149-
image: modelengine/jade-web:${VERSION}
149+
image: ${REPO}/jade-web:${VERSION}
150150
depends_on:
151151
app-builder:
152152
condition: service_healthy

docker/docker-compose.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ services:
22
jade-db:
33
container_name: jade-db
44
hostname: jade-db
5-
image: modelengine/postgres:15.2-${VERSION}
5+
image: ${REPO}/postgres:15.2-${VERSION}
66
healthcheck:
77
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
88
interval: 10s
@@ -27,7 +27,7 @@ services:
2727
db-initializer:
2828
container_name: db-initializer
2929
hostname: db-initializer
30-
image: modelengine/postgres:15.2-${VERSION}
30+
image: ${REPO}/postgres:15.2-${VERSION}
3131
networks:
3232
my-net:
3333
ipv4_address: 172.0.0.99
@@ -52,7 +52,7 @@ services:
5252
app-builder:
5353
container_name: app-builder
5454
hostname: app-builder
55-
image: modelengine/app-builder:${VERSION}
55+
image: ${REPO}/app-builder:${VERSION}
5656
depends_on:
5757
jade-db:
5858
condition: service_healthy
@@ -94,7 +94,7 @@ services:
9494
fit-runtime-java:
9595
container_name: fit-runtime-java
9696
hostname: fit-runtime-java
97-
image: modelengine/fit-runtime-java:${VERSION}
97+
image: ${REPO}/fit-runtime-java:${VERSION}
9898
depends_on:
9999
app-builder:
100100
condition: service_healthy
@@ -120,7 +120,7 @@ services:
120120
fit-runtime-python:
121121
container_name: fit-runtime-python
122122
hostname: fit-runtime-python
123-
image: modelengine/fit-runtime-python:${VERSION}
123+
image: ${REPO}/fit-runtime-python:${VERSION}
124124
depends_on:
125125
app-builder:
126126
condition: service_healthy
@@ -146,7 +146,7 @@ services:
146146
web:
147147
container_name: web
148148
hostname: web
149-
image: modelengine/jade-web:${VERSION}
149+
image: ${REPO}/jade-web:${VERSION}
150150
depends_on:
151151
app-builder:
152152
condition: service_healthy

0 commit comments

Comments
 (0)