-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update KServe component, Kserve guide and fix incorrect paths (#266)
**Description of your changes:** - Kserve offers [2 installation options](https://github.com/kserve/kserve/tree/release-0.7/install/v0.7.0) for serverless: standalone installation (in its own namespace) and a Kubeflow one. In KF-1.5 since both KFServing and KServe are included, Kserve standalone installation was used to avoid conflicts in resource names. But, in doing so the default ingress gateway configured became `kntaive-serving/knative-ingress-gateway` which does not exist in Kubeflow installation. Kubeflow integrated installation should use `kubeflow/kubeflow-gateway`. Overlay under `awsconfig/apps/kserve` fixes this and should eventually be merged upstream - Previous Kserve example fails to load the model because of incompatible libraries in container and hence had to update the sample used in guide - Fixed a bunch of path issues and outdated content and commands
- Loading branch information
Showing
16 changed files
with
246 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
# kserve offers 2 installation options for serverless: standalone installation (in its own namespace) and a Kubeflow one | ||
# See: https://github.com/kserve/kserve/tree/release-0.7/install/v0.7.0 | ||
# In 1.5 since both KFServing and KServe were included, Kserve standalone installation was used to avoid conflicts in resource names | ||
# but in doing so the default ingress gateway configured became knative-serving/knative-ingress-gateway which does not exist in Kubeflow installation | ||
# Kubeflow integrated installation should use kubeflow/kubeflow-gateway | ||
# this overlay fixes what is achieved by https://github.com/kserve/kserve/blob/release-0.7/config/overlays/kubeflow/params.env#L1 and should eventually be merged upstream | ||
bases: | ||
- ../../../upstream/contrib/kserve/kserve | ||
|
||
# To make namespace for standalone installation kustomizable, | ||
# variabalize ingress gateway, webhook service name and | ||
# kserve namespace in webhook configurations | ||
configMapGenerator: | ||
- name: kserve-config | ||
namespace: kserve | ||
behavior: merge | ||
envs: | ||
- params.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ingressGateway=kubeflow/kubeflow-gateway |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import requests | ||
import os | ||
import json | ||
|
||
from e2e.utils.utils import load_json_file | ||
|
||
# common vars | ||
KUBEFLOW_DOMAIN = os.environ.get("KUBEFLOW_DOMAIN", "kubeflow.example.com") | ||
PROFILE_NAMESPACE = os.environ.get("PROFILE_NAMESPACE", "staging") | ||
MODEL_NAME = os.environ.get("MODEL_NAME", "sklearn-irisv2") | ||
AUTH_PROVIDER = os.environ.get("AUTH_PROVIDER", "dex") | ||
|
||
URL = f"https://{MODEL_NAME}.{PROFILE_NAMESPACE}.{KUBEFLOW_DOMAIN}/v2/models/{MODEL_NAME}/infer" | ||
HEADERS = {"Host": f"{MODEL_NAME}.{PROFILE_NAMESPACE}.{KUBEFLOW_DOMAIN}"} | ||
DASHBOARD_URL = f"https://kubeflow.{KUBEFLOW_DOMAIN}" | ||
|
||
data = load_json_file("./utils/kserve/iris-input.json") | ||
|
||
response = None | ||
if AUTH_PROVIDER != "cognito": | ||
USERNAME = os.environ.get("USERNAME", "user@example.com") | ||
PASSWORD = os.environ.get("PASSWORD", "12341234") | ||
|
||
def session_cookie(host, login, password): | ||
session = requests.Session() | ||
response = session.get(host) | ||
headers = { | ||
"Content-Type": "application/x-www-form-urlencoded", | ||
} | ||
data = {"login": login, "password": password} | ||
session.post(response.url, headers=headers, data=data) | ||
session_cookie = session.cookies.get_dict()["authservice_session"] | ||
return session_cookie | ||
|
||
cookie = {"authservice_session": session_cookie(DASHBOARD_URL, USERNAME, PASSWORD)} | ||
response = requests.post(URL, headers=HEADERS, json=data, cookies=cookie) | ||
else: | ||
HTTP_HEADER_NAME = os.environ.get("HTTP_HEADER_NAME", "x-api-key") | ||
HTTP_HEADER_VALUE = os.environ.get("HTTP_HEADER_VALUE", "token1") | ||
HEADERS[HTTP_HEADER_NAME] = HTTP_HEADER_VALUE | ||
|
||
response = requests.post(URL, headers=HEADERS, json=data) | ||
|
||
status_code = response.status_code | ||
print("Status Code", status_code) | ||
if status_code == 200: | ||
print("JSON Response ", json.dumps(response.json(), indent=2)) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"inputs":[ | ||
{ | ||
"name":"input-0", | ||
"shape":[2, 4], | ||
"datatype":"FP32", | ||
"data":[ | ||
[6.8, 2.8, 4.8, 1.4], | ||
[6.0, 3.4, 4.5, 1.6] | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.