From 53de7898f7ec9fb84fbb052eff70d76af49e41aa Mon Sep 17 00:00:00 2001 From: Paul Van Eck Date: Fri, 3 Jun 2022 22:09:26 -0700 Subject: [PATCH] fix: update configs and docs (#36) Adjust the configs to work properly in both standalone mode and with Kubeflow. Some documentation fixes were also added. Signed-off-by: Paul Van Eck --- Makefile | 2 +- README.md | 12 ++++++------ config/base/istio.yaml | 4 ++-- config/base/kustomization.yaml | 4 ++++ config/overlays/kubeflow/patches/web-app-vsvc.yaml | 4 ++++ 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 3c93356..b1b6dcc 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -IMG ?= gcr.io/kfserving/models-web-app +IMG ?= kserve/models-web-app # We want the git tag to be the last commit to this directory so we don't # bump the image on unrelated changes. diff --git a/README.md b/README.md index 56783c5..3e8f88c 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,11 @@ The web app currently works with `v1beta1` versions of `InferenceService` object ## Connect to the app -The web app is installed alongside the other KFServing components, either in the `kfserving-system` or in the `kubeflow` namespace. There is a `VirtualService` that exposes the app via an Istio Ingress Gateway. Depending on the installation environment the following Ingress Gateway will be used. +The web app is installed alongside the other KServe components, either in the `kserve` or in the `kubeflow` namespace. There is a `VirtualService` that exposes the app via an Istio Ingress Gateway. Depending on the installation environment the following Ingress Gateway will be used. | Installation mode | IngressGateway | | - | - | -| Standalone KFServing | knative-ingress-gateway.knative-serving | +| Standalone KServe | knative-ingress-gateway.knative-serving | | Kubeflow | kubeflow-gateway.kubeflow | To access the app you will need to navigate with your browser to @@ -27,11 +27,11 @@ You can apply the mentioned configurations by doing the following commands: ```bash # edit the configmap # CONFIG=config/overlays/kubeflow/kustomization.yaml -CONFIG=config/web-app/kustomization.yaml +CONFIG=config/base/kustomization.yaml vim ${CONFIG} # Add the following env vars to the configMapGenerator's literals -# for kfserving-models-web-app-config +# for kserve-models-web-app-config - APP_PREFIX=/ - APP_DISABLE_AUTH="True" - APP_SECURE_COOKIES="False" @@ -83,7 +83,7 @@ cd dist/kubeflow npm link # run the app frontend -cd $KFSERVING_REPO/web-app/frontend +cd $KSERVE_MODELS_WEB_APP_REPO/frontend npm i npm link kubeflow npm run build:watch @@ -95,7 +95,7 @@ npm run build:watch ```bash # create a virtual env and install deps # https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/ -cd $KFSERVING_REPO/web-app/backend +cd $KSERVE_MODELS_WEB_APP_REPO/backend python3.7 -m pip install --user virtualenv python3.7 -m venv web-apps-dev source web-apps-dev/bin/activate diff --git a/config/base/istio.yaml b/config/base/istio.yaml index dcd3211..27abdea 100644 --- a/config/base/istio.yaml +++ b/config/base/istio.yaml @@ -5,13 +5,13 @@ metadata: namespace: kserve spec: gateways: - - $(ingressGateway) + - knative-serving/knative-ingress-gateway hosts: - '*' http: - match: - uri: - prefix: /kserve-endpoints/ + prefix: /models/ rewrite: uri: / route: diff --git a/config/base/kustomization.yaml b/config/base/kustomization.yaml index 8398272..d22e601 100644 --- a/config/base/kustomization.yaml +++ b/config/base/kustomization.yaml @@ -3,9 +3,13 @@ resources: - service.yaml - deployment.yaml - istio.yaml + +namespace: kserve + commonLabels: kustomize.component: kserve-models-web-app app.kubernetes.io/component: kserve-models-web-app + images: - name: kserve/models-web-app newName: kserve/models-web-app diff --git a/config/overlays/kubeflow/patches/web-app-vsvc.yaml b/config/overlays/kubeflow/patches/web-app-vsvc.yaml index f35fed0..b4e8817 100644 --- a/config/overlays/kubeflow/patches/web-app-vsvc.yaml +++ b/config/overlays/kubeflow/patches/web-app-vsvc.yaml @@ -4,3 +4,7 @@ host: kserve-models-web-app.kubeflow.svc.cluster.local port: number: 80 +- op: replace + path: /spec/gateways + value: + - kubeflow/kubeflow-gateway