|
| 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"] |
0 commit comments