UnisKB/deploy_artifacts/README_DEPLOY.md

59 lines
2.3 KiB
Markdown

# Unis AI-RAG / MindMap Docker deployment
## Images
- `unis-kb-latest.tar`: knowledge-base assistant, image `unis-kb:latest`
- `unis-gateway-latest.tar`: unified gateway, image `unis-gateway:latest`
- `unis-mindmap-api-latest.tar`: MindMap API runtime image, image `unis-mindmap-api:latest`
- `unis-mindmap-web-latest.tar`: MindMap Web UI, image `unis-mindmap-web:latest`
The MindMap API image does not contain MinerU model weights. Mount or download models separately.
## Routes
- Knowledge assistant: `http://SERVER_IP:8989/admin/`
- Chat page: `http://SERVER_IP:8989/chat/`
- MindMap via knowledge assistant port: `http://SERVER_IP:8989/mindmap/`
- MindMap direct access: `http://SERVER_IP:9898/`
## Deploy
```bash
sha256sum -c SHA256SUMS.txt
./load-images.sh
SOURCE=modelscope MINERU_MODEL_DIR=/data/unis/mineru-models ./download-models.sh
MINDMAP_PUBLIC_URL=/mindmap/ KB_DATA_DIR=/opt/maxkb MINERU_MODEL_DIR=/data/unis/mineru-models ./start-all.sh
```
`MINDMAP_PUBLIC_URL=/mindmap/` makes the knowledge assistant open MindMap through the gateway path. You can also set it to `http://SERVER_IP:9898/` if you want the menu to open the direct MindMap port.
If Docker requires root permission on the target server, run the commands with `sudo` or keep `sudo` in `start-all.sh`.
For an NVIDIA CUDA build, build the API image on a CUDA-capable build machine:
```bash
cd UnisMindMap
API_FLAVOR=cuda VERSION=$(date +%Y%m%d%H%M%S) ./scripts/build-images.sh
```
For a Tianshu/CoreX build:
```bash
cd UnisMindMap
API_FLAVOR=corex VERSION=$(date +%Y%m%d%H%M%S) ./scripts/build-images.sh
```
## Upload
```bash
TARGET=root@TEST_SERVER TARGET_DIR=/opt/unis/deploy_artifacts ./upload-artifacts.sh
```
## Notes
- `KB_DATA_DIR` is the persistent data directory for the knowledge-base assistant. Put it on a data disk in production.
- `MINERU_MODEL_DIR` is the persistent model directory for the MindMap assistant. Put it on a data disk and reuse it across image upgrades.
- The gateway container is the only public reverse proxy needed for `/admin/`, `/chat/`, and `/mindmap/`. MindMap Web also exposes port `9898` for direct access.
- Use `MINERU_GPU_MEMORY_UTILIZATION=0.3` or another value below `1` when a GPU has limited free memory.
- The MindMap API has separate Dockerfiles for CoreX/Tianshu and NVIDIA CUDA. Keep the same container name `mineru-api` and port `8000`.