Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Add nightly tag (#287)
Browse files Browse the repository at this point in the history
Add tag "nightly" to nightly docker image so it can be pulled out easily
without using the date string.

---------

Co-authored-by: dhuangnm <[email protected]>
  • Loading branch information
dhuangnm and dhuangnm authored Jun 10, 2024
1 parent 9fe9187 commit a7a385b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
10 changes: 7 additions & 3 deletions .github/actions/nm-build-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ inputs:
description: "tag to be used for the docker image"
type: string
required: true
additional_tag:
description: "additional tag for the docker image"
type: string
required: true
build_type:
description: "type of nm-vllm to install for the docker image: NIGHTLY (default) or RELEASE"
type: string
Expand All @@ -28,9 +32,9 @@ runs:
--build-arg build_type=${{ inputs.build_type }} \
--build-arg build_version=${{ inputs.build_version }} \
--target vllm-openai . || status=$?
if [ ${status} -eq 0 ] && [[ "${build_type}" = "RELEASE" ]]; then
echo "Also tag image for RELEASE build as latest"
docker image tag ghcr.io/neuralmagic/nm-vllm-openai:${{ inputs.docker_tag }} ghcr.io/neuralmagic/nm-vllm-openai:latest || ((status+=$?))
if [ ${status} -eq 0 ]; then
echo "Add tag ${additional_tag} for "${build_type}" build too"
docker image tag ghcr.io/neuralmagic/nm-vllm-openai:${{ inputs.docker_tag }} ghcr.io/neuralmagic/nm-vllm-openai:${additional_tag} || ((status+=$?))
fi
docker image ls -a
echo "status=${status}" >> $GITHUB_OUTPUT
Expand Down
17 changes: 17 additions & 0 deletions .github/actions/nm-get-tag/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Get additinal docker image tag based on build type
description: 'docker image tag for nm-vllm'
inputs:
build_type:
description: "type of nm-vllm to install for the docker image: NIGHTLY (default) or RELEASE"
type: string
default: 'NIGHTLY'
runs:
using: composite
steps:
- run: |
tag=nightly
if [[ "${build_type}" = "RELEASE" ]]; then
tag=latest
fi
echo "tag=${tag}" >> $GITHUB_OUTPUT
shell: bash
13 changes: 10 additions & 3 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,18 @@ jobs:
id: setup
uses: ./.github/actions/nm-setup-nvidia-container-toolkit/

- name: Get image additional tag
id: tag
uses: ./.github/actions/nm-get-tag/
with:
build_type: ${{ inputs.build_type }}

- name: Build image
id: build
uses: ./.github/actions/nm-build-docker/
with:
docker_tag: ${{ inputs.docker_tag }}
additional_tag: ${{ steps.tag.outputs.tag }}
build_type: ${{ inputs.build_type }}
build_version: ${{ inputs.build_version }}

Expand All @@ -66,11 +73,11 @@ jobs:
push: true
tags: ghcr.io/neuralmagic/nm-vllm-openai:${{ inputs.docker_tag }}

- name: Push image (latest for RELEASE)
- name: Push image
uses: docker/build-push-action@v5
if: ${{ inputs.push_to_repository == 'yes' && steps.build.outputs.status == 0 && inputs.build_type == 'RELEASE' }}
if: ${{ inputs.push_to_repository == 'yes' && steps.build.outputs.status == 0 }}
with:
context: .
target: vllm-openai
push: true
tags: ghcr.io/neuralmagic/nm-vllm-openai:latest
tags: ghcr.io/neuralmagic/nm-vllm-openai:${{ steps.tag.outputs.tag }}

0 comments on commit a7a385b

Please sign in to comment.