From 9592b3bf0acdd24dc36a457cb26d89175b741fcd Mon Sep 17 00:00:00 2001 From: Cheng8994 <93339318+Cheng8994@users.noreply.github.com> Date: Sun, 15 May 2022 04:04:12 +0800 Subject: [PATCH] Add aix-explainer deploy command (#2174) * Add aix-explainer deploy command Signed-off-by: Cheng8994 * Add aix-explainer deploy command Signed-off-by: Cheng8994 --- Makefile | 11 +++++++++++ hack/aix_patch_dev.sh | 23 +++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 hack/aix_patch_dev.sh diff --git a/Makefile b/Makefile index 905db2bffde..46ec457c210 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ PYTORCH_IMG ?= pytorchserver PMML_IMG ?= pmmlserver PADDLE_IMG ?= paddleserver ALIBI_IMG ?= alibi-explainer +AIX_IMG ?= aix-explainer STORAGE_INIT_IMG ?= storage-initializer CRD_OPTIONS ?= "crd:maxDescLen=0" KSERVE_ENABLE_SELF_SIGNED_CA ?= false @@ -89,6 +90,10 @@ deploy-dev-alibi: docker-push-alibi ./hack/alibi_patch_dev.sh ${KO_DOCKER_REPO}/${ALIBI_IMG} kustomize build config/overlays/dev-image-config | kubectl apply -f - +deploy-dev-aix: docker-push-aix + ./hack/aix_patch_dev.sh ${KO_DOCKER_REPO}/${AIX_IMG} + kustomize build config/overlays/dev-image-config | kubectl apply -f - + deploy-dev-storageInitializer: docker-push-storageInitializer ./hack/storageInitializer_patch_dev.sh ${KO_DOCKER_REPO}/${STORAGE_INIT_IMG} kustomize build config/overlays/dev-image-config | kubectl apply -f - @@ -228,6 +233,12 @@ docker-build-alibi: docker-push-alibi: docker-build-alibi docker push ${KO_DOCKER_REPO}/${ALIBI_IMG} +docker-build-aix: + cd python && docker build -t ${KO_DOCKER_REPO}/${AIX_IMG} -f aixexplainer.Dockerfile . + +docker-push-aix: docker-build-aix + docker push ${KO_DOCKER_REPO}/${AIX_IMG} + docker-build-storageInitializer: cd python && docker build -t ${KO_DOCKER_REPO}/${STORAGE_INIT_IMG} -f storage-initializer.Dockerfile . diff --git a/hack/aix_patch_dev.sh b/hack/aix_patch_dev.sh new file mode 100644 index 00000000000..abf50d235a1 --- /dev/null +++ b/hack/aix_patch_dev.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Usage: image_patch_dev.sh [OVERLAY] +set -u +IMG=$1 +if [ -z ${IMG} ]; then exit; fi +cat > config/overlays/dev-image-config/inferenceservice_patch.yaml << EOF +apiVersion: v1 +kind: ConfigMap +metadata: + name: inferenceservice-config + namespace: kserve +data: + explainers: |- + { + "aix": { + "image" : "${IMG}", + "defaultImageVersion": "latest", + "allowedImageVersions": [ + "latest" + ] + } + } +EOF