This commit is contained in:
parent
1325489a99
commit
0ba0c295ae
35
Dockerfile
35
Dockerfile
|
|
@ -83,17 +83,6 @@ RUN python3 -m pip install --no-cache-dir numpy requests build "cuda-python>=12.
|
||||||
ls -lh dist/
|
ls -lh dist/
|
||||||
|
|
||||||
|
|
||||||
# ── 下载 vllm 预编译 wheel,避免编译 flash-attn ───────────────────────────────
|
|
||||||
WORKDIR /opt
|
|
||||||
RUN pip download --only-binary=:all: --no-deps vllm==0.9.1 -d /tmp/vllm_wheels
|
|
||||||
|
|
||||||
|
|
||||||
# ── 编译你本地 sglang 源码并打 wheel ───────────────────────────────────────
|
|
||||||
COPY ./sglang /sgl/sglang
|
|
||||||
WORKDIR /sgl/sglang/python
|
|
||||||
RUN python3 -m pip install ".[srt,openai]" --no-build-isolation && \
|
|
||||||
python3 -m pip wheel ".[srt,openai]" --no-deps -w /tmp/sg_wheels
|
|
||||||
|
|
||||||
|
|
||||||
# # ── 🔄 下载 sgl-kernel(与 sglang 同步)───────────────────────────────────────
|
# # ── 🔄 下载 sgl-kernel(与 sglang 同步)───────────────────────────────────────
|
||||||
# RUN pip download --only-binary=:all: --no-deps sgl-kernel==0.3.9.post2 -d /tmp/sgl_kernel_wheels
|
# RUN pip download --only-binary=:all: --no-deps sgl-kernel==0.3.9.post2 -d /tmp/sgl_kernel_wheels
|
||||||
|
|
@ -131,6 +120,30 @@ RUN python3 -m pip install --no-cache-dir "cmake>=3.27,<4.0" scikit-build-core==
|
||||||
'
|
'
|
||||||
|
|
||||||
|
|
||||||
|
# ★ 生成 constraints,强制 sgl-kernel 只能用本地 wheel
|
||||||
|
RUN bash -lc 'set -e; \
|
||||||
|
WHEEL=$(ls /tmp/sgl_kernel_wheels/sgl_kernel-*.whl | head -n1); \
|
||||||
|
echo "sgl-kernel @ file://$WHEEL" > /tmp/sgl_constraints.txt; \
|
||||||
|
echo ">>> Using constraint:"; cat /tmp/sgl_constraints.txt'
|
||||||
|
|
||||||
|
|
||||||
|
RUN python3 -m pip install --no-cache-dir --no-deps /tmp/sgl_kernel_wheels/sgl_kernel-*.whl
|
||||||
|
|
||||||
|
|
||||||
|
# ── 下载 vllm 预编译 wheel,避免编译 flash-attn ───────────────────────────────
|
||||||
|
WORKDIR /opt
|
||||||
|
RUN pip download --only-binary=:all: --no-deps vllm==0.9.1 -d /tmp/vllm_wheels
|
||||||
|
|
||||||
|
|
||||||
|
# ── 编译你本地 sglang 源码并打 wheel ───────────────────────────────────────
|
||||||
|
COPY ./sglang /sgl/sglang
|
||||||
|
# WORKDIR /sgl/sglang/python
|
||||||
|
# RUN python3 -m pip install ".[srt,openai]" --no-build-isolation && \
|
||||||
|
# python3 -m pip wheel ".[srt,openai]" --no-deps -w /tmp/sg_wheels
|
||||||
|
WORKDIR /sgl/sglang/python
|
||||||
|
RUN python3 -m pip install --no-build-isolation -c /tmp/sgl_constraints.txt ".[srt,openai]" && \
|
||||||
|
python3 -m pip wheel --no-build-isolation -c /tmp/sgl_constraints.txt ".[srt,openai]" -w /tmp/sg_wheels
|
||||||
|
|
||||||
|
|
||||||
# ── 收集所有 wheel 到 /wheels ──────────────────────────────────────────────
|
# ── 收集所有 wheel 到 /wheels ──────────────────────────────────────────────
|
||||||
RUN mkdir -p /wheels && \
|
RUN mkdir -p /wheels && \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue