Skip to content

Commit 758a023

Browse files
refactor: remove unnecessary Dockerfile changes, keep only a3/a3.openEuler/openEuler
Signed-off-by: JavaPythonAIForBAT <wuhejun@h-partners.com>
1 parent e6aaf7c commit 758a023

5 files changed

Lines changed: 21 additions & 56 deletions

File tree

Dockerfile

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
FROM quay.io/ascend/cann:9.0.1-910b-ubuntu22.04-py3.12
1919

2020
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
21-
ARG MOONCAKE_INDEX_URL="https://mirrors.aliyun.com/pypi/web/simple"
22-
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
23-
ARG ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
24-
ARG PIP_TRUSTED_HOST=""
25-
ARG GIT_PROXY=""
2621

2722
WORKDIR /workspace
2823

@@ -33,13 +28,12 @@ RUN apt-get update -y && \
3328
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 20 && \
3429
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 20 && \
3530
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
36-
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url ${MOONCAKE_INDEX_URL} && \
31+
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url https://mirrors.aliyun.com/pypi/web/simple && \
3732
rm -rf /var/cache/apt/* && \
3833
rm -rf /var/lib/apt/lists/*
3934

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

@@ -52,11 +46,10 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \
5246
git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
5347
git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
5448
else \
55-
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
5649
git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
5750
fi
5851
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
59-
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
52+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \
6053
python3 -m pip uninstall -y triton && \
6154
python3 -m pip cache purge
6255

@@ -69,13 +62,13 @@ ENV SOC_VERSION=$SOC_VERSION \
6962
OMP_NUM_THREADS=1
7063
COPY . /vllm-workspace/vllm-ascend/
7164

72-
RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
65+
RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi" && \
7366
export VLLM_BATCH_INVARIANT=1 && \
7467
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
7568
source /usr/local/Ascend/nnal/atb/set_env.sh && \
76-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ && \
69+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
7770
python3 -m pip uninstall -y triton triton-ascend && \
78-
python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
71+
python3 -m pip install triton-ascend==3.2.1 --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi && \
7972
python3 -m pip cache purge
8073

8174
# Append `libascend_hal.so` path (devlib) to LD_LIBRARY_PATH

Dockerfile.310p

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
FROM quay.io/ascend/cann:9.1.0-beta.1-310p-ubuntu22.04-py3.12
1919

2020
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
21-
ARG MOONCAKE_INDEX_URL="https://mirrors.aliyun.com/pypi/web/simple"
22-
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
23-
ARG ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
24-
ARG PIP_TRUSTED_HOST=""
25-
ARG GIT_PROXY=""
2621

2722
WORKDIR /workspace
2823

@@ -33,7 +28,6 @@ RUN apt-get update -y && \
3328

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

@@ -46,11 +40,10 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \
4640
git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
4741
git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
4842
else \
49-
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
5043
git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
5144
fi
5245
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
53-
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
46+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \
5447
python3 -m pip uninstall -y triton && \
5548
python3 -m pip cache purge
5649

@@ -63,10 +56,10 @@ ENV SOC_VERSION=$SOC_VERSION \
6356
OMP_NUM_THREADS=1
6457
COPY . /vllm-workspace/vllm-ascend/
6558

66-
RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
59+
RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi" && \
6760
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
6861
source /usr/local/Ascend/nnal/atb/set_env.sh && \
69-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ && \
62+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
7063
python3 -m pip uninstall -y triton-ascend triton && \
7164
python3 -m pip cache purge
7265

Dockerfile.310p.openEuler

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
FROM quay.io/ascend/cann:9.1.0-beta.1-310p-openeuler24.03-py3.12
1919

2020
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
21-
ARG MOONCAKE_INDEX_URL="https://mirrors.aliyun.com/pypi/web/simple"
22-
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
23-
ARG ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
24-
ARG PIP_TRUSTED_HOST=""
25-
ARG GIT_PROXY=""
2621

2722
WORKDIR /workspace
2823

@@ -32,7 +27,6 @@ RUN yum update -y && \
3227

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

@@ -45,11 +39,10 @@ RUN if [ -n "$VLLM_COMMIT" ]; then \
4539
git -C /vllm-workspace/vllm fetch --depth 1 $VLLM_REPO "$VLLM_COMMIT" && \
4640
git -C /vllm-workspace/vllm checkout FETCH_HEAD; \
4741
else \
48-
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
4942
git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm; \
5043
fi
5144
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
52-
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
45+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \
5346
python3 -m pip uninstall -y triton && \
5447
python3 -m pip cache purge
5548

@@ -61,10 +54,10 @@ ENV SOC_VERSION=$SOC_VERSION \
6154
OMP_NUM_THREADS=1
6255
COPY . /vllm-workspace/vllm-ascend/
6356

64-
RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
57+
RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi" && \
6558
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
6659
source /usr/local/Ascend/nnal/atb/set_env.sh && \
67-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ && \
60+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
6861
python3 -m pip uninstall -y triton-ascend triton && \
6962
python3 -m pip cache purge
7063

Dockerfile.a5

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
FROM quay.io/ascend/cann:9.0.1-950-ubuntu22.04-py3.12
1919

2020
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
21-
ARG MOONCAKE_INDEX_URL="https://mirrors.aliyun.com/pypi/web/simple"
22-
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
23-
ARG ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
24-
ARG PIP_TRUSTED_HOST=""
25-
ARG GIT_PROXY=""
2621

2722
ENV DEBIAN_FRONTEND=noninteractive
2823

@@ -35,23 +30,21 @@ RUN apt-get update -y && \
3530
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 20 && \
3631
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 20 && \
3732
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
38-
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url ${MOONCAKE_INDEX_URL} && \
33+
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url https://mirrors.aliyun.com/pypi/web/simple && \
3934
rm -rf /var/cache/apt/* && \
4035
rm -rf /var/lib/apt/lists/*
4136

4237
# Install modelscope (for fast download) and ray (for multinode)
4338
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 && \
4539
python3 -m pip install modelscope 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \
4640
python3 -m pip cache purge
4741

4842
# Install vLLM
4943
ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
5044
ARG VLLM_TAG=v0.25.1
51-
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
5245
RUN git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm
5346
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
54-
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
47+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \
5548
python3 -m pip uninstall -y triton && \
5649
python3 -m pip cache purge
5750

@@ -64,12 +57,12 @@ ENV SOC_VERSION=$SOC_VERSION \
6457
OMP_NUM_THREADS=1
6558
COPY . /vllm-workspace/vllm-ascend/
6659

67-
RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
60+
RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi" && \
6861
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
6962
source /usr/local/Ascend/nnal/atb/set_env.sh && \
70-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ && \
63+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
7164
python3 -m pip uninstall -y triton triton-ascend && \
72-
python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
65+
python3 -m pip install triton-ascend==3.2.1 --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi && \
7366
python3 -m pip cache purge
7467

7568
# Append `libascend_hal.so` path (devlib) to LD_LIBRARY_PATH

Dockerfile.a5.openEuler

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
FROM quay.io/ascend/cann:9.0.1-950-openeuler24.03-py3.12
1919

2020
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
21-
ARG MOONCAKE_INDEX_URL="https://mirrors.aliyun.com/pypi/web/simple"
22-
ARG PYTORCH_INDEX_URL="https://download.pytorch.org/whl/cpu"
23-
ARG ASCEND_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi"
24-
ARG PIP_TRUSTED_HOST=""
25-
ARG GIT_PROXY=""
2621

2722
WORKDIR /workspace
2823

@@ -33,22 +28,20 @@ ARG MOONCAKE_TAG=0.3.11.post1
3328
RUN yum update -y && \
3429
yum install -y git vim wget net-tools gcc gcc-c++ make cmake numactl numactl-devel libibverbs-devel jemalloc hiredis-devel clang patch && \
3530
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
36-
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url ${MOONCAKE_INDEX_URL} && \
31+
python3 -m pip install mooncake-transfer-engine-npu==${MOONCAKE_TAG} --extra-index-url https://mirrors.aliyun.com/pypi/web/simple && \
3732
rm -rf /var/cache/yum/*
3833

3934
# Install modelscope (for fast download) and ray (for multinode)
4035
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 && \
4236
python3 -m pip install modelscope 'ray>=2.47.1,<=2.48.0' 'protobuf>3.20.0' && \
4337
python3 -m pip cache purge
4438

4539
# Install vLLM
4640
ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
4741
ARG VLLM_TAG=v0.25.1
48-
if [ -n "$GIT_PROXY" ]; then git config --global url."${GIT_PROXY}https://github.com/".insteadOf https://github.com/; fi && \
4942
RUN git clone --depth 1 -b $VLLM_TAG $VLLM_REPO /vllm-workspace/vllm
5043
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
51-
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] && \
44+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \
5245
python3 -m pip uninstall -y triton && \
5346
python3 -m pip cache purge
5447

@@ -60,12 +53,12 @@ ENV SOC_VERSION=$SOC_VERSION \
6053
OMP_NUM_THREADS=1
6154
COPY . /vllm-workspace/vllm-ascend/
6255

63-
RUN export PIP_EXTRA_INDEX_URL="${ASCEND_INDEX_URL}" && \
56+
RUN export PIP_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi" && \
6457
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
6558
source /usr/local/Ascend/nnal/atb/set_env.sh && \
66-
python3 -m pip install -e /vllm-workspace/vllm-ascend/ && \
59+
python3 -m pip install -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
6760
python3 -m pip uninstall -y triton triton-ascend && \
68-
python3 -m pip install triton-ascend==3.2.1 --extra-index-url ${ASCEND_INDEX_URL} && \
61+
python3 -m pip install triton-ascend==3.2.1 --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi && \
6962
python3 -m pip cache purge
7063

7164
RUN echo "export LD_PRELOAD=/usr/lib64/libjemalloc.so.2:$LD_PRELOAD" >> ~/.bashrc

0 commit comments

Comments
 (0)