From 675bce4b5a4075cfd5b8ae2c22ab7aa5bf81f62f Mon Sep 17 00:00:00 2001 From: lingyuzeng Date: Mon, 13 Oct 2025 22:08:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E6=97=B6=E5=80=99=20docker?= =?UTF-8?q?=20=E5=86=85=E7=9A=84=E8=B7=AF=E5=BE=84=E4=B8=8E=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index 77d4dbe..e0d2934 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,47 @@ Nginx (Reverse Proxy) - 环境变量示例: `backend/.env.example` - 常用命令: `make help` +### macOS + Podman 使用注意事项 + +- Podman 在 macOS 上通过虚拟机运行,宿主目录绑定到容器时,写权限可能受限。 +- 我们已在运行逻辑中对 macOS 进行特殊处理:将输入复制到容器内 `/tmp/input`,在 `/tmp` 执行 BtToxin_Digger,结束后把 `Results/` 与关键输出复制回挂载的 `/workspace`(宿主输出目录)。 +- 如仍遇写入问题: + - 在 Podman Desktop 的虚拟机共享目录中,添加项目路径并开启写权限。 + - 如需,启用 rootful 模式并重启:`podman machine stop && podman machine set --rootful && podman machine start` + - 手动验证挂载:`podman run --rm -v $(pwd)/tests/output:/workspace:rw alpine sh -lc 'echo ok > /workspace/test.txt && ls -l /workspace'` + +### 本地离线容器测试(可选) + +使用 `scripts/test_bttoxin_digger.py` 最小测试: + +```bash +uv run python scripts/test_bttoxin_digger.py +``` + +要求:`tests/test_data` 下存在 `97-27.fna` 与 `C15.fna`,测试成功后在 `tests/output/Results/Toxins` 看到 6 个关键文件。 + +### 单目录方案(跨平台稳定写入) + +- 运行前,程序会将输入文件复制到宿主输出目录下的 `input_files/` 子目录;容器仅挂载该输出目录(读写)为 `/workspace`。 +- 工具运行时的 `--SeqPath` 指向 `/workspace/input_files`,工作目录也固定在 `/workspace`;所有结果与中间文件都会落在宿主的 `tests/output/` 下。 + +目录示例: + +``` +tests/output/ +├── input_files/ # 输入文件副本 +│ ├── 97-27.fna +│ └── C15.fna +├── Results/ # BtToxin_Digger 输出 +│ └── Toxins/ +│ ├── 97-27.list +│ ├── 97-27.gbk +│ └── ... +├── StatsFiles/ # 统计文件(如有) +├── All_Toxins.txt +└── BtToxin_Digger.log +``` + ## License MIT License