This commit is contained in:
hailin 2025-07-03 09:35:48 +08:00
parent dc3aa8c90d
commit dc71fc4eb6
1 changed files with 5 additions and 8 deletions

View File

@ -72,15 +72,11 @@ RUN pip install . && \
python3 -m pip wheel . --no-deps -w dist/ python3 -m pip wheel . --no-deps -w dist/
# builder-extras 阶段:补充工具链 + 安装 vllm # ── 安装 vllm跳过编译直接装 ─────────────────────────────────────────────
WORKDIR /opt WORKDIR /opt
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN pip install setuptools wheel setuptools_scm && \
ninja-build cmake build-essential python3-dev git && \ pip install git+https://github.com/vllm-project/vllm.git@v0.9.1 --no-deps && \
pip install setuptools wheel setuptools_scm && \ python3 -m pip wheel vllm -w /tmp/vllm_wheels --no-deps
git clone -b v0.9.1 https://github.com/vllm-project/vllm.git && \
cd vllm && \
python3 -m pip install . --no-build-isolation --no-deps && \
python3 -m pip wheel . --no-deps -w /tmp/vllm_wheels
# ── 编译你本地 sglang 源码并打 wheel ─────────────────────────────────────── # ── 编译你本地 sglang 源码并打 wheel ───────────────────────────────────────
@ -122,6 +118,7 @@ COPY --from=builder-extras /wheels /tmp/wheels
#RUN python3 -m pip install --no-cache-dir /tmp/wheels/* && rm -rf /tmp/wheels #RUN python3 -m pip install --no-cache-dir /tmp/wheels/* && rm -rf /tmp/wheels
# ✅ 优先装你自编的 torch避免被 PyPI 上的覆盖 # ✅ 优先装你自编的 torch避免被 PyPI 上的覆盖
RUN python3 -m pip install --no-cache-dir /tmp/wheels/torch*.whl && \ RUN python3 -m pip install --no-cache-dir /tmp/wheels/torch*.whl && \
python3 -m pip install /tmp/wheels/vllm-*.whl && \
python3 -m pip install --no-cache-dir /tmp/wheels/* && \ python3 -m pip install --no-cache-dir /tmp/wheels/* && \
python3 -c "from torch.distributed import Backend; print('✅ Runtime torch distributed OK, GLOO =', Backend.GLOO)" && \ python3 -c "from torch.distributed import Backend; print('✅ Runtime torch distributed OK, GLOO =', Backend.GLOO)" && \
rm -rf /tmp/wheels rm -rf /tmp/wheels