|
| 1 | +name: Publish vLLM CPU images |
| 2 | + |
| 3 | +on: |
| 4 | + # NOTE(sd109): Since this is checking out an external |
| 5 | + # it's probably safer to leave this as workflow dispatch |
| 6 | + # only so that we can manually build images from specific |
| 7 | + # refs rather than automatically pulling in the latest |
| 8 | + # content from the remote repo. |
| 9 | + workflow_dispatch: |
| 10 | + inputs: |
| 11 | + vllm_ref: |
| 12 | + type: string |
| 13 | + description: The vLLM GitHub ref (tag, branch or commit) to build. |
| 14 | + required: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + build_push_image: |
| 18 | + name: Build and push image |
| 19 | + runs-on: ubuntu-latest |
| 20 | + permissions: |
| 21 | + contents: read |
| 22 | + id-token: write # needed for signing the images with GitHub OIDC Token |
| 23 | + packages: write # required for pushing container images |
| 24 | + security-events: write # required for pushing SARIF files |
| 25 | + steps: |
| 26 | + - name: Check out the vLLM repository |
| 27 | + uses: actions/checkout@v4 |
| 28 | + with: |
| 29 | + repository: vllm-project/vllm |
| 30 | + ref: ${{ inputs.vllm_ref }} |
| 31 | + |
| 32 | + - name: Login to GitHub Container Registry |
| 33 | + uses: docker/login-action@v3 |
| 34 | + with: |
| 35 | + registry: ghcr.io |
| 36 | + username: ${{ github.actor }} |
| 37 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 38 | + |
| 39 | + - name: Calculate metadata for image |
| 40 | + id: image-meta |
| 41 | + uses: docker/metadata-action@v5 |
| 42 | + with: |
| 43 | + images: ghcr.io/stackhpc/vllm-cpu |
| 44 | + # Produce the branch name or tag and the SHA as tags |
| 45 | + tags: | |
| 46 | + type=raw,value=${{ inputs.vllm_ref }} |
| 47 | +
|
| 48 | + - name: Build and push image x86 image |
| 49 | + uses: azimuth-cloud/github-actions/docker-multiarch-build-push@master |
| 50 | + with: |
| 51 | + cache-key: vllm-cpu |
| 52 | + file: Dockerfile.cpu |
| 53 | + platforms: linux/amd64 |
| 54 | + push: true |
| 55 | + tags: ${{ steps.image-meta.outputs.tags }} |
| 56 | + labels: ${{ steps.image-meta.outputs.labels }} |
| 57 | + |
| 58 | + # TODO: Test whether this works |
| 59 | + # - name: Build and push Arm image |
| 60 | + # uses: azimuth-cloud/github-actions/docker-multiarch-build-push@master |
| 61 | + # with: |
| 62 | + # cache-key: vllm-cpu |
| 63 | + # file: Dockerfile.cpu |
| 64 | + # platforms: linux/arm64 |
| 65 | + # push: true |
| 66 | + # tags: ${{ steps.image-meta.outputs.tags }} |
| 67 | + # labels: ${{ steps.image-meta.outputs.labels }} |
0 commit comments