x
This commit is contained in:
+74
-60
@@ -4,41 +4,7 @@
|
||||
# =============================================================================
|
||||
|
||||
services:
|
||||
# --- CLI 模式(默认)---
|
||||
mineru:
|
||||
image: mineru-rocm:7.2.1
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
network: host
|
||||
args:
|
||||
ARCH: gfx1201
|
||||
GIT_PROXY: http://127.0.0.1:8118
|
||||
profiles: ["cli"]
|
||||
container_name: mineru-rocm
|
||||
stdin_open: true
|
||||
tty: true
|
||||
ipc: host
|
||||
devices:
|
||||
- /dev/kfd
|
||||
- /dev/dri
|
||||
security_opt:
|
||||
- seccomp=unconfined
|
||||
group_add:
|
||||
- video
|
||||
environment:
|
||||
- MINERU_MODEL_SOURCE=${MINERU_MODEL_SOURCE:-huggingface}
|
||||
- HF_HUB_CACHE=${HF_HUB_CACHE:-/opt/models/huggingface}
|
||||
- MODELSCOPE_CACHE=${MODELSCOPE_CACHE:-/opt/models/modelscope}
|
||||
volumes:
|
||||
- ${INPUT_DIR:-./data/input}:/data/input:ro
|
||||
- ${OUTPUT_DIR:-./data/output}:/data/output
|
||||
- ${MODEL_DIR:-./data/models}:/opt/models
|
||||
- ${MIOPEN_CACHE:-./data/miopen}:/root/.cache/miopen
|
||||
command: bash
|
||||
restart: "no"
|
||||
|
||||
# --- WebUI(Gradio)---
|
||||
# --- WebUI 前端 ---
|
||||
gradio:
|
||||
image: mineru-rocm:7.2.1
|
||||
profiles: ["gradio"]
|
||||
@@ -48,13 +14,6 @@ services:
|
||||
ipc: host
|
||||
ports:
|
||||
- "10002:7860"
|
||||
devices:
|
||||
- /dev/kfd
|
||||
- /dev/dri
|
||||
security_opt:
|
||||
- seccomp=unconfined
|
||||
group_add:
|
||||
- video
|
||||
environment:
|
||||
- MINERU_MODEL_SOURCE=${MINERU_MODEL_SOURCE:-huggingface}
|
||||
- HF_HUB_CACHE=${HF_HUB_CACHE:-/opt/models/huggingface}
|
||||
@@ -63,33 +22,88 @@ services:
|
||||
- ${INPUT_DIR:-./data/input}:/data/input:ro
|
||||
- ${OUTPUT_DIR:-./data/output}:/data/output
|
||||
- ${MODEL_DIR:-./data/models}:/opt/models
|
||||
- ${MIOPEN_CACHE:-./data/miopen}:/root/.cache/miopen
|
||||
command: ["mineru-gradio --server-name 0.0.0.0 --server-port 7860"]
|
||||
command:
|
||||
[
|
||||
"mineru-gradio",
|
||||
"--server-name", "0.0.0.0",
|
||||
"--server-port", "7860",
|
||||
"--api-url", "http://mineru-router:8000",
|
||||
]
|
||||
depends_on:
|
||||
- router
|
||||
|
||||
# --- API 服务 ---
|
||||
api:
|
||||
# --- 双卡 Worker(GPU 算力,无 profile,始终可用)---
|
||||
worker0:
|
||||
image: mineru-rocm:7.2.1
|
||||
profiles: ["api"]
|
||||
container_name: mineru-api
|
||||
container_name: mineru-worker0
|
||||
stdin_open: true
|
||||
tty: true
|
||||
ipc: host
|
||||
devices:
|
||||
- /dev/kfd
|
||||
- /dev/dri
|
||||
security_opt:
|
||||
- seccomp=unconfined
|
||||
group_add:
|
||||
- video
|
||||
environment:
|
||||
- HIP_VISIBLE_DEVICES=0
|
||||
- MINERU_MODEL_SOURCE=${MINERU_MODEL_SOURCE:-huggingface}
|
||||
- HF_HUB_CACHE=${HF_HUB_CACHE:-/opt/models/huggingface}
|
||||
- MODELSCOPE_CACHE=${MODELSCOPE_CACHE:-/opt/models/modelscope}
|
||||
volumes:
|
||||
- ${INPUT_DIR:-./data/input}:/data/input:ro
|
||||
- ${OUTPUT_DIR:-./data/output}:/data/output
|
||||
- ${MODEL_DIR:-./data/models}:/opt/models
|
||||
- ${MIOPEN_CACHE:-./data/miopen}:/root/.cache/miopen
|
||||
command: ["mineru-api", "--host", "0.0.0.0", "--port", "8001"]
|
||||
|
||||
worker1:
|
||||
image: mineru-rocm:7.2.1
|
||||
container_name: mineru-worker1
|
||||
stdin_open: true
|
||||
tty: true
|
||||
ipc: host
|
||||
devices:
|
||||
- /dev/kfd
|
||||
- /dev/dri
|
||||
security_opt:
|
||||
- seccomp=unconfined
|
||||
group_add:
|
||||
- video
|
||||
environment:
|
||||
- HIP_VISIBLE_DEVICES=1
|
||||
- MINERU_MODEL_SOURCE=${MINERU_MODEL_SOURCE:-huggingface}
|
||||
- HF_HUB_CACHE=${HF_HUB_CACHE:-/opt/models/huggingface}
|
||||
- MODELSCOPE_CACHE=${MODELSCOPE_CACHE:-/opt/models/modelscope}
|
||||
volumes:
|
||||
- ${INPUT_DIR:-./data/input}:/data/input:ro
|
||||
- ${OUTPUT_DIR:-./data/output}:/data/output
|
||||
- ${MODEL_DIR:-./data/models}:/opt/models
|
||||
- ${MIOPEN_CACHE:-./data/miopen}:/root/.cache/miopen
|
||||
command: ["mineru-api", "--host", "0.0.0.0", "--port", "8002"]
|
||||
|
||||
router:
|
||||
image: mineru-rocm:7.2.1
|
||||
container_name: mineru-router
|
||||
stdin_open: true
|
||||
tty: true
|
||||
ipc: host
|
||||
ports:
|
||||
- "8000:8000"
|
||||
devices:
|
||||
- /dev/kfd
|
||||
- /dev/dri
|
||||
security_opt:
|
||||
- seccomp=unconfined
|
||||
group_add:
|
||||
- video
|
||||
environment:
|
||||
- MINERU_MODEL_SOURCE=${MINERU_MODEL_SOURCE:-huggingface}
|
||||
- HF_HUB_CACHE=${HF_HUB_CACHE:-/opt/models/huggingface}
|
||||
- MODELSCOPE_CACHE=${MODELSCOPE_CACHE:-/opt/models/modelscope}
|
||||
volumes:
|
||||
- ${INPUT_DIR:-./data/input}:/data/input:ro
|
||||
- ${OUTPUT_DIR:-./data/output}:/data/output
|
||||
- ${MODEL_DIR:-./data/models}:/opt/models
|
||||
- ${MIOPEN_CACHE:-./data/miopen}:/root/.cache/miopen
|
||||
command: ["mineru-api --host 0.0.0.0 --port 8000"]
|
||||
command:
|
||||
[
|
||||
"mineru-router",
|
||||
"--api-urls",
|
||||
"http://mineru-worker0:8001,http://mineru-worker1:8002",
|
||||
"--host", "0.0.0.0",
|
||||
"--port", "8000",
|
||||
]
|
||||
depends_on:
|
||||
- worker0
|
||||
- worker1
|
||||
|
||||
Reference in New Issue
Block a user