diff --git a/.github/workflows/docker-nightly.yml b/.github/workflows/docker-nightly.yml new file mode 100644 index 0000000000..71f79b2348 --- /dev/null +++ b/.github/workflows/docker-nightly.yml @@ -0,0 +1,66 @@ +name: publish-docker-nightly + +on: + workflow_dispatch: + inputs: + repo_ref: + required: false + description: 'Set branch or tag or commit id. Default is "main"' + type: string + default: 'main' + schedule: + - cron: '00 8 * * 0-4' + +env: + TAG: "openmmlab/lmdeploy:nightly-cu12.8" + +jobs: + publish_docker_image: + runs-on: ubuntu-latest + env: + CUDA_VERSION: "cu12.8" + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.repo_ref || 'main' }} + - name: Free disk space + uses: jlumbroso/free-disk-space@main + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: false + docker-images: false + # All of these default to true, but feel free to set to "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: false + - name: Get docker info + run: | + docker info + # remove http extraheader (tolerate missing key) + git config --local --unset "http.https://github.com/.extraheader" || true + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push Docker image + run: | + echo ${{ env.TAG }} + docker build . -f docker/Dockerfile -t ${{ env.TAG }} --build-arg CUDA_VERSION=${{ env.CUDA_VERSION }} + docker push ${{ env.TAG }} + + publish_inner_docker_image: + runs-on: image-sync-inner + needs: publish_docker_image + env: + INNER_TAG: "registry.h.pjlab.org.cn/ailab-puyu-puyu_gpu/lmdeploy:nightly-cu12.8" + steps: + - name: Pull and push to inner + run: | + docker pull ${{ env.TAG }} + docker login registry.h.pjlab.org.cn -p ${{ secrets.CLUSTER_DOCKERHUB_TOKEN }} -u ${{ secrets.CLUSTER_DOCKERHUB_USERNAME }} + docker tag ${{ env.TAG }} ${{ env.INNER_TAG }} + docker push ${{ env.INNER_TAG }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ab8f746dc2..a80100307a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -189,3 +189,18 @@ jobs: echo $TAG docker build . -t ${TAG} -f docker/Dockerfile_ascend_a3 --platform linux/arm64 docker push $TAG + + publish_inner_docker_image: + needs: publish_docker_image + runs-on: image-sync-inner + environment: 'prod' + env: + TAG: "openmmlab/lmdeploy:latest-cu12.8" + INNER_TAG: "registry.h.pjlab.org.cn/ailab-puyu-puyu_gpu/lmdeploy:${{github.event.inputs.image_tag}}-cu12.8" + steps: + - name: Pull and push to inner + run: | + docker pull ${{ env.TAG }} + docker login registry.h.pjlab.org.cn -p ${{ secrets.CLUSTER_DOCKERHUB_TOKEN }} -u ${{ secrets.CLUSTER_DOCKERHUB_USERNAME }} + docker tag ${{ env.TAG }} ${{ env.INNER_TAG }} + docker push ${{ env.INNER_TAG }}