Skip to content

Commit d60f8d9

Browse files
authored
[v0.7.3] Add openEuler based container image (#665)
### What this PR does / why we need it? Provide users with openEuler-based vllm images for vllm v0.7.3 ### Does this PR introduce _any_ user-facing change? None ### How was this patch tested? --------- Signed-off-by: Icey <1790571317@qq.com>
1 parent 1e56aae commit d60f8d9

File tree

2 files changed

+146
-0
lines changed

2 files changed

+146
-0
lines changed

.github/workflows/image_openeuler.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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}},suffix=-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+
76+
- name: Build - Set up Docker Buildx
77+
uses: docker/setup-buildx-action@v3
78+
79+
- name: Publish - Login to Quay Container Registry
80+
if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }}
81+
uses: docker/login-action@v3
82+
with:
83+
registry: quay.io
84+
username: ${{ vars.QUAY_USERNAME }}
85+
password: ${{ secrets.QUAY_PASSWORD }}
86+
87+
- name: Build and push
88+
uses: docker/build-push-action@v6
89+
with:
90+
platforms: linux/amd64,linux/arm64
91+
# only trigger when tag, branch/main push
92+
push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }}
93+
labels: ${{ steps.meta.outputs.labels }}
94+
tags: ${{ steps.meta.outputs.tags }}
95+
file: Dockerfile.openEuler
96+
# TODO: support and enable custom ops build for openEuler
97+
build-args: |
98+
PIP_INDEX_URL=https://pypi.org/simple

Dockerfile.openEuler

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#
2+
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
# This file is a part of the vllm-ascend project.
16+
#
17+
18+
FROM quay.io/ascend/cann:8.0.0-910b-openeuler22.03-py3.10
19+
20+
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
21+
22+
RUN yum update -y && \
23+
yum install -y python3-pip git vim wget net-tools && \
24+
rm -rf /var/cache/yum
25+
26+
WORKDIR /workspace
27+
28+
COPY . /workspace/vllm-ascend/
29+
30+
RUN pip config set global.index-url ${PIP_INDEX_URL}
31+
32+
# Install vLLM
33+
ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
34+
ARG VLLM_TAG=v0.7.3
35+
RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /workspace/vllm
36+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /workspace/vllm/ --extra-index https://download.pytorch.org/whl/cpu/ && \
37+
python3 -m pip cache purge
38+
39+
# Install vllm-ascend
40+
RUN python3 -m pip install -e /workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
41+
python3 -m pip cache purge
42+
43+
# Install modelscope (for fast download) and ray (for multinode)
44+
# TODO(yikun): Remove "<1.23.0" after v0.7.4 which resloved by https://github.com/vllm-project/vllm/pull/13807
45+
RUN python3 -m pip install "modelscope<1.23.0" ray && \
46+
python3 -m pip cache purge
47+
48+
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)