Files
xc-llm-ascend/Dockerfile
T

52 lines
1.8 KiB
Docker
Raw Normal View History

2025-02-05 10:53:12 +08:00
#
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.
# This file is a part of the vllm-ascend project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
2025-02-19 09:51:43 +08:00
FROM quay.io/ascend/cann:8.0.0-910b-ubuntu22.04-py3.10
2025-02-05 10:53:12 +08:00
2025-02-19 17:04:46 +08:00
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
2025-02-05 10:53:12 +08:00
# Define environments
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
2025-03-04 09:01:23 +08:00
apt-get install -y python3-pip git vim wget net-tools && \
2025-02-17 09:07:35 +08:00
rm -rf /var/cache/apt/* && \
rm -rf /var/lib/apt/lists/*
2025-02-05 10:53:12 +08:00
WORKDIR /workspace
COPY . /workspace/vllm-ascend/
2025-02-19 17:04:46 +08:00
RUN pip config set global.index-url ${PIP_INDEX_URL}
2025-02-05 10:53:12 +08:00
2025-03-03 09:08:41 +08:00
# Install vLLM
2025-02-05 10:53:12 +08:00
ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
2025-03-03 09:08:41 +08:00
ARG VLLM_TAG=main
RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /workspace/vllm
2025-02-05 10:53:12 +08:00
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install /workspace/vllm/
2025-03-03 09:08:41 +08:00
# Install vllm-ascend
2025-02-19 17:04:46 +08:00
RUN python3 -m pip install /workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/
2025-02-17 09:07:35 +08:00
2025-03-03 09:08:41 +08:00
# Install torch-npu
RUN bash /workspace/vllm-ascend/pta_install.sh
# Install modelscope (for fast download) and ray (for multinode)
2025-03-09 15:59:42 +08:00
# TODO(yikun): Remove "<1.23.0" after v0.7.4 which resloved by https://github.com/vllm-project/vllm/pull/13807
RUN python3 -m pip install "modelscope<1.23.0" ray
2025-02-05 10:53:12 +08:00
CMD ["/bin/bash"]