29 lines
984 B
Bash
29 lines
984 B
Bash
#!/bin/bash
|
|
# =============================================================================
|
|
# MinerU ROCm 统一入口 — 启动时执行补丁,然后启动指定服务
|
|
# =============================================================================
|
|
set -e
|
|
|
|
VENV=/opt/mineru_venv
|
|
SCRIPTS_DIR=/opt/scripts
|
|
|
|
echo "[entrypoint] running patches..."
|
|
|
|
# vllm 平台补丁
|
|
if [ -f ${SCRIPTS_DIR}/patch_vllm_platform.py ]; then
|
|
${VENV}/bin/python ${SCRIPTS_DIR}/patch_vllm_platform.py
|
|
fi
|
|
|
|
# MinerU 推理补丁
|
|
if [ -f ${SCRIPTS_DIR}/apply_mineru_patches.py ]; then
|
|
${VENV}/bin/python ${SCRIPTS_DIR}/apply_mineru_patches.py || echo "[entrypoint] apply_mineru_patches.py failed (non-fatal)"
|
|
fi
|
|
|
|
# 确保 vllm 源码目录在 PYTHONPATH 中
|
|
# patch_vllm_platform.py 中的 os.environ 修改不持久化到父进程
|
|
# 这里无条件导出,防止 editable install 被破坏后 vllm 无法导入
|
|
export PYTHONPATH="/opt/vllm:${PYTHONPATH}"
|
|
|
|
echo "[entrypoint] starting: $*"
|
|
exec "$@"
|