|
1 | 1 | name: Docker Build + Publish |
2 | 2 |
|
3 | 3 | on: |
4 | | - workflow_dispatch: |
| 4 | + workflow_call: |
5 | 5 | inputs: |
6 | | - docker_tag: |
7 | | - description: "tag to be used for the docker image" |
8 | | - type: string |
9 | | - required: true |
10 | 6 | push_to_repository: |
11 | | - description: "whether to push out the docker image: no (default) or yes" |
| 7 | + description: "whether to push out the docker image: false (default) or true" |
| 8 | + type: boolean |
| 9 | + default: false |
| 10 | + gitref: |
| 11 | + description: "git commit hash or branch name" |
| 12 | + type: string |
| 13 | + default: 'main' |
| 14 | + wf_category: |
| 15 | + description: "type of nm-vllm to install for the docker image: NIGHTLY (default) or RELEASE" |
12 | 16 | type: string |
13 | | - default: 'no' |
| 17 | + default: 'NIGHTLY' |
| 18 | + wheel: |
| 19 | + description: "nm-vllm wheel to install for the docker image: latest (default) or specific wheel name" |
| 20 | + type: string |
| 21 | + default: 'latest' |
| 22 | + |
| 23 | + workflow_dispatch: |
| 24 | + inputs: |
| 25 | + push_to_repository: |
| 26 | + description: "whether to push out the docker image: false (default) or true" |
| 27 | + type: boolean |
| 28 | + default: false |
14 | 29 | gitref: |
15 | 30 | description: "git commit hash or branch name" |
16 | 31 | type: string |
17 | 32 | default: 'main' |
18 | | - build_type: |
| 33 | + wf_category: |
19 | 34 | description: "type of nm-vllm to install for the docker image: NIGHTLY (default) or RELEASE" |
20 | 35 | type: string |
21 | 36 | default: 'NIGHTLY' |
22 | | - build_version: |
23 | | - description: "version of nm-vllm to install for the docker image: latest (default) or specific version e.g. 0.4.0, 0.4.0.20240531" |
| 37 | + wheel: |
| 38 | + description: "nm-vllm wheel to install for the docker image: latest (default) or specific wheel name" |
24 | 39 | type: string |
25 | 40 | default: 'latest' |
26 | 41 |
|
@@ -50,35 +65,36 @@ jobs: |
50 | 65 | id: setup |
51 | 66 | uses: ./.github/actions/nm-setup-nvidia-container-toolkit/ |
52 | 67 |
|
53 | | - - name: Get docker image extra tag |
54 | | - id: tag |
55 | | - uses: ./.github/actions/nm-get-docker-tag/ |
| 68 | + - name: Get docker image tags |
| 69 | + id: tags |
| 70 | + uses: ./.github/actions/nm-get-docker-tags/ |
56 | 71 | with: |
57 | | - build_type: ${{ inputs.build_type }} |
| 72 | + wf_category: ${{ inputs.wf_category }} |
| 73 | + wheel: ${{ inputs.wheel }} |
58 | 74 |
|
59 | 75 | - name: Build image |
60 | 76 | id: build |
61 | 77 | uses: ./.github/actions/nm-build-docker/ |
62 | 78 | with: |
63 | | - docker_tag: ${{ inputs.docker_tag }} |
64 | | - extra_tag: ${{ steps.tag.outputs.tag }} |
65 | | - build_type: ${{ inputs.build_type }} |
66 | | - build_version: ${{ inputs.build_version }} |
| 79 | + docker_tag: ${{ steps.tags.outputs.tag }} |
| 80 | + extra_tag: ${{ steps.tags.outputs.extra_tag }} |
| 81 | + wf_category: ${{ inputs.wf_category }} |
| 82 | + build_version: ${{ steps.tags.outputs.build_version }} |
67 | 83 |
|
68 | 84 | - name: Push image |
69 | 85 | uses: docker/build-push-action@v5 |
70 | | - if: ${{ inputs.push_to_repository == 'yes' && steps.build.outputs.status == 0 }} |
| 86 | + if: ${{ inputs.push_to_repository && steps.build.outputs.status == 0 }} |
71 | 87 | with: |
72 | 88 | context: . |
73 | 89 | target: vllm-openai |
74 | 90 | push: true |
75 | | - tags: ghcr.io/neuralmagic/nm-vllm-openai:${{ inputs.docker_tag }} |
| 91 | + tags: ghcr.io/neuralmagic/nm-vllm-openai:${{ steps.tags.outputs.tag }} |
76 | 92 |
|
77 | 93 | - name: Push image |
78 | 94 | uses: docker/build-push-action@v5 |
79 | | - if: ${{ inputs.push_to_repository == 'yes' && steps.build.outputs.status == 0 }} |
| 95 | + if: ${{ inputs.push_to_repository && steps.build.outputs.status == 0 }} |
80 | 96 | with: |
81 | 97 | context: . |
82 | 98 | target: vllm-openai |
83 | 99 | push: true |
84 | | - tags: ghcr.io/neuralmagic/nm-vllm-openai:${{ steps.tag.outputs.tag }} |
| 100 | + tags: ghcr.io/neuralmagic/nm-vllm-openai:${{ steps.tags.outputs.extra_tag }} |
0 commit comments