This commit is contained in:
2026-06-10 15:14:00 +08:00
parent 5f189660c3
commit 177c508da0
3 changed files with 32 additions and 7 deletions
+5 -7
View File
@@ -267,11 +267,11 @@ RUN set -ex && \
echo "vllm C++ build complete (layer cached)."
# ===========================================================================
# 阶段 7.5:复制辅助脚本(必须在所有使用脚本的 RUN 之前)
# 阶段 7.5:复制入口 + 辅助脚本
# ===========================================================================
COPY scripts/patch_vllm_platform.py /opt/patch_vllm_platform.py
COPY scripts/apply_mineru_patches.py /opt/apply_mineru_patches.py
COPY scripts/cache_warmer.py /opt/cache_warmer.py
COPY scripts/entrypoint.sh /opt/entrypoint.sh
RUN chmod +x /opt/entrypoint.sh
COPY scripts/cache_warmer.py /opt/scripts/cache_warmer.py
# ===========================================================================
# 阶段 8b:安装 vllm + 平台补丁 + 验证
@@ -279,7 +279,6 @@ COPY scripts/cache_warmer.py /opt/cache_warmer.py
RUN set -ex && \
cd /opt/vllm && ${VENV}/bin/pip install -e . --no-build-isolation && \
${VENV}/bin/pip install regex && \
${VENV}/bin/python /opt/patch_vllm_platform.py && \
${VENV}/bin/python -c "import torch; v=torch.__version__; assert 'rocm' in v, f'PyTorch overwritten: {v}'; print('PyTorch OK:', v)" && \
${VENV}/bin/pip uninstall -y triton triton-rocm 2>/dev/null; \
${VENV}/bin/pip install --force-reinstall \
@@ -293,7 +292,6 @@ RUN set -ex && \
# ===========================================================================
RUN set -ex && \
${VENV}/bin/pip install 'mineru[core]' && \
${VENV}/bin/python /opt/apply_mineru_patches.py && \
# mineru[core] 会把 ROCm PyTorch 替换成 CUDA 版 + 安装 CUDA triton
# 必须先卸载 CUDA triton,再装回 ROCm 版
${VENV}/bin/pip uninstall -y triton triton-rocm 2>/dev/null; \
@@ -310,5 +308,5 @@ RUN set -ex && \
RUN echo 'source /opt/mineru_venv/bin/activate' >> /etc/bash.bashrc && \
${VENV}/bin/python -c "import torch; import vllm; import mineru; print('MinerU ROCm Docker Image Ready'); print(f'PyTorch {torch.__version__} OK')"
ENTRYPOINT ["/bin/bash", "-c"]
ENTRYPOINT ["/opt/entrypoint.sh"]
CMD ["bash"]