|
| 1 | +name: 'image / openEuler' |
| 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_310p_openeuler.yml' |
| 20 | + - 'Dockerfile.310p.openEuler' |
| 21 | + - 'vllm_ascend/**' |
| 22 | + - 'setup.py' |
| 23 | + - 'pyproject.toml' |
| 24 | + - 'requirements.txt' |
| 25 | + - 'cmake/**' |
| 26 | + - 'CMakeLists.txt' |
| 27 | + - 'csrc/**' |
| 28 | + push: |
| 29 | + # Publish image when tagging, the Dockerfile in tag will be build as tag image |
| 30 | + branches: |
| 31 | + - 'main' |
| 32 | + - '*-dev' |
| 33 | + tags: |
| 34 | + - 'v*' |
| 35 | + paths: |
| 36 | + - '.github/workflows/image_310p.openeuler.yml' |
| 37 | + - 'Dockerfile.310p.openEuler' |
| 38 | + - 'vllm_ascend/**' |
| 39 | + |
| 40 | +jobs: |
| 41 | + build: |
| 42 | + name: vllm-ascend image build |
| 43 | + runs-on: >- |
| 44 | + ${{ |
| 45 | + github.event_name == 'push' && github.repository_owner == 'vllm-project' && |
| 46 | + 'ubuntu-latest' || |
| 47 | + 'ubuntu-24.04-arm' |
| 48 | + }} |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + |
| 52 | + - name: Print |
| 53 | + run: | |
| 54 | + lscpu |
| 55 | +
|
| 56 | + - name: Docker meta |
| 57 | + id: meta |
| 58 | + uses: docker/metadata-action@v5 |
| 59 | + with: |
| 60 | + # TODO(yikun): add more hub image and a note on release policy for container image |
| 61 | + images: | |
| 62 | + quay.io/ascend/vllm-ascend |
| 63 | + # Note for test case |
| 64 | + # https://github.com/marketplace/actions/docker-metadata-action#typeref |
| 65 | + # 1. branch job pulish per main/*-dev branch commits |
| 66 | + # 2. main and dev pull_request is build only, so the tag pr-N-openeuler is fine |
| 67 | + # 3. only pep440 matched tag will be published: |
| 68 | + # - v0.7.1 --> v0.7.1-openeuler, latest |
| 69 | + # - pre/post/dev: v0.7.1rc1-openeuler/v0.7.1rc1-openeuler/v0.7.1rc1.dev1-openeuler/v0.7.1.post1-openeuler, no latest |
| 70 | + # which follow the rule from vLLM with prefix v |
| 71 | + # TODO(yikun): the post release might be considered as latest release |
| 72 | + tags: | |
| 73 | + type=ref,event=branch,suffix=-310p-openeuler |
| 74 | + type=ref,event=pr,suffix=-openeuler |
| 75 | + type=pep440,pattern={{raw}},suffix=-310p-openeuler |
| 76 | +
|
| 77 | + - name: Free up disk space |
| 78 | + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 |
| 79 | + with: |
| 80 | + tool-cache: true |
| 81 | + docker-images: false |
| 82 | + |
| 83 | + - name: Build - Set up QEMU |
| 84 | + uses: docker/setup-qemu-action@v3 |
| 85 | + |
| 86 | + - name: Build - Set up Docker Buildx |
| 87 | + uses: docker/setup-buildx-action@v3 |
| 88 | + |
| 89 | + - name: Publish - Login to Quay Container Registry |
| 90 | + if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} |
| 91 | + uses: docker/login-action@v3 |
| 92 | + with: |
| 93 | + registry: quay.io |
| 94 | + username: ${{ vars.QUAY_USERNAME }} |
| 95 | + password: ${{ secrets.QUAY_PASSWORD }} |
| 96 | + |
| 97 | + - name: Build and push 310p |
| 98 | + uses: docker/build-push-action@v6 |
| 99 | + with: |
| 100 | + platforms: >- |
| 101 | + ${{ |
| 102 | + github.event_name == 'push' && github.repository_owner == 'vllm-project' && |
| 103 | + 'linux/amd64,linux/arm64' || |
| 104 | + 'linux/arm64' |
| 105 | + }} |
| 106 | + # use the current repo path as the build context, ensure .git is contained |
| 107 | + context: . |
| 108 | + # only trigger when tag, branch/main push |
| 109 | + push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} |
| 110 | + labels: ${{ steps.meta.outputs.labels }} |
| 111 | + tags: ${{ steps.meta.outputs.tags }} |
| 112 | + file: Dockerfile.310p.openEuler |
| 113 | + build-args: | |
| 114 | + PIP_INDEX_URL=https://pypi.org/simple |
0 commit comments