Skip to content

Commit d05ea17

Browse files
authored
Add openEuler based container image for vLLM Ascend (#489)
### What this PR does / why we need it? Provide users with openEuler-based vllm images, so modify the quick start readme ### Does this PR introduce _any_ user-facing change? None ### How was this patch tested? There is no need for performing any test. --------- Signed-off-by: Icey <1790571317@qq.com>
1 parent afdbf77 commit d05ea17

File tree

3 files changed

+178
-0
lines changed

3 files changed

+178
-0
lines changed

.github/workflows/image_openeuler.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: 'image'
2+
# This is a docker build check and publish job:
3+
# 1. PR Triggered docker image build check
4+
# - is for image build check
5+
# - Enable on main/*-dev branch
6+
# - push: ${{ github.event_name != 'pull_request' }} ==> false
7+
# 2. branches push trigger image publish
8+
# - is for branch/dev/nightly image
9+
# - commits are merge into main/*-dev ==> vllm-ascend:main / vllm-ascend:*-dev
10+
# 3. tags push trigger image publish
11+
# - is for final release image
12+
# - Publish when tag with v* (pep440 version) ===> vllm-ascend:v1.2.3-openeuler|latest / vllm-ascend:v1.2.3rc1-openeuler
13+
on:
14+
pull_request:
15+
branches:
16+
- 'main'
17+
- '*-dev'
18+
paths:
19+
- '.github/workflows/image_openeuler.yml'
20+
- 'Dockerfile.openEuler'
21+
- 'vllm_ascend/**'
22+
push:
23+
# Publish image when tagging, the Dockerfile in tag will be build as tag image
24+
branches:
25+
- 'main'
26+
- '*-dev'
27+
tags:
28+
- 'v*'
29+
paths:
30+
- '.github/workflows/image_openeuler.yml'
31+
- 'Dockerfile.openEuler'
32+
- 'vllm_ascend/**'
33+
34+
jobs:
35+
build:
36+
name: vllm-ascend openEuler image
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Print
43+
run: |
44+
lscpu
45+
46+
- name: Docker meta
47+
id: meta
48+
uses: docker/metadata-action@v5
49+
with:
50+
# TODO(yikun): add more hub image and a note on release policy for container image
51+
images: |
52+
quay.io/ascend/vllm-ascend
53+
# Note for test case
54+
# https://github.com/marketplace/actions/docker-metadata-action#typeref
55+
# 1. branch job pulish per main/*-dev branch commits
56+
# 2. main and dev pull_request is build only, so the tag pr-N-openeuler is fine
57+
# 3. only pep440 matched tag will be published:
58+
# - v0.7.1 --> v0.7.1-openeuler, latest
59+
# - pre/post/dev: v0.7.1rc1-openeuler/v0.7.1rc1-openeuler/v0.7.1rc1.dev1-openeuler/v0.7.1.post1-openeuler, no latest
60+
# which follow the rule from vLLM with prefix v
61+
# TODO(yikun): the post release might be considered as latest release
62+
tags: |
63+
type=ref,event=branch,suffix=-openeuler
64+
type=ref,event=pr,suffix=-openeuler
65+
type=pep440,pattern={{raw}}-openeuler
66+
67+
- name: Free up disk space
68+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
69+
with:
70+
tool-cache: true
71+
docker-images: false
72+
73+
- name: Build - Set up QEMU
74+
uses: docker/setup-qemu-action@v3
75+
# TODO(yikun): remove this after https://github.com/docker/setup-qemu-action/issues/198 resolved
76+
with:
77+
image: tonistiigi/binfmt:qemu-v7.0.0-28
78+
79+
- name: Build - Set up Docker Buildx
80+
uses: docker/setup-buildx-action@v3
81+
82+
- name: Publish - Login to Quay Container Registry
83+
if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }}
84+
uses: docker/login-action@v3
85+
with:
86+
registry: quay.io
87+
username: ${{ vars.QUAY_USERNAME }}
88+
password: ${{ secrets.QUAY_PASSWORD }}
89+
90+
- name: Build and push
91+
uses: docker/build-push-action@v6
92+
with:
93+
platforms: linux/amd64,linux/arm64
94+
cache-from: type=gha
95+
cache-to: type=gha,mode=max
96+
# only trigger when tag, branch/main push
97+
push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }}
98+
labels: ${{ steps.meta.outputs.labels }}
99+
tags: ${{ steps.meta.outputs.tags }}
100+
file: Dockerfile.openEuler

Dockerfile.openEuler

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
18+
FROM quay.io/ascend/cann:8.0.0-910b-openeuler22.03-py3.10
19+
20+
RUN yum update -y && \
21+
yum install -y python3-pip git vim wget net-tools && \
22+
rm -rf /var/cache/yum &&\
23+
rm -rf /tmp/*
24+
25+
WORKDIR /workspace
26+
27+
COPY . /workspace/vllm-ascend/
28+
29+
# Install vLLM
30+
ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
31+
ARG VLLM_TAG=main
32+
33+
RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /workspace/vllm
34+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install /workspace/vllm/ --extra-index https://download.pytorch.org/whl/cpu/
35+
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
36+
RUN python3 -m pip uninstall -y triton
37+
38+
# Install vllm-ascend
39+
RUN python3 -m pip install /workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/
40+
41+
# Install torch-npu
42+
RUN bash /workspace/vllm-ascend/pta_install.sh
43+
44+
# Install modelscope (for fast download) and ray (for multinode)
45+
RUN python3 -m pip install modelscope ray
46+
47+
CMD ["/bin/bash"]

docs/source/quick_start.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
## Setup environment using container
1010

11+
:::::{tab-set}
12+
::::{tab-item} Ubuntu OS
13+
1114
```{code-block} bash
1215
:substitutions:
1316
@@ -30,6 +33,34 @@ docker run --rm \
3033
-p 8000:8000 \
3134
-it $IMAGE bash
3235
```
36+
::::
37+
38+
::::{tab-item} openEuler OS
39+
40+
```{code-block} bash
41+
:substitutions:
42+
43+
# Update DEVICE according to your device (/dev/davinci[0-7])
44+
export DEVICE=/dev/davinci0
45+
# Update the vllm-ascend image
46+
export IMAGE=quay.io/ascend/vllm-ascend:|vllm_ascend_version|-openeuler
47+
docker run --rm \
48+
--name vllm-ascend \
49+
--device $DEVICE \
50+
--device /dev/davinci_manager \
51+
--device /dev/devmm_svm \
52+
--device /dev/hisi_hdc \
53+
-v /usr/local/dcmi:/usr/local/dcmi \
54+
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
55+
-v /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ \
56+
-v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info \
57+
-v /etc/ascend_install.info:/etc/ascend_install.info \
58+
-v /root/.cache:/root/.cache \
59+
-p 8000:8000 \
60+
-it $IMAGE bash
61+
```
62+
::::
63+
:::::
3364

3465
## Usage
3566

0 commit comments

Comments
 (0)