feat: 添加平台管理、计算模块适配器及前端页面更新
- 新增 platform API 端点和存储 - 新增 llama_factory 适配器 - 新增前端 compute、guide、system 等视图页面 - 新增 echarts 插件和 mock 数据 - 更新 Docker 配置、后端配置及文档 - 更新前端路由、API、侧边栏等组件 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -111,11 +111,11 @@ flowchart LR
|
||||
| 服务 | 端口 | 暴露范围 |
|
||||
| --- | --- | --- |
|
||||
| Nginx | 80/443 | 用户网段 |
|
||||
| Backend API | 8000 | 仅 Nginx、本机 |
|
||||
| Compute API | 9100 | 仅 Backend API、本机 |
|
||||
| File Gateway | 9101 | 仅 Backend API、本机 |
|
||||
| PostgreSQL | 5432 | 本机或内网 |
|
||||
| Redis | 6379 | 本机或内网 |
|
||||
| Backend API | 17861 | 仅 Nginx、本机 |
|
||||
| Compute API | 19100 | 仅 Backend API、本机 |
|
||||
| File Gateway | 19101 | 仅 Backend API、本机 |
|
||||
| PostgreSQL | 15432 | 本机或内网 |
|
||||
| Redis | 16379 | 本机或内网 |
|
||||
|
||||
## 5. 方案二:应用服务与算力/训练服务独立部署
|
||||
|
||||
@@ -275,9 +275,9 @@ API_PREFIX=/api
|
||||
DATABASE_URL=postgresql+asyncpg://yg_ft:***@postgres:5432/yg_ft
|
||||
REDIS_URL=redis://redis:6379/0
|
||||
LOG_DIR=/opt/yg-ft/logs/backend
|
||||
COMPUTE_API_BASE_URL=https://compute.internal:9100
|
||||
COMPUTE_API_BASE_URL=https://compute.internal:19100
|
||||
COMPUTE_SERVICE_TOKEN=***
|
||||
FILE_GATEWAY_BASE_URL=https://compute.internal:9101
|
||||
FILE_GATEWAY_BASE_URL=https://compute.internal:19101
|
||||
COMPUTE_STATUS_SYNC_MODE=polling
|
||||
COMPUTE_POLL_INTERVAL_SECONDS=10
|
||||
COMPUTE_POLL_BATCH_SIZE=100
|
||||
@@ -288,12 +288,11 @@ COMPUTE_POLL_BATCH_SIZE=100
|
||||
```env
|
||||
COMPUTE_ENV=prod
|
||||
COMPUTE_HOST_ID=gpu-node-01
|
||||
COMPUTE_API_PORT=9100
|
||||
FILE_GATEWAY_PORT=9101
|
||||
COMPUTE_API_PORT=19100
|
||||
FILE_GATEWAY_PORT=19101
|
||||
COMPUTE_SERVICE_TOKEN=***
|
||||
ENABLE_APP_CALLBACK=false
|
||||
LLAMA_FACTORY_HOME=/opt/LLaMA-Factory
|
||||
LLAMA_FACTORY_HOST_PATH=/opt/LLaMA-Factory
|
||||
LLAMA_FACTORY_HOME=/app/LLaMA-Factory
|
||||
YG_FT_DATA_ROOT=/data/yg-ft
|
||||
LOG_DIR=/opt/yg-ft/logs/compute
|
||||
CUDA_VISIBLE_DEVICES=0,1,2,3
|
||||
@@ -360,8 +359,7 @@ docker/
|
||||
```bash
|
||||
cd docker/app
|
||||
cp .env.example .env
|
||||
docker compose --profile build run --rm frontend-builder
|
||||
docker compose up -d --build
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
算力服务器启动:
|
||||
@@ -369,14 +367,14 @@ docker compose up -d --build
|
||||
```bash
|
||||
cd docker/compute
|
||||
cp .env.example .env
|
||||
docker compose up -d --build
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
应用服务器与算力服务器独立部署时,需要在 `docker/app/.env` 中配置:
|
||||
|
||||
```env
|
||||
COMPUTE_API_BASE_URL=http://<compute-server-ip>:9100
|
||||
FILE_GATEWAY_BASE_URL=http://<compute-server-ip>:9101
|
||||
COMPUTE_API_BASE_URL=http://<compute-server-ip>:19100
|
||||
FILE_GATEWAY_BASE_URL=http://<compute-server-ip>:19101
|
||||
COMPUTE_SERVICE_TOKEN=change_me
|
||||
```
|
||||
|
||||
@@ -385,9 +383,9 @@ COMPUTE_SERVICE_TOKEN=change_me
|
||||
多节点后,每台算力服务器各自进入 `docker/compute` 启动一套算力服务,并在应用平台中登记为一条 `compute_nodes` 记录:
|
||||
|
||||
```text
|
||||
gpu-node-01 -> http://10.10.20.31:9100 / http://10.10.20.31:9101
|
||||
gpu-node-02 -> http://10.10.20.32:9100 / http://10.10.20.32:9101
|
||||
gpu-node-03 -> http://10.10.20.33:9100 / http://10.10.20.33:9101
|
||||
gpu-node-01 -> http://10.10.20.31:19100 / http://10.10.20.31:19101
|
||||
gpu-node-02 -> http://10.10.20.32:19100 / http://10.10.20.32:19101
|
||||
gpu-node-03 -> http://10.10.20.33:19100 / http://10.10.20.33:19101
|
||||
```
|
||||
|
||||
算力服务器需要在 `docker/compute/.env` 中配置:
|
||||
@@ -395,7 +393,6 @@ gpu-node-03 -> http://10.10.20.33:9100 / http://10.10.20.33:9101
|
||||
```env
|
||||
ENABLE_APP_CALLBACK=false
|
||||
COMPUTE_SERVICE_TOKEN=change_me
|
||||
LLAMA_FACTORY_HOST_PATH=/opt/LLaMA-Factory
|
||||
YG_FT_DATA_ROOT_HOST=/data/yg-ft
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user