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

Add github action for publishing docker image (#148)

* add docker action

* update

* fix

* update
parent 406f8c9f
name: publish-docker
on:
push:
paths-ignore:
- ".github/**"
- "docs/**"
- "resources/**"
- "benchmark/**"
- "tests/**"
- "**/*.md"
branches:
- main
tags:
- "v*.*.*"
jobs:
publish_docker_image:
runs-on: [self-hosted, linux-3090]
environment: 'prod'
env:
TAG_PREFIX: "openmmlab/lmdeploy"
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get lmdeploy commit id
run: |
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
run: |
echo "TAG=$TAG_PREFIX:latest" >> $GITHUB_ENV
- name: Get lmdeploy 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
...@@ -5,12 +5,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ...@@ -5,12 +5,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& 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 torch==1.13.1+cu117 torchvision==0.14.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117
RUN python3 -m pip install sentencepiece cmake transformers<4.30.0 protobuf==3.20.3 pybind11 mmengine RUN python3 -m pip install cmake
ENV NCCL_LAUNCH_MODE=GROUP ENV NCCL_LAUNCH_MODE=GROUP
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} &&\
python3 -m pip install -r requirements.txt &&\
mkdir -p build && cd build &&\ mkdir -p build && cd build &&\
cmake .. \ cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
...@@ -25,7 +29,6 @@ RUN git clone --depth=1 https://github.com/InternLM/lmdeploy.git &&\ ...@@ -25,7 +29,6 @@ RUN git clone --depth=1 https://github.com/InternLM/lmdeploy.git &&\
make -j$(nproc) && make install &&\ make -j$(nproc) && make install &&\
cd .. &&\ cd .. &&\
python3 -m pip install . &&\ python3 -m pip install . &&\
python3 -m pip install -r requirements.txt &&\
rm -rf build rm -rf build
ENV LD_LIBRARY_PATH=/opt/tritonserver/lib:$LD_LIBRARY_PATH ENV LD_LIBRARY_PATH=/opt/tritonserver/lib:$LD_LIBRARY_PATH
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