This commit is contained in:
hailin 2025-07-04 09:37:13 +08:00
parent 847b1c8730
commit d76ca42383
1 changed files with 15 additions and 11 deletions

View File

@ -89,6 +89,9 @@ 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 的 Python 模块 ───────────────────────────────
WORKDIR /sgl/sglang/sgl-kernel
RUN python3 setup.py bdist_wheel && cp dist/sgl_kernel-*.whl /wheels/
# ── 收集所有 wheel 到 /wheels ──────────────────────────────────────────────
RUN mkdir -p /wheels && \
@ -134,6 +137,7 @@ RUN ls -lh /tmp/wheels && \
rm -f /tmp/wheels/torch-2.7.1a0+*.whl && \
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/torch*.whl && \
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/vllm-*.whl && \
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/sgl_kernel-*.whl && \
python3 -m pip install --no-cache-dir --no-deps /tmp/wheels/* && \
python3 -c "from torch.distributed import Backend; print('✅ Runtime torch distributed OK, GLOO =', Backend.GLOO)" && \
rm -rf /tmp/wheels
@ -152,16 +156,16 @@ ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
# ---- 拷贝模型(路径可换) ----
COPY ./Alibaba/Qwen3-8B /root/.cradle/Alibaba/Qwen3-8B
# # ---- 拷贝模型(路径可换) ----
# COPY ./Alibaba/Qwen3-8B /root/.cradle/Alibaba/Qwen3-8B
# ---- 暴露端口 ----
EXPOSE 30000
# # ---- 暴露端口 ----
# EXPOSE 30000
# ---- 启动 SGLang 推理服务 ----
CMD ["python3", "-m", "sglang.launch_server", \
"--host", "0.0.0.0", \
"--port", "30000", \
"--model-path", "/root/.cradle/Alibaba/Qwen3-8B/", \
"--tp", "1", \
"--api-key", "token-abc123"]
# # ---- 启动 SGLang 推理服务 ----
# CMD ["python3", "-m", "sglang.launch_server", \
# "--host", "0.0.0.0", \
# "--port", "30000", \
# "--model-path", "/root/.cradle/Alibaba/Qwen3-8B/", \
# "--tp", "1", \
# "--api-key", "token-abc123"]