From 71d2c867b5d45c8dfe42872b7e5697793be79f4b Mon Sep 17 00:00:00 2001 From: felix-wang <35718120+numb3r3@users.noreply.github.com> Date: Thu, 12 May 2022 10:48:18 +0800 Subject: [PATCH] fix: docker build push (#714) * fix: mintor revision * fix: if run * fix: cache * fix: clean debug * fix: add tensorrt tag --- .github/workflows/force-docker-build.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index 6ec6e3105..a774f2552 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -11,6 +11,7 @@ on: required: false default: MANUAL + jobs: token-check: runs-on: ubuntu-latest @@ -26,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - pip_tag: [ "", "onnx"] # default: "" = torch + pip_tag: ["", "onnx", "tensorrt"] # default: "" = torch engine_tag: ["", "cuda"] # default: "" = cpu steps: - uses: actions/checkout@v2 @@ -74,11 +75,8 @@ jobs: jinaai/clip_executor:${CAS_VERSION}${PIP_TAG}${ENGINE_TAG} \ " >> $GITHUB_ENV else - # test - echo "Debugging Workflow!" - echo "TAG_ALIAS=\ - jinaai/clip_executor:${CAS_VERSION}${PIP_TAG}${ENGINE_TAG} \ - " >> $GITHUB_ENV + echo "Bad triggered_by: ${{ github.event.inputs.triggered_by }}!" + exit 1 fi echo "CAS_VERSION=${CAS_VERSION}" >> $GITHUB_ENV @@ -99,12 +97,15 @@ jobs: docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-aarch64 docker run --rm --privileged tonistiigi/binfmt --install all - name: CPU Build and push + id: base_docker_build + if: ${{ matrix.engine_tag == '' }} && ${{ matrix.pip_tag != 'tensorrt' }} uses: docker/build-push-action@v2 - if: ${{ matrix.engine_tag }} == '' with: context: . file: Dockerfiles/base.Dockerfile platforms: linux/amd64 + cache-from: type=registry,ref=jinaai/clip_executor:latest + cache-to: type=inline push: true tags: ${{env.TAG_ALIAS}} build-args: | @@ -113,12 +114,15 @@ jobs: VCS_REF=${{env.VCS_REF}} PIP_TAG=${{matrix.pip_tag}} - name: CUDA Build and push + id: cuda_docker_build + if: ${{ matrix.engine_tag == 'cuda' }} uses: docker/build-push-action@v2 - if: ${{ matrix.engine_tag }} == 'cuda' with: context: . file: Dockerfiles/cuda.Dockerfile platforms: linux/amd64 + cache-from: type=registry,ref=jinaai/clip_executor:latest-cuda + cache-to: type=inline push: true tags: ${{env.TAG_ALIAS}} build-args: |