AgentEvalTool/deploy/t480/README.md
sinohqb a77cd83e6a v0.2.0-dev: 文件管理 + 页面布局统一 + 6 个 bug 修复
## 新增功能
- 文件管理模块:分类树 + 文件上传/下载/删除
- 文件上传支持拖拽(Dragger)+ 手动上传(customRequest 模式)

## 页面布局统一(参照评测执行页)
- 仪表盘/评测对象/评测场景/评测报告 全部改为全高 flex 布局
- 统一内联页头样式(h2 + 竖线分隔 + 描述)
- 表格撑满高度、overflow 处理
- 每页添加刷新按钮

## Bug 修复
- 分类树操作按钮 hover 不可见(CSS 规则缺失)
- 文件上传失败(multipart boundary 缺失)
- LLM API 响应 content blocks 数组格式支持(_extract_content_from_api_response)
- response_time_max_ms 被静默忽略(隐式规则传空 params)
- 空 messages 导致 IndexError 崩溃
- poll_reply 异常中止整个 run(缺 try/catch)
- engine finally 未关闭 session
- 3 个页面 UTC 时间戳解析偏差 8 小时

## 后端
- EvalEngine: poll_reply 异常保护、空 dialog 保护、session 关闭
- LLM API 响应解析支持 content-block-array 格式
- 隐式 response_time 规则正确传递 max_ms 参数

## 前端
- api.ts: 移除手动 Content-Type(让浏览器自动添加 boundary)
- Files.tsx: customRequest 替代 beforeUpload、布局优化
- index.css: 分类树 hover 规则
- Targets/Scenarios/Home/Reports: 全高布局改造
- 3 个页面时间戳改用 formatDateTime()(修复 UTC 偏差)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-16 15:25:22 +08:00

85 lines
2.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# t480 测试服务器容器化部署方案
## 环境摘要
| 项目 | 值 |
|---|---|
| 主机 | `sola-t480` (Ubuntu 24.04, kernel 6.17) |
| IP | `192.168.8.145` |
| Docker | 29.1.3 |
| Docker Compose | v2.29.2 |
| Python / Node | 3.12.3 / 24.14.0 |
| 资源 | 31 GB RAM / 250 GB 可用磁盘 |
## 部署架构
- 单容器部署Python FastAPI 后端同时提供 `/api/*` 和前端 React SPA 静态资源。
- 数据持久化:通过 `data/` 目录挂载保存 SQLite 数据库与 HTML 报告。
- 配置挂载:`config/config.json` 以只读方式挂载到容器内,用于 CLI 注册/更新评测对象。
## 部署步骤
1. **确认本地配置存在**
确保项目根目录已有 `config/config.json`tutu-api token 等敏感信息)。
2. **同步代码到 t480**
```bash
rsync -avz --delete \
--exclude='.git' \
--exclude='node_modules' \
--exclude='frontend/web/dist' \
--exclude='data' \
--exclude='.venv' \
--exclude='__pycache__' \
--exclude='.pytest_cache' \
--exclude='.ruff_cache' \
/Users/sinohuangqb/DevSpace/JkzlItProduct/AgentEvalTool/ \
sola-t480:/opt/agenteval/
```
3. **在 t480 上构建并启动**
```bash
ssh sola-t480
cd /opt/agenteval
docker compose -f deploy/t480/docker-compose.yml up -d --build
```
4. **健康检查**
```bash
curl http://192.168.8.145:8000/api/health
```
期望返回 `{"status":"ok"}`,并能在浏览器打开 `http://192.168.8.145:8000/` 看到前端页面。
5. **注册/更新评测对象(如需要)**
```bash
docker exec -it agenteval agenteval target add \
--name "社区医院AI客服" \
--config /app/config/config.json
```
6. **执行一次评测验证**
获取 target-id 与 scenario-id 后:
```bash
docker exec -it agenteval agenteval run start \
--target-id <target-id> \
--scenario-id <scenario-id>
```
## 日常运维
- 查看日志:`docker logs -f agenteval`
- 重启服务:`docker compose -f deploy/t480/docker-compose.yml restart`
- 更新版本:重新执行第 2 步 rsync + `docker compose ... up -d --build`
## 可选:添加反向代理
如果后续需要域名/HTTPS可在 t480 上再起一个 Nginx/Caddy 容器,将 80/443 反向代理到本机的 `127.0.0.1:8000`