Skip to content

Commit 407f966

Browse files
refactor: sync Dockerfiles with nv-action/vllm-benchmarks#280
Signed-off-by: JavaPythonAIForBAT <wuhejun@h-partners.com>
1 parent 758a023 commit 407f966

3 files changed

Lines changed: 20 additions & 19 deletions

File tree

Dockerfile.a3

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,26 @@
1515
# This file is a part of the vllm-ascend project.
1616
#
1717

18-
FROM quay.io/ascend/cann:9.0.1-a3-ubuntu22.04-py3.12
18+
FROM swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:9.0.1-a3-ubuntu22.04-py3.12
1919

20-
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
20+
ARG PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
2121
ARG MOONCAKE_INDEX_URL="https://mirrors.aliyun.com/pypi/web/simple"
22-
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
2322
ARG ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
23+
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
2424
ARG PIP_TRUSTED_HOST=""
2525
ARG GIT_PROXY=""
26+
ARG APTMIRROR
2627

2728
ENV DEBIAN_FRONTEND=noninteractive
2829

2930
WORKDIR /workspace
3031

3132
# Install clang-15 (for triton-ascend) and Mooncake
3233
ARG MOONCAKE_TAG=0.3.11.post1
33-
RUN apt-get update -y && \
34+
RUN if [ -n "$APTMIRROR" ]; then \
35+
sed -Ei "s@(ports|archive).ubuntu.com@${APTMIRROR#http://}@g" /etc/apt/sources.list; \
36+
fi && \
37+
apt-get update -y && \
3438
apt-get install -y git vim wget net-tools gcc g++ cmake numactl libnuma-dev libibverbs-dev libjemalloc2 libhiredis-dev clang-15 && \
3539
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 20 && \
3640
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 20 && \
@@ -41,7 +45,6 @@ RUN apt-get update -y && \
4145

4246
# Install modelscope (for fast download) and ray (for multinode)
4347
RUN pip config set global.index-url ${PIP_INDEX_URL} && \
44-
if [ -n "$PIP_TRUSTED_HOST" ]; then pip config set global.trusted-host "$PIP_TRUSTED_HOST"; fi && \
4548
python3 -m pip install modelscope 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \
4649
python3 -m pip cache purge
4750

@@ -54,7 +57,7 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \
5457
git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
5558
git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
5659
else \
57-
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
60+
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
5861
git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
5962
fi
6063
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
@@ -75,7 +78,7 @@ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
7578
export VLLM_BATCH_INVARIANT=1 && \
7679
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
7780
source /usr/local/Ascend/nnal/atb/set_env.sh && \
78-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ && \
81+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --find-links ${PYTORCH_INDEX_URL}/torch/ --find-links ${PYTORCH_INDEX_URL}/torchvision/ && \
7982
python3 -m pip uninstall -y triton triton-ascend && \
8083
python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
8184
python3 -m pip cache purge

Dockerfile.a3.openEuler

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
# This file is a part of the vllm-ascend project.
1616
#
1717

18-
FROM quay.io/ascend/cann:9.0.1-a3-openeuler24.03-py3.12
18+
FROM swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:9.0.1-a3-openeuler24.03-py3.12
1919

20-
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
20+
ARG PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
2121
ARG MOONCAKE_INDEX_URL="https://mirrors.aliyun.com/pypi/web/simple"
22-
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
2322
ARG ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
23+
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
2424
ARG PIP_TRUSTED_HOST=""
2525
ARG GIT_PROXY=""
2626

@@ -38,7 +38,6 @@ RUN yum update -y && \
3838

3939
# Install modelscope (for fast download) and ray (for multinode)
4040
RUN pip config set global.index-url ${PIP_INDEX_URL} && \
41-
if [ -n "$PIP_TRUSTED_HOST" ]; then pip config set global.trusted-host "$PIP_TRUSTED_HOST"; fi && \
4241
python3 -m pip install modelscope 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \
4342
python3 -m pip cache purge
4443

@@ -51,7 +50,7 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \
5150
git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
5251
git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
5352
else \
54-
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
53+
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
5554
git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
5655
fi
5756
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
@@ -71,7 +70,7 @@ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
7170
export VLLM_BATCH_INVARIANT=1 && \
7271
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
7372
source /usr/local/Ascend/nnal/atb/set_env.sh && \
74-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ && \
73+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --find-links ${PYTORCH_INDEX_URL}/torch/ --find-links ${PYTORCH_INDEX_URL}/torchvision/ && \
7574
python3 -m pip uninstall -y triton triton-ascend && \
7675
python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
7776
python3 -m pip cache purge

Dockerfile.openEuler

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
# This file is a part of the vllm-ascend project.
1616
#
1717

18-
FROM quay.io/ascend/cann:9.0.1-910b-openeuler24.03-py3.12
18+
FROM swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:9.0.1-910b-openeuler24.03-py3.12
1919

20-
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
20+
ARG PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
2121
ARG MOONCAKE_INDEX_URL="https://mirrors.aliyun.com/pypi/web/simple"
22-
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
2322
ARG ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
23+
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
2424
ARG PIP_TRUSTED_HOST=""
2525
ARG GIT_PROXY=""
2626

@@ -38,7 +38,6 @@ RUN yum update -y && \
3838

3939
# Install modelscope (for fast download) and ray (for multinode)
4040
RUN pip config set global.index-url ${PIP_INDEX_URL} && \
41-
if [ -n "$PIP_TRUSTED_HOST" ]; then pip config set global.trusted-host "$PIP_TRUSTED_HOST"; fi && \
4241
python3 -m pip install modelscope 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \
4342
python3 -m pip cache purge
4443

@@ -51,7 +50,7 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \
5150
git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
5251
git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
5352
else \
54-
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
53+
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
5554
git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
5655
fi
5756
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
@@ -71,7 +70,7 @@ RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
7170
export VLLM_BATCH_INVARIANT=1 && \
7271
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
7372
source /usr/local/Ascend/nnal/atb/set_env.sh && \
74-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ && \
73+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --find-links ${PYTORCH_INDEX_URL}/torch/ --find-links ${PYTORCH_INDEX_URL}/torchvision/ && \
7574
python3 -m pip uninstall -y triton triton-ascend && \
7675
python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
7776
python3 -m pip cache purge

0 commit comments

Comments
 (0)