diff --git a/.github/actions/nm-build-docker/action.yml b/.github/actions/nm-build-docker/action.yml index c88cd026b832d..44394943ff1f5 100644 --- a/.github/actions/nm-build-docker/action.yml +++ b/.github/actions/nm-build-docker/action.yml @@ -5,7 +5,7 @@ inputs: description: "tag to be used for the docker image" type: string required: true - additional_tag: + extra_tag: description: "additional tag for the docker image" type: string required: true @@ -33,8 +33,8 @@ runs: --build-arg build_version=${{ inputs.build_version }} \ --target vllm-openai . || 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+=$?)) + echo "Add tag ${{ inputs.extra_tag }} for "${{ inputs.build_type }}" build too" + docker image tag ghcr.io/neuralmagic/nm-vllm-openai:${{ inputs.docker_tag }} ghcr.io/neuralmagic/nm-vllm-openai:${{ inputs.extra_tag }} || ((status+=$?)) fi docker image ls -a echo "status=${status}" >> $GITHUB_OUTPUT diff --git a/.github/actions/nm-get-tag/action.yml b/.github/actions/nm-get-docker-tag/action.yml similarity index 64% rename from .github/actions/nm-get-tag/action.yml rename to .github/actions/nm-get-docker-tag/action.yml index 5185a533810b9..93abe52a5d97f 100644 --- a/.github/actions/nm-get-tag/action.yml +++ b/.github/actions/nm-get-docker-tag/action.yml @@ -5,12 +5,17 @@ inputs: description: "type of nm-vllm to install for the docker image: NIGHTLY (default) or RELEASE" type: string default: 'NIGHTLY' +outputs: + tag: + description: "extra tag for the docker image based on build type" + value: ${{ steps.extratag.outputs.tag }} runs: using: composite steps: - - run: | + - id: extratag + run: | tag=nightly - if [[ "${build_type}" = "RELEASE" ]]; then + if [[ "${{ inputs.build_type }}" = "RELEASE" ]]; then tag=latest fi echo "tag=${tag}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index e3030640b3f60..c6a54bb6d3c21 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -40,18 +40,19 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - fetch-depth: 1 + fetch-depth: 0 + ref: ${{ inputs.gitref }} submodules: recursive - name: Set up nvidia-container-toolkit id: setup uses: ./.github/actions/nm-setup-nvidia-container-toolkit/ - - name: Get image additional tag + - name: Get docker image extra tag id: tag - uses: ./.github/actions/nm-get-tag/ + uses: ./.github/actions/nm-get-docker-tag/ with: build_type: ${{ inputs.build_type }} @@ -60,7 +61,7 @@ jobs: uses: ./.github/actions/nm-build-docker/ with: docker_tag: ${{ inputs.docker_tag }} - additional_tag: ${{ steps.tag.outputs.tag }} + extra_tag: ${{ steps.tag.outputs.tag }} build_type: ${{ inputs.build_type }} build_version: ${{ inputs.build_version }} diff --git a/Dockerfile b/Dockerfile index 9ec091a103741..9f741b0ac7e53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,8 @@ # prepare basic build environment FROM nvidia/cuda:12.4.1-devel-ubuntu22.04 AS dev -RUN apt-get update -y \ - && apt-get install -y python3-pip git +RUN apt-get update -y && \ + apt-get install -y python3-pip git # Workaround for https://github.com/openai/triton/issues/2507 and # https://github.com/pytorch/pytorch/issues/107960 -- hopefully @@ -60,8 +60,8 @@ RUN pip --verbose wheel flash-attn==${FLASH_ATTN_VERSION} \ FROM nvidia/cuda:12.4.1-base-ubuntu22.04 AS vllm-base WORKDIR /vllm-workspace -RUN apt-get update -y \ - && apt-get install -y python3-pip git vim +RUN apt-get update -y && \ + apt-get install -y python3-pip git vim # Workaround for https://github.com/openai/triton/issues/2507 and # https://github.com/pytorch/pytorch/issues/107960 -- hopefully @@ -70,7 +70,7 @@ RUN apt-get update -y \ RUN ldconfig /usr/local/cuda-12.4/compat/ # install nm-vllm wheel first, so that torch etc will be installed -ARG build_type="nightly" +ARG build_type="NIGHTLY" ARG build_version="latest" ENV INSTALL_TYPE=${build_type} ENV INSTALL_VERSION=${build_version} @@ -78,7 +78,7 @@ ENV INSTALL_VERSION=${build_version} # use nm pypi for now for testing RUN --mount=type=bind,from=build \ --mount=type=cache,target=/root/.cache/pip \ - if [ "${INSTALL_TYPE}" = "nightly" ]; then \ + if [ "${INSTALL_TYPE}" = "NIGHTLY" ]; then \ if [ "${INSTALL_VERSION}" = "latest" ]; then \ pip install nm-vllm-nightly[sparse] --extra-index-url https://pypi.neuralmagic.com/simple; \ else \