Skip to content

Commit aba0b83

Browse files
authored
[Build] Fix dockerfile for 0.7.3 (#157)
Image build CI do cross compile on x86 which doesn't work for vllm. This PR make Dockerfile work with CI. Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
1 parent 701a287 commit aba0b83

File tree

5 files changed

+61
-12
lines changed

5 files changed

+61
-12
lines changed

.github/workflows/image.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ jobs:
9393
platforms: linux/amd64,linux/arm64
9494
cache-from: type=gha
9595
cache-to: type=gha,mode=max
96+
context: .
97+
file: ./Dockerfile.CI
9698
# only trigger when tag, branch/main push
9799
push: ${{ github.event_name != 'pull_request' }}
98100
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
2323
ENV DEBIAN_FRONTEND=noninteractive
2424

2525
RUN apt-get update -y && \
26-
apt-get install -y python3-pip git vim && \
26+
apt-get install -y python3-pip git vim gcc g++ cmake libnuma-dev kmod && \
2727
rm -rf /var/cache/apt/* && \
2828
rm -rf /var/lib/apt/lists/*
2929

@@ -33,12 +33,7 @@ COPY . /workspace/vllm-ascend/
3333

3434
RUN pip config set global.index-url ${PIP_INDEX_URL}
3535

36-
# Install vLLM main
37-
ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
38-
RUN git clone --depth 1 $VLLM_REPO /workspace/vllm
39-
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install /workspace/vllm/
40-
41-
# Install vllm-ascend main
36+
# Install vllm and vllm-ascend
4237
RUN python3 -m pip install /workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/
4338

4439
# Install modelscope

Dockerfile.CI

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#
2+
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.
3+
# This file is a part of the vllm-ascend project.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# This Dockerfile is used to build the vllm-ascend image in github action CI to
18+
# avoid cross compilation issues. Use `Dockerfile` instead if you want to build
19+
# the image locally.
20+
21+
FROM quay.io/ascend/cann:8.0.0-910b-ubuntu22.04-py3.10
22+
23+
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
24+
25+
# Define environments
26+
ENV DEBIAN_FRONTEND=noninteractive
27+
28+
RUN apt-get update -y && \
29+
apt-get install -y python3-pip git vim && \
30+
rm -rf /var/cache/apt/* && \
31+
rm -rf /var/lib/apt/lists/*
32+
33+
WORKDIR /workspace
34+
35+
COPY . /workspace/vllm-ascend/
36+
37+
RUN pip config set global.index-url ${PIP_INDEX_URL}
38+
39+
# Install vLLM
40+
ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
41+
RUN git clone --depth 1 --branch v0.7.3 $VLLM_REPO /workspace/vllm
42+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install /workspace/vllm/
43+
44+
# Install vllm-ascend
45+
RUN sed -i '/vllm==0.7.3/d' /workspace/vllm-ascend/requirements.txt
46+
RUN sed -i '/[[:space:]]*"vllm==0.7.3",/d' /workspace/vllm-ascend/pyproject.toml
47+
RUN python3 -m pip install /workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/
48+
49+
# Install modelscope
50+
RUN python3 -m pip install modelscope
51+
52+
CMD ["/bin/bash"]

docs/source/conf.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,14 @@
6363
# the branch of vllm, used in vllm clone
6464
# - main branch: 'main'
6565
# - vX.Y.Z branch: 'vX.Y.Z'
66-
'vllm_version': 'main',
66+
'vllm_version': 'v0.7.3rc1',
6767
# the branch of vllm-ascend, used in vllm-ascend clone and image tag
6868
# - main branch: 'main'
6969
# - vX.Y.Z branch: latest vllm-ascend release tag
70-
'vllm_ascend_version': 'main',
70+
'vllm_ascend_version': 'v0.7.3rc1',
7171
# the newest release version of vllm-ascend and matched vLLM, used in pip install.
7272
# This value should be updated when cut down release.
73-
'pip_vllm_ascend_version': "v0.7.3rc1",
74-
'pip_vllm_version': "v0.7.3",
73+
'pip_vllm_ascend_version': "0.7.3rc1",
7574
}
7675

7776
# Add any paths that contain templates here, relative to this directory.

docs/source/installation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%208.0.0/Ascen
8181
chmod +x ./Ascend-cann-toolkit_8.0.0_linux-aarch64.run
8282
./Ascend-cann-toolkit_8.0.0_linux-aarch64.run --full
8383

84+
source /usr/local/Ascend/ascend-toolkit/set_env.sh
85+
8486
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%208.0.0/Ascend-cann-kernels-910b_8.0.0_linux-aarch64.run
8587
chmod +x ./Ascend-cann-kernels-910b_8.0.0_linux-aarch64.run
8688
./Ascend-cann-kernels-910b_8.0.0_linux-aarch64.run --install
@@ -89,7 +91,6 @@ wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%208.0.0/Ascen
8991
chmod +x. /Ascend-cann-nnal_8.0.0_linux-aarch64.run
9092
./Ascend-cann-nnal_8.0.0_linux-aarch64.run --install
9193

92-
source /usr/local/Ascend/ascend-toolkit/set_env.sh
9394
source /usr/local/Ascend/nnal/atb/set_env.sh
9495
```
9596

0 commit comments

Comments
 (0)