From fdd9a3143946895e4cec17ba9db28937d48cdfd9 Mon Sep 17 00:00:00 2001 From: dhuangnm <74931910+dhuangnm@users.noreply.github.com> Date: Mon, 3 Jun 2024 16:14:54 -0400 Subject: [PATCH] add latest tag for release docker image (#279) Need to tag the latest for the release docker image --------- Co-authored-by: dhuangnm --- .github/actions/nm-build-docker/action.yml | 9 +++++++-- .github/workflows/publish-docker.yml | 13 +++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/actions/nm-build-docker/action.yml b/.github/actions/nm-build-docker/action.yml index db128c5d103d..1d584ab6895a 100644 --- a/.github/actions/nm-build-docker/action.yml +++ b/.github/actions/nm-build-docker/action.yml @@ -6,9 +6,9 @@ inputs: type: string required: true build_type: - description: "type of nm-vllm to install for the docker image: nightly (default) or release" + description: "type of nm-vllm to install for the docker image: NIGHTLY (default) or RELEASE" type: string - default: 'nightly' + default: 'NIGHTLY' build_version: 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" type: string @@ -27,6 +27,11 @@ 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+=$?)) + fi + docker image ls -a echo "status=${status}" >> $GITHUB_OUTPUT echo "status=${status}" exit ${status} diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 1e129ebc5599..4890fbe4a807 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -16,9 +16,9 @@ on: type: string default: 'main' build_type: - description: "type of nm-vllm to install for the docker image: nightly (default) or release" + description: "type of nm-vllm to install for the docker image: NIGHTLY (default) or RELEASE" type: string - default: 'nightly' + default: 'NIGHTLY' build_version: 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" type: string @@ -65,3 +65,12 @@ jobs: target: vllm-openai push: true tags: ghcr.io/neuralmagic/nm-vllm-openai:${{ inputs.docker_tag }} + + - name: Push image (latest for RELEASE) + uses: docker/build-push-action@v5 + if: ${{ inputs.push_to_repository == 'yes' && steps.build.outputs.status == 0 && inputs.build_type == 'RELEASE' }} + with: + context: . + target: vllm-openai + push: true + tags: ghcr.io/neuralmagic/nm-vllm-openai:latest