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 ...@@ -3,6 +3,7 @@ name: publish-docker
on: on:
push: push:
paths-ignore: paths-ignore:
- "!.github/workflows/docker.yml"
- ".github/**" - ".github/**"
- "docs/**" - "docs/**"
- "resources/**" - "resources/**"
...@@ -16,23 +17,33 @@ on: ...@@ -16,23 +17,33 @@ on:
jobs: jobs:
publish_docker_image: publish_docker_image:
runs-on: [self-hosted, linux-3090] runs-on: ubuntu-latest
environment: 'prod' environment: 'prod'
env: env:
TAG_PREFIX: "openmmlab/lmdeploy" TAG_PREFIX: "openmmlab/lmdeploy"
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Get lmdeploy commit id - name: Check disk space
run: | run: |
export commit_id=$(git log --format="%H" -n 1) rm -rf ${GITHUB_WORKSPACE}/.git
echo "commit id = $commit_id" cat /proc/cpuinfo | grep -ic proc
echo "COMMIT_ID=$commit_id" >> $GITHUB_ENV 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 - name: Build and push the latest Docker image
run: | run: |
export TAG=$TAG_PREFIX:latest export TAG=$TAG_PREFIX:latest
echo $TAG echo $TAG
docker build docker/ -t ${TAG} --build-arg COMMIT_ID=${COMMIT_ID} docker build docker/ -t ${TAG} --no-cache
docker push $TAG docker push $TAG
echo "TAG=${TAG}" >> $GITHUB_ENV echo "TAG=${TAG}" >> $GITHUB_ENV
- name: Push docker image with released tag - name: Push docker image with released tag
......
...@@ -9,11 +9,10 @@ RUN python3 -m pip install --no-cache-dir cmake ...@@ -9,11 +9,10 @@ RUN python3 -m pip install --no-cache-dir cmake
ENV NCCL_LAUNCH_MODE=GROUP 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 &&\ cd lmdeploy &&\
git checkout ${COMMIT_ID} &&\
python3 -m pip install --no-cache-dir -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 .. \
......
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