-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yikun Jiang <yikunkero@gmail.com>
- Loading branch information
Showing
2 changed files
with
108 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: 'image' | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
- '*-dev' | ||
paths: | ||
- '.github/workflows/build_image.yml' | ||
- '.github/workflows/publish_image.yml' | ||
- '.github/workflows/image.yml' | ||
- 'Dockerfile' | ||
- 'vllm_ascend/**' | ||
push: | ||
# Publish image when tagging, the Dockerfile in tag will be build as tag image | ||
branches: | ||
- 'main' | ||
- '*-dev' | ||
tags: | ||
- 'v*' | ||
paths: | ||
- '.github/workflows/build_image.yml' | ||
- '.github/workflows/publish_image.yml' | ||
- '.github/workflows/image.yml' | ||
- 'Dockerfile' | ||
- 'vllm_ascend/**' | ||
jobs: | ||
|
||
build: | ||
name: vllm-ascend image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Prepare | ||
run: | | ||
REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') | ||
echo "REPO_OWNER=${REPO_OWNER}" >> "$GITHUB_ENV" | ||
- name: Print | ||
run: | | ||
echo "REPO_OWNER:""${REPO_OWNER}" | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
# TODO(yikun): add more hub image and a note on release policy for container image | ||
# The REPO_OWNER will be: | ||
# - `vllm-project` in usptream repo | ||
# - lowercase github user in your fork repo | ||
images: | | ||
ghcr.io/${{ env.REPO_OWNER }}/vllm-ascend | ||
# Note for test case | ||
# https://github.com/marketplace/actions/docker-metadata-action#typeref | ||
# 1. branch job pulish per main/*-dev branch commits | ||
# 2. main and dev pull_request only build is unimportant | ||
# 3. only pep440 matched tag will be published: | ||
# - v0.7.1 --> v0.7.1, latest | ||
# - pre/post/dev: v0.7.1rc1/v0.7.1rc1/v0.7.1rc1.dev1/v0.7.1.post1, no latest | ||
# (follow the rule from vLLM with prefix v) | ||
# TODO(yikun): the post release might be considered as latest release | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=pep440,pattern={{raw}} | ||
- name: Free up disk space | ||
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 | ||
with: | ||
tool-cache: true | ||
docker-images: false | ||
|
||
- name: Build - Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
# TODO(yikun): remove this after https://github.com/docker/setup-qemu-action/issues/198 resolved | ||
with: | ||
image: tonistiigi/binfmt:qemu-v7.0.0-28 | ||
|
||
- name: Build - Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Publish - Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
# only trigger when tag, branch/main push | ||
push: ${{ github.event_name != 'pull_request' }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
tags: ${{ steps.meta.outputs.tags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters