From f93e038fbe8520f09821935ec81b61b634e79d6e Mon Sep 17 00:00:00 2001 From: Sivanantham Chinnaiyan Date: Sun, 11 Feb 2024 16:14:13 +0530 Subject: [PATCH] Change artifact upload/download action Signed-off-by: Sivanantham Chinnaiyan --- .github/actions/base-download/action.yml | 47 +-- .github/workflows/e2e-test.yml | 281 ++++++++++++------ .../gh-actions/build-graph-tests-images.sh | 9 +- test/scripts/gh-actions/build-images.sh | 18 +- .../gh-actions/build-server-runtimes.sh | 48 ++- 5 files changed, 247 insertions(+), 156 deletions(-) diff --git a/.github/actions/base-download/action.yml b/.github/actions/base-download/action.yml index ce9a7d189cd..9d6feac6df0 100644 --- a/.github/actions/base-download/action.yml +++ b/.github/actions/base-download/action.yml @@ -4,23 +4,34 @@ description: 'A wrapper around download docker artifact to download a set of bas runs: using: "composite" steps: - - - name: Download controller image - uses: ishworkh/docker-image-artifact-download@v1 - with: - image: "kserve/kserve-controller:${{ github.sha }}" - - - name: Download agent image - uses: ishworkh/docker-image-artifact-download@v1 + - name: Download base artifacts + uses: actions/download-artifact@v4 with: - image: "kserve/agent:${{ github.sha }}" - - - name: Download storage initializer image - uses: ishworkh/docker-image-artifact-download@v1 - with: - image: "kserve/storage-initializer:${{ github.sha }}" + path: ./tmp + pattern: ${{ env.BASE_ARTIFACT_PREFIX }}-* + merge-multiple: ture +# +# - name: Load base images +# run: | +# pushd ./tmp >> /dev/null +# docker image load -i sflj - - name: Download router image - uses: ishworkh/docker-image-artifact-download@v1 - with: - image: "kserve/router:${{ github.sha }}" +# - name: Download controller image +# uses: ishworkh/docker-image-artifact-download@v1 +# with: +# image: "kserve/kserve-controller:${{ github.sha }}" +# +# - name: Download agent image +# uses: ishworkh/docker-image-artifact-download@v1 +# with: +# image: "kserve/agent:${{ github.sha }}" +# +# - name: Download storage initializer image +# uses: ishworkh/docker-image-artifact-download@v1 +# with: +# image: "kserve/storage-initializer:${{ github.sha }}" +# +# - name: Download router image +# uses: ishworkh/docker-image-artifact-download@v1 +# with: +# image: "kserve/router:${{ github.sha }}" diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 7e736f5409b..c14386c1016 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -13,6 +13,35 @@ on: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCKER_IMAGES_PATH: /mnt/docker-images + DOCKER_REPO: kserve + PREDICTOR_ARTIFACT_PREFIX: pred + EXPLAINER_ARTIFACT_PREFIX: exp + TRANSFORMER_ARTIFACT_PREFIX: trans + GRAPH_ARTIFACTI_PREFIX: graph + BASE_ARTIFACT_PREFIX: base + # Controller images + CONTROLLER_IMG: kserve-controller:${{ env.GITHUB_SHA }} + STORAGE_INIT_IMG: storage-initializer:${{ env.GITHUB_SHA }} + AGENT_IMG: agent:${{ env.GITHUB_SHA }} + ROUTER_IMG: router:${{ env.GITHUB_SHA }} + # Predictor runtime server images + SKLEARN_IMG: sklearnserver:${{ env.GITHUB_SHA }} + XGB_IMG: xgbserver:${{ env.GITHUB_SHA }} + LGB_IMG: lgbserver:${{ env.GITHUB_SHA }} + PMML_IMG: pmmlserver:${{ env.GITHUB_SHA }} + PADDLE_IMG: paddleserver:${{ env.GITHUB_SHA }} + CUSTOM_MODEL_GRPC_IMG: custom-model-grpc:${{ env.GITHUB_SHA }} + # Explainer images + ALIBI_IMG: alibi-explainer:${{ env.GITHUB_SHA }} + ART_IMG: art-explainer:${{ env.GITHUB_SHA }} + # Transformer images + IMAGE_TRANSFORMER_IMG: image-transformer:${{ env.GITHUB_SHA }} + CUSTOM_TRANSFORMER_GRPC_IMG: custom-image-transformer-grpc:${{ env.GITHUB_SHA }} + # Graph images + SUCCESS_200_ISVC_IMG: success-200-isvc:${{ env.GITHUB_SHA }} + ERROR_404_ISVC_IMG: error-404-isvc:${{ env.GITHUB_SHA }} + concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -26,29 +55,38 @@ jobs: - name: Build KServe images run: | + sudo mkdir -p ${DOCKER_IMAGES_PATH} ./test/scripts/gh-actions/build-images.sh docker image ls - cat ./config/overlays/test/configmap/inferenceservice.yaml + sudo ls -l ${DOCKER_IMAGES_PATH} - name: Upload controller image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/kserve-controller:${{ github.sha }}" + name: ${{ env.BASE_ARTIFACT_PREFIX }}-${{ env.CONTROLLER_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.CONTROLLER_IMG }} + compression-level: 0 - name: Upload agent image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/agent:${{ github.sha }}" + name: ${{ env.BASE_ARTIFACT_PREFIX }}-${{ env.AGENT_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.AGENT_IMG }} + compression-level: 0 - name: Upload storage initializer image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/storage-initializer:${{ github.sha }}" + name: ${{ env.BASE_ARTIFACT_PREFIX }}-${{ env.STORAGE_INIT_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.STORAGE_INIT_IMG }} + compression-level: 0 - name: Upload router image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/router:${{ github.sha }}" + name: ${{ env.BASE_ARTIFACT_PREFIX }}-${{ env.ROUTER_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.ROUTER_IMG }} + compression-level: 0 poetry-check: runs-on: ubuntu-latest @@ -76,49 +114,68 @@ jobs: - name: Build runtime server images run: | + sudo mkdir -p ${DOCKER_IMAGES_PATH} +# sudo chown -R $USER ${DOCKER_IMAGES_PATH} ./test/scripts/gh-actions/build-server-runtimes.sh predictor,transformer docker image ls - cat ./config/overlays/test/configmap/inferenceservice.yaml + sudo ls -l /mnt + sudo ls -l ${DOCKER_IMAGES_PATH} - - name: Upload sklearn server image - uses: ishworkh/docker-image-artifact-upload@v1 + - name: Upload sklearn artifact + uses: actions/upload-artifact@v4 with: - image: "kserve/sklearnserver:${{ github.sha }}" + name: ${{ env.PREDICTOR_ARTIFACT_PREFIX }}-${{ env.SKLEARN_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.SKLEARN_IMG }} + compression-level: 0 - name: Upload xgb server image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/xgbserver:${{ github.sha }}" + name: ${{ env.PREDICTOR_ARTIFACT_PREFIX }}-${{ env.XGB_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.XGB_IMG }} + compression-level: 0 - name: Upload lgb server image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/lgbserver:${{ github.sha }}" + name: ${{ env.PREDICTOR_ARTIFACT_PREFIX }}-${{ env.LGB_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.LGB_IMG }} + compression-level: 0 - name: Upload pmml server image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/pmmlserver:${{ github.sha }}" + name: ${{ env.PREDICTOR_ARTIFACT_PREFIX }}-${{ env.PMML_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.PMML_IMG }} + compression-level: 0 - name: Upload paddle image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/paddleserver:${{ github.sha }}" + name: ${{ env.PREDICTOR_ARTIFACT_PREFIX }}-${{ env.PADDLE_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.PADDLE_IMG }} + compression-level: 0 - name: Upload image transformer image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/image-transformer:${{ github.sha }}" + name: ${{ env.TRANSFORMER_ARTIFACT_PREFIX }}-${{ env.IMAGE_TRANSFORMER_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.IMAGE_TRANSFORMER_IMG }} + compression-level: 0 - name: Upload custom model grpc image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/custom-model-grpc:${{ github.sha }}" + name: ${{ env.PREDICTOR_ARTIFACT_PREFIX }}-${{ env.CUSTOM_MODEL_GRPC_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.CUSTOM_MODEL_GRPC_IMG }} + compression-level: 0 - name: Upload custom model transformer grpc image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/custom-image-transformer-grpc:${{ github.sha }}" + name: ${{ env.TRANSFORMER_ARTIFACT_PREFIX }}-${{ env.CUSTOM_TRANSFORMER_GRPC_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.CUSTOM_TRANSFORMER_GRPC_IMG }} + compression-level: 0 explainer-runtime-build: runs-on: ubuntu-latest @@ -128,19 +185,24 @@ jobs: - name: Build runtime server images run: | + sudo mkdir -p ${DOCKER_IMAGES_PATH} ./test/scripts/gh-actions/build-server-runtimes.sh explainer docker image ls - cat ./config/overlays/test/configmap/inferenceservice.yaml + sudo ls -l ${DOCKER_IMAGES_PATH} - name: Upload alibi image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/alibi-explainer:${{ github.sha }}" + name: ${{ env.EXPLAINER_ARTIFACT_PREFIX }}-${{ env.ALIBI_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.ALIBI_IMG }} + compression-level: 0 - name: Upload art explainer image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/art-explainer:${{ github.sha }}" + name: ${{ env.EXPLAINER_ARTIFACT_PREFIX }}-${{ env.ART_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.ART_IMG }} + compression-level: 0 graph-tests-images-build: runs-on: ubuntu-latest @@ -153,18 +215,24 @@ jobs: - name: Build test images needed for graph tests run: | + sudo mkdir -p ${DOCKER_IMAGES_PATH} ./test/scripts/gh-actions/build-graph-tests-images.sh docker image ls + sudo ls -l ${DOCKER_IMAGES_PATH} - name: Upload success_200_isvc predictor image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/success-200-isvc:${{ github.sha }}" + name: ${{ env.GRAPH_ARTIFACT_PREFIX }}-${{ env.SUCCESS_200_ISVC_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.SUCCESS_200_ISVC_IMG }} + compression-level: 0 - name: Upload error_404_isvc predictor image - uses: ishworkh/docker-image-artifact-upload@v1 + uses: actions/upload-artifact@v4 with: - image: "kserve/error-404-isvc:${{ github.sha }}" + name: ${{ env.GRAPH_ARTIFACT_PREFIX }}-${{ env.ERROR_404_ISVC_IMG }} + path: ${{ env.DOCKER_IMAGES_PATH }}/${{ env.ERROR_404_ISVC_IMG }} + compression-level: 0 test-fast: runs-on: ubuntu-latest @@ -199,35 +267,43 @@ jobs: - name: KServe dependency setup uses: ./.github/actions/kserve-dep-setup - - name: Download sklearn server image - uses: ishworkh/docker-image-artifact-download@v1 - with: - image: "kserve/sklearnserver:${{ github.sha }}" - - - name: Download xgb server image - uses: ishworkh/docker-image-artifact-download@v1 - with: - image: "kserve/xgbserver:${{ github.sha }}" - - - name: Download lgb server image - uses: ishworkh/docker-image-artifact-download@v1 - with: - image: "kserve/lgbserver:${{ github.sha }}" - - - name: Download pmml image - uses: ishworkh/docker-image-artifact-download@v1 - with: - image: "kserve/pmmlserver:${{ github.sha }}" - - - name: Download paddle image - uses: ishworkh/docker-image-artifact-download@v1 - with: - image: "kserve/paddleserver:${{ github.sha }}" - - - name: Download custom model grpc image - uses: ishworkh/docker-image-artifact-download@v1 - with: - image: "kserve/custom-model-grpc:${{ github.sha }}" + - name: Download predictor artifacts + uses: actions/download-artifact@v4 + with: + path: ./tmp + pattern: ${{ env.PREDICTOR_ARTIFACT_PREFIX }}-* + merge-multiple: true + + + # - name: Download sklearn server image +# uses: ishworkh/container-image-artifact-download@v1.0.0 +# with: +# image: "kserve/sklearnserver:${{ github.sha }}" +# +# - name: Download xgb server image +# uses: ishworkh/container-image-artifact-download@v1.0.0 +# with: +# image: "kserve/xgbserver:${{ github.sha }}" +# +# - name: Download lgb server image +# uses: ishworkh/container-image-artifact-download@v1.0.0 +# with: +# image: "kserve/lgbserver:${{ github.sha }}" +# +# - name: Download pmml image +# uses: ishworkh/container-image-artifact-download@v1.0.0 +# with: +# image: "kserve/pmmlserver:${{ github.sha }}" +# +# - name: Download paddle image +# uses: ishworkh/container-image-artifact-download@v1.0.0 +# with: +# image: "kserve/paddleserver:${{ github.sha }}" +# +# - name: Download custom model grpc image +# uses: ishworkh/container-image-artifact-download@v1.0.0 +# with: +# image: "kserve/custom-model-grpc:${{ github.sha }}" - name: Install Poetry and version plugin run: ./test/scripts/gh-actions/setup-poetry.sh @@ -267,41 +343,48 @@ jobs: - uses: ./.github/actions/kserve-dep-setup - uses: ./.github/actions/base-download + - name: Download transformer and explainer artifacts + uses: actions/download-artifact@v4 + with: + path: ./tmp + pattern: ${{ env.TRANSFORMER_ARTIFACT_PREFIX }}-*|${{ env.EXPLAINER_ARTIFACT_PREFIX }}-* + merge-multiple: true + - name: Download sklearn server image - uses: ishworkh/docker-image-artifact-download@v1 + uses: actions/download-artifact@v4 with: - image: "kserve/sklearnserver:${{ github.sha }}" + name: ${{ env.PREDICTOR_ARTIFACT_PREFIX }}-${{ env.SKLEARN_IMG }} + path: ./tmp - name: Download custom model grpc image uses: ishworkh/docker-image-artifact-download@v1 with: image: "kserve/custom-model-grpc:${{ github.sha }}" - - name: Download transformer image - uses: ishworkh/docker-image-artifact-download@v1 - with: - image: "kserve/image-transformer:${{ github.sha }}" - - - name: Download custom transformer grpc image - uses: ishworkh/docker-image-artifact-download@v1 - with: - image: "kserve/custom-image-transformer-grpc:${{ github.sha }}" - +# - name: Download transformer image +# uses: ishworkh/container-image-artifact-download@v1.0.0 +# with: +# image: "kserve/image-transformer:${{ github.sha }}" +# +# - name: Download custom transformer grpc image +# uses: ishworkh/container-image-artifact-download@v1.0.0 +# with: +# image: "kserve/custom-image-transformer-grpc:${{ github.sha }}" - name: Download xgb server image - uses: ishworkh/docker-image-artifact-download@v1 + uses: ishworkh/container-image-artifact-download@v1.0.0 with: image: "kserve/xgbserver:${{ github.sha }}" - - name: Download alibi image - uses: ishworkh/docker-image-artifact-download@v1 - with: - image: "kserve/alibi-explainer:${{ github.sha }}" - - - name: Download art explainer image - uses: ishworkh/docker-image-artifact-download@v1 - with: - image: "kserve/art-explainer:${{ github.sha }}" +# - name: Download alibi image +# uses: ishworkh/container-image-artifact-download@v1.0.0 +# with: +# image: "kserve/alibi-explainer:${{ github.sha }}" +# +# - name: Download art explainer image +# uses: ishworkh/container-image-artifact-download@v1.0.0 +# with: +# image: "kserve/art-explainer:${{ github.sha }}" - name: Install Poetry and version plugin run: ./test/scripts/gh-actions/setup-poetry.sh @@ -358,7 +441,7 @@ jobs: uses: ./.github/actions/kserve-dep-setup - name: Download sklearn server image - uses: ishworkh/docker-image-artifact-download@v1 + uses: ishworkh/container-image-artifact-download@v1.0.0 with: image: "kserve/sklearnserver:${{ github.sha }}" @@ -368,12 +451,12 @@ jobs: image: "kserve/xgbserver:${{ github.sha }}" - name: Download success_200_isvc predictor image - uses: ishworkh/docker-image-artifact-download@v1 + uses: ishworkh/container-image-artifact-download@v1.0.0 with: image: "kserve/success-200-isvc:${{ github.sha }}" - name: Download error_404_isvc predictor image - uses: ishworkh/docker-image-artifact-download@v1 + uses: ishworkh/container-image-artifact-download@v1.0.0 with: image: "kserve/error-404-isvc:${{ github.sha }}" @@ -434,12 +517,12 @@ jobs: uses: ./.github/actions/kserve-dep-setup - name: Download sklearn server image - uses: ishworkh/docker-image-artifact-download@v1 + uses: ishworkh/container-image-artifact-download@v1.0.0 with: image: "kserve/sklearnserver:${{ github.sha }}" - name: Download xgb server image - uses: ishworkh/docker-image-artifact-download@v1 + uses: ishworkh/container-image-artifact-download@v1.0.0 with: image: "kserve/xgbserver:${{ github.sha }}" @@ -498,7 +581,7 @@ jobs: ./test/scripts/gh-actions/build-qpext-image.sh docker image ls - name: Download sklearn server image - uses: ishworkh/docker-image-artifact-download@v1 + uses: ishworkh/container-image-artifact-download@v1.0.0 with: image: "kserve/sklearnserver:${{ github.sha }}" - name: Install Poetry and version plugin @@ -580,12 +663,12 @@ jobs: - uses: ./.github/actions/base-download - name: Download sklearn server image - uses: ishworkh/docker-image-artifact-download@v1 + uses: ishworkh/container-image-artifact-download@v1.0.0 with: image: "kserve/sklearnserver:${{ github.sha }}" - name: Download transformer image - uses: ishworkh/docker-image-artifact-download@v1 + uses: ishworkh/container-image-artifact-download@v1.0.0 with: image: "kserve/image-transformer:${{ github.sha }}" @@ -635,22 +718,22 @@ jobs: - uses: ./.github/actions/base-download - name: Download sklearn server image - uses: ishworkh/docker-image-artifact-download@v1 + uses: ishworkh/container-image-artifact-download@v1.0.0 with: image: "kserve/sklearnserver:${{ github.sha }}" - name: Download xgb server image - uses: ishworkh/docker-image-artifact-download@v1 + uses: ishworkh/container-image-artifact-download@v1.0.0 with: image: "kserve/xgbserver:${{ github.sha }}" - name: Download success_200_isvc predictor image - uses: ishworkh/docker-image-artifact-download@v1 + uses: ishworkh/container-image-artifact-download@v1.0.0 with: image: "kserve/success-200-isvc:${{ github.sha }}" - name: Download error_404_isvc predictor image - uses: ishworkh/docker-image-artifact-download@v1 + uses: ishworkh/container-image-artifact-download@v1.0.0 with: image: "kserve/error-404-isvc:${{ github.sha }}" diff --git a/test/scripts/gh-actions/build-graph-tests-images.sh b/test/scripts/gh-actions/build-graph-tests-images.sh index 3660f6187b6..11caba27fb5 100755 --- a/test/scripts/gh-actions/build-graph-tests-images.sh +++ b/test/scripts/gh-actions/build-graph-tests-images.sh @@ -19,16 +19,17 @@ set -o errexit set -o nounset set -o pipefail + echo "Github SHA ${GITHUB_SHA}" -export SUCCESS_200_ISVC_IMG=kserve/success-200-isvc:${GITHUB_SHA} -export ERROR_404_ISVC_IMG=kserve/error-404-isvc:${GITHUB_SHA} pushd python >/dev/null echo "Building success_200_isvc image" -docker buildx build -t ${SUCCESS_200_ISVC_IMG} -f success_200_isvc.Dockerfile . +docker buildx build -t "${DOCKER_REPO}/${SUCCESS_200_ISVC_IMG}" -f success_200_isvc.Dockerfile . +docker image save -o "${DOCKER_IMAGE_DIR}/${SUCCESS_200_ISVC_IMG}" "${DOCKER_REPO}/${SUCCESS_200_ISVC_IMG}" echo "Done building success_200_isvc image" echo "Building error_404_isvc image" -docker buildx build -t ${ERROR_404_ISVC_IMG} -f error_404_isvc.Dockerfile . +docker buildx build -t "${DOCKER_REPO}/${ERROR_404_ISVC_IMG}" -f error_404_isvc.Dockerfile . +docker image save -o "${DOCKER_IMAGE_DIR}/${ERROR_404_ISVC_IMG}" "${DOCKER_REPO}/${ERROR_404_ISVC_IMG}" echo "Done building error_404_isvc image" popd echo "Done building images" diff --git a/test/scripts/gh-actions/build-images.sh b/test/scripts/gh-actions/build-images.sh index d43f802fa78..28e97e5b573 100755 --- a/test/scripts/gh-actions/build-images.sh +++ b/test/scripts/gh-actions/build-images.sh @@ -21,25 +21,25 @@ set -o errexit set -o nounset set -o pipefail -echo "Github SHA ${GITHUB_SHA}" -export CONTROLLER_IMG=kserve/kserve-controller:${GITHUB_SHA} -STORAGE_INIT_IMG=kserve/storage-initializer:${GITHUB_SHA} -AGENT_IMG=kserve/agent:${GITHUB_SHA} -ROUTER_IMG=kserve/router:${GITHUB_SHA} +echo "Github SHA ${GITHUB_SHA}" echo "Building Kserve controller image" -docker buildx build . -t ${CONTROLLER_IMG} +docker buildx build . -t "${DOCKER_REPO}/${CONTROLLER_IMG}" +docker image save -o "${DOCKER_IMAGES_PATH}/${CONTROLLER_IMG}" "${DOCKER_REPO}/${CONTROLLER_IMG}" echo "Building agent image" -docker buildx build -f agent.Dockerfile . -t ${AGENT_IMG} +docker buildx build -f agent.Dockerfile . -t "${DOCKER_REPO}/${AGENT_IMG}" +docker image save -o "${DOCKER_IMAGES_PATH}/${AGENT_IMG}" "${DOCKER_REPO}/${AGENT_IMG}" echo "Building router image" -docker buildx build -f router.Dockerfile . -t ${ROUTER_IMG} +docker buildx build -f router.Dockerfile . -t "${DOCKER_REPO}/${ROUTER_IMG}" +docker image save -o "${DOCKER_IMAGES_PATH}/${ROUTER_IMG}" "${DOCKER_REPO}/${ROUTER_IMG}" pushd python >/dev/null echo "Building storage initializer" - docker buildx build -t ${STORAGE_INIT_IMG} -f storage-initializer.Dockerfile . + docker buildx build -t "${DOCKER_REPO}/${STORAGE_INIT_IMG}" -f storage-initializer.Dockerfile . + docker image save -o "${DOCKER_IMAGES_PATH}/${STORAGE_INIT_IMG}" "${DOCKER_REPO}/${STORAGE_INIT_IMG}" popd echo "Done building images" diff --git a/test/scripts/gh-actions/build-server-runtimes.sh b/test/scripts/gh-actions/build-server-runtimes.sh index 2be98aa02e7..bbcc8b4aa57 100755 --- a/test/scripts/gh-actions/build-server-runtimes.sh +++ b/test/scripts/gh-actions/build-server-runtimes.sh @@ -21,53 +21,49 @@ set -o errexit set -o nounset set -o pipefail -echo "Github SHA ${GITHUB_SHA}" IFS=, -types=($1) - -# Predictor runtime server images -SKLEARN_IMG=kserve/sklearnserver:${GITHUB_SHA} -XGB_IMG=kserve/xgbserver:${GITHUB_SHA} -LGB_IMG=kserve/lgbserver:${GITHUB_SHA} -PMML_IMG=kserve/pmmlserver:${GITHUB_SHA} -PADDLE_IMG=kserve/paddleserver:${GITHUB_SHA} -CUSTOM_MODEL_GRPC=kserve/custom-model-grpc:${GITHUB_SHA} -CUSTOM_TRANSFORMER_GRPC=kserve/custom-image-transformer-grpc:${GITHUB_SHA} -# Explainer images -ALIBI_IMG=kserve/alibi-explainer:${GITHUB_SHA} -ART_IMG=kserve/art-explainer:${GITHUB_SHA} -# Transformer images -IMAGE_TRANSFORMER_IMG=kserve/image-transformer:${GITHUB_SHA} +echo "Github SHA ${GITHUB_SHA}" +types=("$1") pushd python >/dev/null if [[ " ${types[*]} " =~ "predictor" ]]; then echo "Building Sklearn image" - docker buildx build -t ${SKLEARN_IMG} -f sklearn.Dockerfile . + docker buildx build -t "${DOCKER_REPO}/${SKLEARN_IMG}" -f sklearn.Dockerfile . + docker image save -o "${DOCKER_IMAGE_DIR}/${SKLEARN_IMG}" "${DOCKER_REPO}/${SKLEARN_IMG}" echo "Building XGB image" - docker buildx build -t ${XGB_IMG} -f xgb.Dockerfile . + docker buildx build -t "${DOCKER_REPO}/${XGB_IMG}" -f xgb.Dockerfile . + docker image save -o "${DOCKER_IMAGE_DIR}/${XGB_IMG}" "${DOCKER_REPO}/${XGB_IMG}" echo "Building LGB image" - docker buildx build -t ${LGB_IMG} -f lgb.Dockerfile . + docker buildx build -t "${DOCKER_REPO}/${LGB_IMG}" -f lgb.Dockerfile . + docker image save -o "${DOCKER_IMAGE_DIR}/${LGB_IMG}" "${DOCKER_REPO}/${LGB_IMG}" echo "Building PMML image" - docker buildx build -t ${PMML_IMG} -f pmml.Dockerfile . + docker buildx build -t "${DOCKER_REPO}/${PMML_IMG}" -f pmml.Dockerfile . + docker image save -o "${DOCKER_IMAGE_DIR}/${PMML_IMG}" "${DOCKER_REPO}/${PMML_IMG}" echo "Building Paddle image" - docker buildx build -t ${PADDLE_IMG} -f paddle.Dockerfile . + docker buildx build -t "${DOCKER_REPO}/${PADDLE_IMG}" -f paddle.Dockerfile . + docker image save -o "${DOCKER_IMAGE_DIR}/${PADDLE_IMG}" "${DOCKER_REPO}/${PADDLE_IMG}" echo "Building Custom model gRPC image" - docker buildx build -t ${CUSTOM_MODEL_GRPC} -f custom_model_grpc.Dockerfile . + docker buildx build -t "${DOCKER_REPO}/${CUSTOM_MODEL_GRPC_IMG}" -f custom_model_grpc.Dockerfile . + docker image save -o "${DOCKER_IMAGE_DIR}/${CUSTOM_MODEL_GRPC_IMG}" "${DOCKER_REPO}/${CUSTOM_MODEL_GRPC_IMG}" echo "Building image transformer gRPC image" - docker buildx build -t ${CUSTOM_TRANSFORMER_GRPC} -f custom_transformer_grpc.Dockerfile . + docker buildx build -t "${DOCKER_REPO}/${CUSTOM_TRANSFORMER_GRPC_IMG}" -f custom_transformer_grpc.Dockerfile . + docker image save -o "${DOCKER_IMAGE_DIR}/${CUSTOM_TRANSFORMER_GRPC_IMG}" "${DOCKER_REPO}/${CUSTOM_TRANSFORMER_GRPC_IMG}" fi if [[ " ${types[*]} " =~ "explainer" ]]; then echo "Building Alibi image" - docker buildx build -t ${ALIBI_IMG} -f alibiexplainer.Dockerfile . + docker buildx build -t "${DOCKER_REPO}/${ALIBI_IMG}" -f alibiexplainer.Dockerfile . + docker save -o "${DOCKER_IMAGE_DIR}/${ALIBI_IMG}" "${DOCKER_REPO}/${ALIBI_IMG}" echo "Building ART explainer image" - docker buildx build -t ${ART_IMG} -f artexplainer.Dockerfile . + docker buildx build -t "${DOCKER_REPO}/${ART_IMG}" -f artexplainer.Dockerfile . + docker save -o "${DOCKER_IMAGE_DIR}/${ART_IMG}" "${DOCKER_REPO}/${ART_IMG}" fi if [[ " ${types[*]} " =~ "transformer" ]]; then echo "Building Image transformer image" - docker buildx build -t ${IMAGE_TRANSFORMER_IMG} -f custom_transformer.Dockerfile . + docker buildx build -t "${DOCKER_REPO}/${IMAGE_TRANSFORMER_IMG}" -f custom_transformer.Dockerfile . + docker save -o "${DOCKER_IMAGE_DIR}/${IMAGE_TRANSFORMER_IMG}" "${DOCKER_REPO}/${IMAGE_TRANSFORMER_IMG}" fi popd