Skip to content

Commit

Permalink
Update workflow for building docker image (#282)
Browse files Browse the repository at this point in the history
* update

* debug

* Revert "debug"

This reverts commit 1c1f1d7.

* update
  • Loading branch information
RunningLeon authored Aug 22, 2023
1 parent d5c10e7 commit 0632735
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
26 changes: 11 additions & 15 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,19 @@ jobs:
export commit_id=$(git log --format="%H" -n 1)
echo "commit id = $commit_id"
echo "COMMIT_ID=$commit_id" >> $GITHUB_ENV
- name: Get lmdeploy version
if: startsWith(github.ref, 'refs/tags/') == false
- name: Build and push the latest Docker image
run: |
echo "TAG=$TAG_PREFIX:latest" >> $GITHUB_ENV
- name: Get lmdeploy tag
export TAG=$TAG_PREFIX:latest
echo $TAG
docker build docker/ -t ${TAG} --build-arg COMMIT_ID=${COMMIT_ID}
docker push $TAG
echo "TAG=${TAG}" >> $GITHUB_ENV
- name: Push docker image with released tag
if: startsWith(github.ref, 'refs/tags/') == true
run: |
export LMDEPLOY_VERSION=$(python3 -c "import sys; sys.path.append('lmdeploy');from version import __version__;print(__version__)")
echo $LMDEPLOY_VERSION
echo "TAG=${TAG_PREFIX}:v${LMDEPLOY_VERSION}" >> $GITHUB_ENV
- name: Build Docker image
continue-on-error: true
run: |
echo $TAG
docker build docker/ -t ${TAG} --build-arg COMMIT_ID=${COMMIT_ID}
- name: Push Docker image
continue-on-error: true
run: |
echo $TAG
docker push $TAG
export RELEASE_TAG=${TAG_PREFIX}:v${LMDEPLOY_VERSION}
echo $RELEASE_TAG
docker tag $TAG $RELEASE_TAG
docker push $RELEASE_TAG
8 changes: 4 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM nvcr.io/nvidia/tritonserver:22.12-py3

RUN apt-get update && apt-get install -y --no-install-recommends \
RUN rm /etc/apt/sources.list.d/cuda*.list && apt-get update && apt-get install -y --no-install-recommends \
rapidjson-dev libgoogle-glog-dev gdb \
&& rm -rf /var/lib/apt/lists/*

RUN python3 -m pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117
RUN python3 -m pip install cmake
RUN python3 -m pip install --no-cache-dir torch==1.13.1+cu117 torchvision==0.14.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117
RUN python3 -m pip install --no-cache-dir cmake

ENV NCCL_LAUNCH_MODE=GROUP

Expand All @@ -14,7 +14,7 @@ ARG COMMIT_ID=main
RUN git clone --depth=1 https://github.com/InternLM/lmdeploy.git &&\
cd lmdeploy &&\
git checkout ${COMMIT_ID} &&\
python3 -m pip install -r requirements.txt &&\
python3 -m pip install --no-cache-dir -r requirements.txt &&\
mkdir -p build && cd build &&\
cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
Expand Down

0 comments on commit 0632735

Please sign in to comment.