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

Fix docker upload bugs #352

Merged
merged 7 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions .github/actions/nm-get-docker-tags/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ inputs:
wf_category:
description: "type of nm-vllm to install for the docker image: NIGHTLY or RELEASE"
required: true
wheel:
description: "wheel name, if latest use the latest from nm pypi"
whl:
description: "name of nm-vllm wheel to install for the docker image"
required: true
outputs:
tag:
Expand All @@ -22,16 +22,23 @@ runs:
steps:
- id: tags
run: |
BUILD_VERSION=`echo "${{ inputs.wheel }}" | cut -d'-' -f2`
BUILD_VERSION=`echo "${{ inputs.whl }}" | cut -d'-' -f2`
if [[ "${{ inputs.wf_category }}" == "RELEASE" ]]; then
TAG="v${build_version}"
EXTRA_TAG=latest
if [[ "${BUILD_VERSION}" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then
TAG="v${BUILD_VERSION}"
EXTRA_TAG=latest
else
echo "ERROR: wheel version ${BUILD_VERSION} doesn't match RELEASE format. Check input."
exit 1
fi
else
TAG=`echo "${build_version}" | cut -d'.' -f4`
EXTRA_TAG=nightly
fi
if [[ "${{ inputs.wheel }}" == "latest" ]]; then
BUILD_VERSION="latest"
if [[ "${BUILD_VERSION}" =~ ^[0-9]+.[0-9]+.[0-9]+.[0-9]{8}$ ]]; then
TAG=`echo "${BUILD_VERSION}" | cut -d'.' -f4`
EXTRA_TAG=nightly
else
echo "ERROR: wheel version ${BUILD_VERSION} doesn't match NIGHTLY format. Check input."
exit 1
fi
fi
echo "tag=${TAG}" >> $GITHUB_OUTPUT
echo "extra_tag=${EXTRA_TAG}" >> $GITHUB_OUTPUT
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nm-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ jobs:

# update docker
DOCKER:
needs: [BUILD, UPLOAD]
if: ${{ inputs.push_to_pypi }}
needs: [BUILD]
if: ${{ inputs.wf_category != 'REMOTE' }}
uses: ./.github/workflows/publish-docker.yml
with:
push_to_repository: ${{ inputs.push_to_pypi }}
gitref: ${{ inputs.gitref }}
wf_category: ${{ inputs.wf_category }}
wheel: ${{ needs.BUILD.outputs.whl }}
whl: ${{ needs.BUILD.outputs.whl }}
secrets: inherit
4 changes: 4 additions & 0 deletions .github/workflows/nm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ on:
description: "python version, e.g. 3.10.12"
type: string
required: true
outputs:
whl:
description: 'basename for generated whl'
value: ${{ jobs.BUILD.outputs.whl }}

# makes workflow manually callable
workflow_dispatch:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ on:
description: "type of nm-vllm to install for the docker image: NIGHTLY (default) or RELEASE"
type: string
default: 'NIGHTLY'
wheel:
description: "nm-vllm wheel to install for the docker image: latest (default) or specific wheel name"
whl:
description: "nm-vllm wheel to install for the docker image"
type: string
default: 'latest'
required: true

workflow_dispatch:
inputs:
Expand All @@ -34,10 +34,10 @@ on:
description: "type of nm-vllm to install for the docker image: NIGHTLY (default) or RELEASE"
type: string
default: 'NIGHTLY'
wheel:
description: "nm-vllm wheel to install for the docker image: latest (default) or specific wheel name"
whl:
description: "nm-vllm wheel to install for the docker image"
type: string
default: 'latest'
required: true

jobs:
build-docker-image:
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
uses: ./.github/actions/nm-get-docker-tags/
with:
wf_category: ${{ inputs.wf_category }}
wheel: ${{ inputs.wheel }}
whl: ${{ inputs.whl }}

- name: Build image
id: build
Expand Down
17 changes: 0 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,6 @@ RUN apt-get update -y && apt-get install -y ccache

#################### EXTENSION Build IMAGE ####################

#################### FLASH_ATTENTION Build IMAGE ####################
FROM dev as flash-attn-builder
# flash attention version
ARG flash_attn_version=v2.5.8
ENV FLASH_ATTN_VERSION=${flash_attn_version}

WORKDIR /usr/src/flash-attention-v2

# Download the wheel or build it if a pre-compiled release doesn't exist
RUN pip --verbose wheel flash-attn==${FLASH_ATTN_VERSION} \
--no-build-isolation --no-deps --no-cache-dir

#################### FLASH_ATTENTION Build IMAGE ####################

mgoin marked this conversation as resolved.
Show resolved Hide resolved
#################### vLLM installation IMAGE ####################
# image with vLLM installed
FROM nvidia/cuda:${CUDA_VERSION}-base-ubuntu22.04 AS vllm-base
Expand Down Expand Up @@ -114,9 +100,6 @@ RUN --mount=type=bind,from=build \
fi; \
fi

RUN --mount=type=bind,from=flash-attn-builder,src=/usr/src/flash-attention-v2,target=/usr/src/flash-attention-v2 \
--mount=type=cache,target=/root/.cache/pip \
pip install /usr/src/flash-attention-v2/*.whl --no-cache-dir
#################### vLLM installation IMAGE ####################

#################### TEST IMAGE ####################
Expand Down
Loading