From d7b5481042d4d199c5d42458a3dfc9b9410df140 Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 13:36:18 +0800 Subject: [PATCH 01/16] feat: add dockerfiles and GH runer --- .dockerignore | 4 + .github/workflows/force-docker-build.yml | 112 ++++++++++++++++++ Dockerfiles/base.Dockerfile | 40 +++++++ Dockerfiles/cuda.Dockerfile | 42 +++++++ Dockerfiles/tensorrt.Dockerfile | 34 ++++++ docs/user-guides/server.md | 2 +- .../{clip_trt.py => clip_tensorrt.py} | 0 server/clip_server/tensorrt-flow.yml | 2 +- tests/conftest.py | 2 +- 9 files changed, 235 insertions(+), 3 deletions(-) create mode 100644 .dockerignore create mode 100644 .github/workflows/force-docker-build.yml create mode 100644 Dockerfiles/base.Dockerfile create mode 100644 Dockerfiles/cuda.Dockerfile create mode 100644 Dockerfiles/tensorrt.Dockerfile rename server/clip_server/executors/{clip_trt.py => clip_tensorrt.py} (100%) diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..77f9cc755 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +.github +scripts +docs \ No newline at end of file diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml new file mode 100644 index 000000000..bcb6f88a2 --- /dev/null +++ b/.github/workflows/force-docker-build.yml @@ -0,0 +1,112 @@ +name: Manual Docker Build + +on: + workflow_dispatch: + inputs: + release_token: + description: 'Your release token' + required: true + triggered_by: + description: 'CD | TAG | MANUAL' + required: false + default: MANUAL + +jobs: + token-check: + runs-on: ubuntu-latest + steps: + - run: echo "success!" + if: "${{ github.event.inputs.release_token }} == ${{ env.release_token }}" + env: + release_token: ${{ secrets.CAS_RELEASE_TOKEN }} + + regular-release: + needs: token-check + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + pip_tag: [ "", "onnx"] # default: "" = torch + engine_tag: ["", "cuda"] # default: "" = cpu + steps: + - uses: actions/checkout@v2 + - name: Set envs and versions + run: | + VCS_REF=${{ github.ref }} + echo "VCS_REF=$VCS_REF" >> $GITHUB_ENV + echo "Will build $VCS_REF" + echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV + echo "BUILD_TARGET=clip_executor" >> $GITHUB_ENV + + CAS_VERSION=$(sed -n '/^__version__/p' ./server/clip_server/__init__.py | cut -d \' -f2) + V_CAS_VERSION=v${CAS_VERSION} + CAS_MINOR_VERSION=${CAS_VERSION%.*} + CAS_MAJOR_VERSION=${CAS_MINOR_VERSION%.*} + + ENGINE_TAG=${{matrix.engine_tag}} + if [ -n "${ENGINE_TAG}" ]; then + ENGINE_TAG=-${ENGINE_TAG//./} + fi + + PIP_TAG=${{ matrix.pip_tag }} + if [ -n "${PIP_TAG}" ]; then + PIP_TAG=-${PIP_TAG} + fi + + if [[ "${{ github.event.inputs.triggered_by }}" == "CD" ]]; then + # on every CD release + echo "TAG_ALIAS=\ + jinaai/clip_executor:master${PIP_TAG}${ENGINE_TAG}" \ + >> $GITHUB_ENV + + elif [[ "${{ github.event.inputs.triggered_by }}" == "TAG" ]]; then + # on every tag release + echo "TAG_ALIAS=\ + jinaai/clip_executor:latest${PIP_TAG}${ENGINE_TAG}, \ + jinaai/clip_executor:${CAS_VERSION}${PIP_TAG}${ENGINE_TAG}, \ + jinaai/clip_executor:${CAS_MINOR_VERSION}${PIP_TAG}${ENGINE_TAG}, \ + jinaai/clip_executor:${CAS_MAJOR_VERSION}${PIP_TAG}${ENGINE_TAG} \ + " >> $GITHUB_ENV + + elif [[ "${{ github.event.inputs.triggered_by }}" == "MANUAL" ]]; then + # on every manual release + echo "TAG_ALIAS=\ + jinaai/clip_executor:${CAS_VERSION}${PIP_TAG}${ENGINE_TAG} \ + " >> $GITHUB_ENV + + else + echo "Bad triggered_by: ${{ github.event.inputs.triggered_by }}!" + exit 1 + fi + + echo "CAS_VERSION=${CAS_VERSION}" >> $GITHUB_ENV + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + with: + install: true + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_DEVBOT_USER }} + password: ${{ secrets.DOCKERHUB_DEVBOT_TOKEN }} + - run: | + # https://github.com/docker/buildx/issues/464#issuecomment-741507760 + # https://github.com/kubernetes-sigs/azuredisk-csi-driver/pull/808/files + docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-aarch64 + docker run --rm --privileged tonistiigi/binfmt --install all + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: Dockerfiles/base.Dockerfile + platforms: linux/amd64,linux/arm64 + push: false + tags: ${{env.TAG_ALIAS}} + build-args: | + BUILD_DATE=${{env.BUILD_DATE}} + CAS_VERSION=${{env.CAS_VERSION}} + VCS_REF=${{env.VCS_REF}} + PIP_TAG=${{matrix.pip_tag}} + target: ${{env.BUILD_TARGET}} \ No newline at end of file diff --git a/Dockerfiles/base.Dockerfile b/Dockerfiles/base.Dockerfile new file mode 100644 index 000000000..8ad9f87d7 --- /dev/null +++ b/Dockerfiles/base.Dockerfile @@ -0,0 +1,40 @@ +# !!! An ARG declared before a FROM is outside of a build stage, so it can’t be used in any instruction after a FROM +ARG JINA_VERSION=3.3.25 + +FROM jinaai/jina:${JINA_VERSION}-py38-standard + +ARG PIP_TAG + +# constant, wont invalidate cache +LABEL org.opencontainers.image.vendor="Jina AI Limited" \ + org.opencontainers.image.licenses="Apache 2.0" \ + org.opencontainers.image.title="Clip-As-Service" \ + org.opencontainers.image.description="Embed images and sentences into fixed-length vectors with CLIP" \ + org.opencontainers.image.authors="hello@jina.ai" \ + org.opencontainers.image.url="clip-as-service" \ + org.opencontainers.image.documentation="https://clip-as-service.jina.ai/" + +RUN pip3 install --no-cache-dir torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu + +# copy will almost always invalid the cache +COPY . /clip-as-service/ + +RUN echo '\ +jtype: CLIPEncoder\n\ +with:\n\ + name: ${{ env.MODEL_NAME }}\n\ + device: ${{ env.DEVICE }}\n\ + minibatch_size: ${{ env.MINIBATCH_SIZE }}\n\ +metas:\n\ + py_modules:\n\ + - server/clip_server/executors/clip_${{ env.ENGINE }}.py\n\ +' > /tmp/config.yml + +RUN cd /clip-as-service && \ + if [ -n "$PIP_TAG" ]; then pip3 install --no-cache-dir server/"[$PIP_TAG]" ; fi && \ + pip3 install --no-cache-dir "server/" + +WORKDIR /clip-as-service + + +ENTRYPOINT ["jina", "executor", "--uses", "/tmp/config.yml"] diff --git a/Dockerfiles/cuda.Dockerfile b/Dockerfiles/cuda.Dockerfile new file mode 100644 index 000000000..c0d5fa722 --- /dev/null +++ b/Dockerfiles/cuda.Dockerfile @@ -0,0 +1,42 @@ +ARG CUDA_VERSION=11.4.2 + +FROM nvcr.io/nvidia/cuda:${CUDA_VERSION}-cudnn8-runtime-ubuntu20.04 +ENV DEBIAN_FRONTEND=noninteractive + +ARG JINA_VERSION=3.3.25 +ARG PIP_TAG + +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3-setuptools python3-wheel python3-pip \ + && apt-get clean && rm -rf /var/lib/apt/lists/*; + +RUN python3 -m pip install --default-timeout=1000 --no-cache-dir torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113 +RUN python3 -m pip install --default-timeout=1000 --no-cache-dir "jina[standard]==${JINA_VERSION}" + +# copy will almost always invalid the cache +COPY . /clip-as-service/ + + +RUN echo '\ +jtype: CLIPEncoder\n\ +with:\n\ + name: ${{ env.MODEL_NAME }}\n\ + device: ${{ env.DEVICE }}\n\ + minibatch_size: ${{ env.MINIBATCH_SIZE }}\n\ +metas:\n\ + py_modules:\n\ + - server/clip_server/executors/clip_${{ env.ENGINE }}.py\n\ +' > /tmp/config.yml + +RUN cd /clip-as-service && \ + if [ -n "${PIP_TAG}" ]; then python3 -m pip install --no-cache-dir server/"[${PIP_TAG}]" ; fi && \ + python3 -m pip install --no-cache-dir "server/" + +WORKDIR /clip-as-service + +ENTRYPOINT ["jina", "executor", "--uses", "/tmp/config.yml"] + + + + + diff --git a/Dockerfiles/tensorrt.Dockerfile b/Dockerfiles/tensorrt.Dockerfile new file mode 100644 index 000000000..190ac9db1 --- /dev/null +++ b/Dockerfiles/tensorrt.Dockerfile @@ -0,0 +1,34 @@ +# Dockerfile to run Clip-as-Service with TensorRT, CUDA integration + +ARG TENSORRT_VERSION=22.04 + +FROM nvcr.io/nvidia/tensorrt:${TENSORRT_VERSION}-py3 + +ARG JINA_VERSION=3.3.25 +ARG PIP_VERSION + +RUN pip3 install --default-timeout=1000 --no-cache-dir torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113 +RUN pip3 -m pip install --default-timeout=1000 --no-cache-dir "jina[standard]==${JINA_VERSION}" + + +# copy will almost always invalid the cache +COPY . /clip-as-service/ + +RUN pip3 install --no-cache-dir "server/[tensorrt]" + +RUN echo '\ +jtype: CLIPEncoder\n\ +with:\n\ + name: ${{ env.MODEL_NAME }}\n\ + device: cuda\n\ + minibatch_size: ${{ env.MINIBATCH_SIZE }}\n\ +metas:\n\ + py_modules:\n\ + - server/clip_server/executors/clip_${{ env.ENGINE }}.py\n\ +' > /tmp/config.yml + + +WORKDIR /clip-as-service + +ENTRYPOINT ["jina", "executor", "--uses", "/tmp/config.yml"] + diff --git a/docs/user-guides/server.md b/docs/user-guides/server.md index 03ee3ef72..fd87bbdac 100644 --- a/docs/user-guides/server.md +++ b/docs/user-guides/server.md @@ -132,7 +132,7 @@ executors: jtype: CLIPEncoder metas: py_modules: - - executors/clip_trt.py + - executors/clip_tensorrt.py ``` ```` diff --git a/server/clip_server/executors/clip_trt.py b/server/clip_server/executors/clip_tensorrt.py similarity index 100% rename from server/clip_server/executors/clip_trt.py rename to server/clip_server/executors/clip_tensorrt.py diff --git a/server/clip_server/tensorrt-flow.yml b/server/clip_server/tensorrt-flow.yml index 3f37763e1..fb1910981 100644 --- a/server/clip_server/tensorrt-flow.yml +++ b/server/clip_server/tensorrt-flow.yml @@ -8,5 +8,5 @@ executors: jtype: CLIPEncoder metas: py_modules: - - executors/clip_trt.py + - executors/clip_tensorrt.py diff --git a/tests/conftest.py b/tests/conftest.py index 078d24985..b847b2789 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -39,7 +39,7 @@ def make_torch_flow(port_generator, request): @pytest.fixture(scope='session', params=['torch']) def make_trt_flow(port_generator, request): - from clip_server.executors.clip_trt import CLIPEncoder + from clip_server.executors.clip_tensorrt import CLIPEncoder f = Flow(port=port_generator()).add(name=request.param, uses=CLIPEncoder) with f: From 83eb9975bbb9a89fca9bfb1d2a0117d0ffff5003 Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 13:40:36 +0800 Subject: [PATCH 02/16] fix: turn on docker build action --- .github/workflows/force-docker-build.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index bcb6f88a2..293db72ee 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -1,15 +1,18 @@ name: Manual Docker Build on: - workflow_dispatch: - inputs: - release_token: - description: 'Your release token' - required: true - triggered_by: - description: 'CD | TAG | MANUAL' - required: false - default: MANUAL + pull_request: + +#on: +# workflow_dispatch: +# inputs: +# release_token: +# description: 'Your release token' +# required: true +# triggered_by: +# description: 'CD | TAG | MANUAL' +# required: false +# default: MANUAL jobs: token-check: From 80d8d6f91f0957dad7685ec96305338a356dffae Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 13:43:23 +0800 Subject: [PATCH 03/16] fix: docker push runner --- .github/workflows/force-docker-build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index 293db72ee..514a2732a 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -77,9 +77,15 @@ jobs: jinaai/clip_executor:${CAS_VERSION}${PIP_TAG}${ENGINE_TAG} \ " >> $GITHUB_ENV +# else +# echo "Bad triggered_by: ${{ github.event.inputs.triggered_by }}!" +# exit 1 else - echo "Bad triggered_by: ${{ github.event.inputs.triggered_by }}!" - exit 1 + # test + echo "Debugging Workflow!" + echo "TAG_ALIAS=\ + jinaai/clip_executor:${CAS_VERSION}${PIP_TAG}${ENGINE_TAG} \ + " >> $GITHUB_ENV fi echo "CAS_VERSION=${CAS_VERSION}" >> $GITHUB_ENV From c42241f852935dde7a9eed4b6091bb1c1588d5aa Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 13:43:56 +0800 Subject: [PATCH 04/16] fix: docker push runner --- .github/workflows/force-docker-build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index 514a2732a..466b58e75 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -76,10 +76,6 @@ jobs: echo "TAG_ALIAS=\ jinaai/clip_executor:${CAS_VERSION}${PIP_TAG}${ENGINE_TAG} \ " >> $GITHUB_ENV - -# else -# echo "Bad triggered_by: ${{ github.event.inputs.triggered_by }}!" -# exit 1 else # test echo "Debugging Workflow!" From 312bcb94981af5ae4a9f0f738a7bc26ed01ad0ef Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 13:45:27 +0800 Subject: [PATCH 05/16] fix: docker push runner --- .github/workflows/force-docker-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index 466b58e75..dce687bd4 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -114,4 +114,4 @@ jobs: CAS_VERSION=${{env.CAS_VERSION}} VCS_REF=${{env.VCS_REF}} PIP_TAG=${{matrix.pip_tag}} - target: ${{env.BUILD_TARGET}} \ No newline at end of file +# target: ${{env.BUILD_TARGET}} \ No newline at end of file From df53cf60aa3f419889154f5ad05ad9f63d661d19 Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 14:04:45 +0800 Subject: [PATCH 06/16] fix: test cuda dockerfile --- .github/workflows/force-docker-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index dce687bd4..02bc6f369 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -105,7 +105,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: Dockerfiles/base.Dockerfile + file: Dockerfiles/cuda.Dockerfile platforms: linux/amd64,linux/arm64 push: false tags: ${{env.TAG_ALIAS}} From a8f87da6897b6f1415a48682698ae883fa937fc5 Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 14:34:59 +0800 Subject: [PATCH 07/16] fix: test cuda dockerfile --- .github/workflows/force-docker-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index 02bc6f369..93fcaaffb 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -105,8 +105,8 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: Dockerfiles/cuda.Dockerfile - platforms: linux/amd64,linux/arm64 + file: Dockerfiles/base.Dockerfile + platforms: linux/amd64 push: false tags: ${{env.TAG_ALIAS}} build-args: | From 7400112c1a7c24cc7784e914bad880b93b8ece8d Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 14:50:30 +0800 Subject: [PATCH 08/16] fix: cuda --- .github/workflows/force-docker-build.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index 93fcaaffb..74fc91fd5 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -29,7 +29,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 @@ -101,8 +101,9 @@ jobs: # https://github.com/kubernetes-sigs/azuredisk-csi-driver/pull/808/files docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-aarch64 docker run --rm --privileged tonistiigi/binfmt --install all - - name: Build and push + - name: Build and push CPU images uses: docker/build-push-action@v2 + if: ${{ matrix.pip_tag }} != 'tensorrt' && ${{ matrix.engine_tag }} != 'cuda' with: context: . file: Dockerfiles/base.Dockerfile @@ -114,4 +115,16 @@ jobs: CAS_VERSION=${{env.CAS_VERSION}} VCS_REF=${{env.VCS_REF}} PIP_TAG=${{matrix.pip_tag}} -# target: ${{env.BUILD_TARGET}} \ No newline at end of file + - name: Build and push CUDA images + uses: docker/build-push-action@v2 + with: + context: . + file: Dockerfiles/cuda.Dockerfile + platforms: linux/amd64 + push: false + tags: ${{env.TAG_ALIAS}} + build-args: | + BUILD_DATE=${{env.BUILD_DATE}} + CAS_VERSION=${{env.CAS_VERSION}} + VCS_REF=${{env.VCS_REF}} + PIP_TAG=${{matrix.pip_tag}} From cd96b3fa16578e3bf8c8e1cf5f42cbd9c76ae74f Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 14:53:31 +0800 Subject: [PATCH 09/16] fix: cuda --- Dockerfiles/cuda.Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfiles/cuda.Dockerfile b/Dockerfiles/cuda.Dockerfile index c0d5fa722..c7265d045 100644 --- a/Dockerfiles/cuda.Dockerfile +++ b/Dockerfiles/cuda.Dockerfile @@ -13,6 +13,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN python3 -m pip install --default-timeout=1000 --no-cache-dir torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113 RUN python3 -m pip install --default-timeout=1000 --no-cache-dir "jina[standard]==${JINA_VERSION}" +RUN python3 -m pip install nvidia-pyindex + # copy will almost always invalid the cache COPY . /clip-as-service/ From bdaa6ee9e3914eacaaa08fdcd0748ee3a8c84206 Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 14:56:51 +0800 Subject: [PATCH 10/16] fix: cuda --- .github/workflows/force-docker-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index 74fc91fd5..688a09c2c 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -103,7 +103,7 @@ jobs: docker run --rm --privileged tonistiigi/binfmt --install all - name: Build and push CPU images uses: docker/build-push-action@v2 - if: ${{ matrix.pip_tag }} != 'tensorrt' && ${{ matrix.engine_tag }} != 'cuda' + if: ${{ matrix.pip_tag }} != 'tensorrt' && ${{ matrix.engine_tag }} == '' with: context: . file: Dockerfiles/base.Dockerfile From 023651050e62822fad4d2ce13e85e4753f09834e Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 15:02:21 +0800 Subject: [PATCH 11/16] fix: cuda --- .github/workflows/force-docker-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index 688a09c2c..b52093049 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -117,6 +117,7 @@ jobs: PIP_TAG=${{matrix.pip_tag}} - name: Build and push CUDA images uses: docker/build-push-action@v2 + if: ${{ matrix.engine_tag }} == 'cuda' with: context: . file: Dockerfiles/cuda.Dockerfile From 247791e4dfe85ee6ced57a3f25ad83af6b90dbd3 Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 15:03:00 +0800 Subject: [PATCH 12/16] fix: cuda --- .github/workflows/force-docker-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index b52093049..a8be745b0 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -101,7 +101,7 @@ jobs: # https://github.com/kubernetes-sigs/azuredisk-csi-driver/pull/808/files docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-aarch64 docker run --rm --privileged tonistiigi/binfmt --install all - - name: Build and push CPU images + - name: CPU Build and push uses: docker/build-push-action@v2 if: ${{ matrix.pip_tag }} != 'tensorrt' && ${{ matrix.engine_tag }} == '' with: @@ -115,7 +115,7 @@ jobs: CAS_VERSION=${{env.CAS_VERSION}} VCS_REF=${{env.VCS_REF}} PIP_TAG=${{matrix.pip_tag}} - - name: Build and push CUDA images + - name: CUDA Build and push uses: docker/build-push-action@v2 if: ${{ matrix.engine_tag }} == 'cuda' with: From 725ee8e6f150bba07c7294c4e1309ba1a06a1e61 Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 15:07:16 +0800 Subject: [PATCH 13/16] fix: cuda --- .github/workflows/force-docker-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index a8be745b0..4bebc2e27 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -103,7 +103,7 @@ jobs: docker run --rm --privileged tonistiigi/binfmt --install all - name: CPU Build and push uses: docker/build-push-action@v2 - if: ${{ matrix.pip_tag }} != 'tensorrt' && ${{ matrix.engine_tag }} == '' + if: ${{ matrix.pip_tag != tensorrt }} && ${{ matrix.engine_tag }} == '' with: context: . file: Dockerfiles/base.Dockerfile From 929147321d830268d3b3b53dfed2f6f92276af6f Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 15:08:47 +0800 Subject: [PATCH 14/16] fix: cuda --- .github/workflows/force-docker-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index 4bebc2e27..1a76dc8f4 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -103,7 +103,7 @@ jobs: docker run --rm --privileged tonistiigi/binfmt --install all - name: CPU Build and push uses: docker/build-push-action@v2 - if: ${{ matrix.pip_tag != tensorrt }} && ${{ matrix.engine_tag }} == '' + if: ${{ matrix.pip_tag != 'tensorrt' }} && ${{ matrix.engine_tag }} == '' with: context: . file: Dockerfiles/base.Dockerfile From 0f2836f6f0e6233ab959db82a21769ccc23703da Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 15:22:25 +0800 Subject: [PATCH 15/16] fix: cuda --- .github/workflows/force-docker-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index 1a76dc8f4..5b2bf2c3e 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -29,7 +29,7 @@ jobs: strategy: fail-fast: false matrix: - pip_tag: [ "", "onnx", "tensorrt"] # default: "" = torch + pip_tag: [ "", "onnx"] # default: "" = torch engine_tag: ["", "cuda"] # default: "" = cpu steps: - uses: actions/checkout@v2 @@ -103,7 +103,7 @@ jobs: docker run --rm --privileged tonistiigi/binfmt --install all - name: CPU Build and push uses: docker/build-push-action@v2 - if: ${{ matrix.pip_tag != 'tensorrt' }} && ${{ matrix.engine_tag }} == '' + if: ${{ matrix.engine_tag }} == '' with: context: . file: Dockerfiles/base.Dockerfile From a00661dc7e407a91e281d54049e7bf9e853fceca Mon Sep 17 00:00:00 2001 From: numb3r3 Date: Wed, 11 May 2022 15:31:32 +0800 Subject: [PATCH 16/16] fix: update runner --- .github/workflows/force-docker-build.yml | 25 +++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/force-docker-build.yml b/.github/workflows/force-docker-build.yml index 5b2bf2c3e..6ec6e3105 100644 --- a/.github/workflows/force-docker-build.yml +++ b/.github/workflows/force-docker-build.yml @@ -1,18 +1,15 @@ name: Manual Docker Build on: - pull_request: - -#on: -# workflow_dispatch: -# inputs: -# release_token: -# description: 'Your release token' -# required: true -# triggered_by: -# description: 'CD | TAG | MANUAL' -# required: false -# default: MANUAL + workflow_dispatch: + inputs: + release_token: + description: 'Your release token' + required: true + triggered_by: + description: 'CD | TAG | MANUAL' + required: false + default: MANUAL jobs: token-check: @@ -108,7 +105,7 @@ jobs: context: . file: Dockerfiles/base.Dockerfile platforms: linux/amd64 - push: false + push: true tags: ${{env.TAG_ALIAS}} build-args: | BUILD_DATE=${{env.BUILD_DATE}} @@ -122,7 +119,7 @@ jobs: context: . file: Dockerfiles/cuda.Dockerfile platforms: linux/amd64 - push: false + push: true tags: ${{env.TAG_ALIAS}} build-args: | BUILD_DATE=${{env.BUILD_DATE}}