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