Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
| 内存 | 4+ GB |
| 软件 | 安装 Docker & Docker Compose |

### 2. Docker Compose 启动
### 2. Docker Compose 启动(拉取镜像以及启动服务时间大约 3 minutes)
克隆项目并进入项目根目录,执行以下命令:/ Clone the repository and enter the project root directory, then run the following commands:
```shell
# 用户按需配置环境变量,例如模型名称、基础 URL 和 APIKEY等 / Configure environment variables as needed, including model name, base URL and APIKEY
Expand All @@ -47,24 +47,34 @@ bash docker/deploy.sh

> 如需修改数据库密码,二次启动前需要删除`docker/app-platform-tmp`目录

## 本地快速开发测试
## 后端快速开发测试
本章节给出快速启动之后,本地快速开发测试的方法。

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

1.2. 增量编译(10 seconds)
编写代码,在修改的插件目录下,执行以下命令编译:
```shell
mvn clean install
```

### 2. 一键部署修改
在项目根目录下,执行以下命令快速部署:
在项目根目录下,执行以下命令快速部署(3 minutes 30 seconds)
```shell
bash docker/dev-app-builder.sh
```

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

## 前端快速开发测试
TODO

## 源码编译启动

### 安装数据库
Expand Down
5 changes: 4 additions & 1 deletion docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ APIKEY=${APIKEY}

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

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

# 是否升级模式 / Upgrade or not
IS_UPGRADE=false

# 阿里云镜像仓 / Aliyun Cloud Image Repo
REPO="crpi-62znuv6vkgxcv731.cn-hangzhou.personal.cr.aliyuncs.com/modelengine-hub"
12 changes: 6 additions & 6 deletions docker/dev-app-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ docker-compose stop app-builder

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

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

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

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

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

echo "=== Restarting services ==="
Expand Down Expand Up @@ -93,4 +93,4 @@ echo "Current tag in use: dev-latest"
echo "Service URL: http://localhost:8001"
echo ""
echo "=== Version Management Commands ==="
echo "View all versions: docker images modelengine/app-builder"
echo "View all versions: docker images ${REPO}/app-builder"
12 changes: 6 additions & 6 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ services:
jade-db:
container_name: jade-db
hostname: jade-db
image: modelengine/postgres:15.2-${VERSION}
image: ${REPO}/postgres:15.2-${VERSION}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
Expand All @@ -27,7 +27,7 @@ services:
db-initializer:
container_name: db-initializer
hostname: db-initializer
image: modelengine/postgres:15.2-${VERSION}
image: ${REPO}/postgres:15.2-${VERSION}
networks:
my-net:
ipv4_address: 172.0.0.99
Expand All @@ -52,7 +52,7 @@ services:
app-builder:
container_name: app-builder
hostname: app-builder
image: modelengine/app-builder:dev-latest
image: ${REPO}/app-builder:dev-latest
depends_on:
jade-db:
condition: service_healthy
Expand Down Expand Up @@ -94,7 +94,7 @@ services:
fit-runtime-java:
container_name: fit-runtime-java
hostname: fit-runtime-java
image: modelengine/fit-runtime-java:${VERSION}
image: ${REPO}/fit-runtime-java:${VERSION}
depends_on:
app-builder:
condition: service_healthy
Expand All @@ -120,7 +120,7 @@ services:
fit-runtime-python:
container_name: fit-runtime-python
hostname: fit-runtime-python
image: modelengine/fit-runtime-python:${VERSION}
image: ${REPO}/fit-runtime-python:${VERSION}
depends_on:
app-builder:
condition: service_healthy
Expand All @@ -146,7 +146,7 @@ services:
web:
container_name: web
hostname: web
image: modelengine/jade-web:${VERSION}
image: ${REPO}/jade-web:${VERSION}
depends_on:
app-builder:
condition: service_healthy
Expand Down
12 changes: 6 additions & 6 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ services:
jade-db:
container_name: jade-db
hostname: jade-db
image: modelengine/postgres:15.2-${VERSION}
image: ${REPO}/postgres:15.2-${VERSION}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
Expand All @@ -27,7 +27,7 @@ services:
db-initializer:
container_name: db-initializer
hostname: db-initializer
image: modelengine/postgres:15.2-${VERSION}
image: ${REPO}/postgres:15.2-${VERSION}
networks:
my-net:
ipv4_address: 172.0.0.99
Expand All @@ -52,7 +52,7 @@ services:
app-builder:
container_name: app-builder
hostname: app-builder
image: modelengine/app-builder:${VERSION}
image: ${REPO}/app-builder:${VERSION}
depends_on:
jade-db:
condition: service_healthy
Expand Down Expand Up @@ -94,7 +94,7 @@ services:
fit-runtime-java:
container_name: fit-runtime-java
hostname: fit-runtime-java
image: modelengine/fit-runtime-java:${VERSION}
image: ${REPO}/fit-runtime-java:${VERSION}
depends_on:
app-builder:
condition: service_healthy
Expand All @@ -120,7 +120,7 @@ services:
fit-runtime-python:
container_name: fit-runtime-python
hostname: fit-runtime-python
image: modelengine/fit-runtime-python:${VERSION}
image: ${REPO}/fit-runtime-python:${VERSION}
depends_on:
app-builder:
condition: service_healthy
Expand All @@ -146,7 +146,7 @@ services:
web:
container_name: web
hostname: web
image: modelengine/jade-web:${VERSION}
image: ${REPO}/jade-web:${VERSION}
depends_on:
app-builder:
condition: service_healthy
Expand Down