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

Change to github-hosted runner for building docker image (#291)

* change to github runner

* update
parent 9e366482
......@@ -3,6 +3,7 @@ name: publish-docker
on:
push:
paths-ignore:
- "!.github/workflows/docker.yml"
- ".github/**"
- "docs/**"
- "resources/**"
......@@ -16,23 +17,33 @@ on:
jobs:
publish_docker_image:
runs-on: [self-hosted, linux-3090]
runs-on: ubuntu-latest
environment: 'prod'
env:
TAG_PREFIX: "openmmlab/lmdeploy"
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get lmdeploy commit id
- name: Check disk space
run: |
export commit_id=$(git log --format="%H" -n 1)
echo "commit id = $commit_id"
echo "COMMIT_ID=$commit_id" >> $GITHUB_ENV
rm -rf ${GITHUB_WORKSPACE}/.git
cat /proc/cpuinfo | grep -ic proc
free
df -h
df . -h
- name: Get docker info
run: |
docker info
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push the latest Docker image
run: |
export TAG=$TAG_PREFIX:latest
echo $TAG
docker build docker/ -t ${TAG} --build-arg COMMIT_ID=${COMMIT_ID}
docker build docker/ -t ${TAG} --no-cache
docker push $TAG
echo "TAG=${TAG}" >> $GITHUB_ENV
- name: Push docker image with released tag
......
......@@ -9,11 +9,10 @@ RUN python3 -m pip install --no-cache-dir cmake
ENV NCCL_LAUNCH_MODE=GROUP
ARG COMMIT_ID=main
ARG VERSION=main
RUN git clone --depth=1 https://github.com/InternLM/lmdeploy.git &&\
RUN git clone --depth=1 --branch=${VERSION} https://github.com/InternLM/lmdeploy.git &&\
cd lmdeploy &&\
git checkout ${COMMIT_ID} &&\
python3 -m pip install --no-cache-dir -r requirements.txt &&\
mkdir -p build && cd build &&\
cmake .. \
......
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