Unverified Commit 06327355 authored by RunningLeon's avatar RunningLeon Committed by GitHub
Browse files

Update workflow for building docker image (#282)

* update

* debug

* Revert "debug"

This reverts commit 1c1f1d75591e44bf315c720f4954d1ea30b92989.

* update
parent d5c10e7a
...@@ -28,23 +28,19 @@ jobs: ...@@ -28,23 +28,19 @@ jobs:
export commit_id=$(git log --format="%H" -n 1) export commit_id=$(git log --format="%H" -n 1)
echo "commit id = $commit_id" echo "commit id = $commit_id"
echo "COMMIT_ID=$commit_id" >> $GITHUB_ENV echo "COMMIT_ID=$commit_id" >> $GITHUB_ENV
- name: Get lmdeploy version - name: Build and push the latest Docker image
if: startsWith(github.ref, 'refs/tags/') == false
run: | run: |
echo "TAG=$TAG_PREFIX:latest" >> $GITHUB_ENV export TAG=$TAG_PREFIX:latest
- name: Get lmdeploy tag 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 if: startsWith(github.ref, 'refs/tags/') == true
run: | run: |
export LMDEPLOY_VERSION=$(python3 -c "import sys; sys.path.append('lmdeploy');from version import __version__;print(__version__)") export LMDEPLOY_VERSION=$(python3 -c "import sys; sys.path.append('lmdeploy');from version import __version__;print(__version__)")
echo $LMDEPLOY_VERSION echo $LMDEPLOY_VERSION
echo "TAG=${TAG_PREFIX}:v${LMDEPLOY_VERSION}" >> $GITHUB_ENV export RELEASE_TAG=${TAG_PREFIX}:v${LMDEPLOY_VERSION}
- name: Build Docker image echo $RELEASE_TAG
continue-on-error: true docker tag $TAG $RELEASE_TAG
run: | docker push $RELEASE_TAG
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
FROM nvcr.io/nvidia/tritonserver:22.12-py3 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 \ rapidjson-dev libgoogle-glog-dev gdb \
&& rm -rf /var/lib/apt/lists/* && 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 --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 cmake RUN python3 -m pip install --no-cache-dir cmake
ENV NCCL_LAUNCH_MODE=GROUP ENV NCCL_LAUNCH_MODE=GROUP
...@@ -14,7 +14,7 @@ ARG COMMIT_ID=main ...@@ -14,7 +14,7 @@ ARG COMMIT_ID=main
RUN git clone --depth=1 https://github.com/InternLM/lmdeploy.git &&\ RUN git clone --depth=1 https://github.com/InternLM/lmdeploy.git &&\
cd lmdeploy &&\ cd lmdeploy &&\
git checkout ${COMMIT_ID} &&\ 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 &&\ mkdir -p build && cd build &&\
cmake .. \ cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment