Files

67 lines
2.2 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.
# DeerFlow 离线后端部署补充
本目录提供与原始 `start_backend.sh` 配套的 wheelhouse。启动脚本保持原有结构,只新增一行 Redis Python 客户端的离线安装命令。
## 文件
- `offline-runtime-requirements.txt`:固定版本的完整依赖闭包。
- `prepare_wheelhouse.sh`:联网机器下载 Linux/Python 3.12 wheel,并验证传递依赖完整性。
- `start_backend.sh`:原始 Docker 启动脚本,加一行 Redis 缺包安装命令。
- `wheelhouse/`:22 个 wheel 和 `SHA256SUMS`,需要随发布目录一起复制。
## 联网机器准备
默认目标是后端镜像使用的 CPython 3.12、Linux x86_64:
```bash
cd offline-backend-20260512
bash prepare_wheelhouse.sh
```
直接依赖为:
- `croniter==6.2.2`
- `hindsight-client==0.6.2`
- `redis==5.2.1`
上述依赖在 Python 3.12/Linux x86_64 下的 19 个传递依赖也已锁定在 `offline-runtime-requirements.txt`。
国内镜像示例:
```bash
PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple bash prepare_wheelhouse.sh
```
ARM64 镜像需要改目标平台:
```bash
TARGET_PLATFORM=manylinux2014_aarch64 bash prepare_wheelhouse.sh
```
## 离线机器启动
保持原脚本要求的发布目录结构,包括 Docker 镜像 tar、`.env`、`config.yaml`、`extensions_config.json`、`skill_evolution.json`、`skills/`、`wheelhouse/`、`backend/uv.lock` 和 `backend/`。
可先校验 wheel:
```bash
cd offline-backend-20260512/wheelhouse
sha256sum -c SHA256SUMS
cd ..
```
然后启动:
```bash
bash start_backend.sh
docker logs -f deerflow-backend
```
原脚本已有 `croniter` 和 `hindsight-client` 的离线补装逻辑;新增的一行命令只负责在缺少 `redis` 模块时,从 `/app/wheelhouse` 安装 `redis==5.2.1`。
## Redis 说明
`redis==5.2.1` 只是 Python 客户端,不包含 Redis 服务端。`config.yaml` 中 `concurrency.redis.enabled: false` 时无需部署 Redis;启用后必须另行准备 Redis 服务或离线 Redis Docker 镜像。
如果 Redis 运行在另一个容器,`redis://127.0.0.1:6379/0` 指向后端容器自身,不能直接使用。应将两个容器加入同一个 Docker network,并将 URL 改为类似 `redis://redis:6379/0`,同时为不同环境配置不同的 `namespace`。