mirror of
https://github.com/hanzo-ml/kserve.git
synced 2026-10-30 20:53:49 +00:00
* feat: Support customizable deployment strategy for RawDeployment mode Signed-off-by: Yuan Tang <[email protected]> * regen Signed-off-by: Yuan Tang <[email protected]> * lint Signed-off-by: Yuan Tang <[email protected]> * Correctly apply rollingupdate Signed-off-by: Yuan Tang <[email protected]> * address comments Signed-off-by: Yuan Tang <[email protected]> * Add validation Signed-off-by: Yuan Tang <[email protected]> --------- Signed-off-by: Yuan Tang <[email protected]>
4.7 KiB
4.7 KiB
In [ ]:
!pygmentize message-dumper.yamlIn [ ]:
!kubectl apply -f message-dumper.yamlIn [ ]:
!pygmentize broker.yamlIn [ ]:
!kubectl create -f broker.yamlIn [ ]:
!pygmentize trigger.yamlIn [ ]:
!kubectl apply -f trigger.yamlIn [ ]:
!pygmentize sklearn-logging.yamlIn [ ]:
!kubectl apply -f sklearn-logging.yamlIn [ ]:
CLUSTER_IPS = !(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
CLUSTER_IP = CLUSTER_IPS[0]
print(CLUSTER_IP)In [ ]:
SERVICE_HOSTNAMES = !(kubectl get inferenceservice sklearn-iris -o jsonpath='{.status.url}' | cut -d "/" -f 3)
SERVICE_HOSTNAME = SERVICE_HOSTNAMES[0]
print(SERVICE_HOSTNAME)In [ ]:
import requests
def predict(X, name, svc_hostname, cluster_ip):
formData = {"instances": X}
headers = {}
headers["Host"] = svc_hostname
res = requests.post(
"http://" + cluster_ip + "/v1/models/" + name + ":predict",
json=formData,
headers=headers,
)
if res.status_code == 200:
return res.json()
else:
print("Failed with ", res.status_code)
return []In [ ]:
predict([[6.8, 2.8, 4.8, 1.4]], "sklearn-iris", SERVICE_HOSTNAME, CLUSTER_IP)In [ ]:
!kubectl logs $(kubectl get pod -l serving.knative.dev/configuration=message-dumper -o jsonpath='{.items[0].metadata.name}') user-containerIn [ ]:
!kubectl delete -f sklearn-logging.yamlIn [ ]:
!kubectl delete -f trigger.yamlIn [ ]:
!kubectl delete -f message-dumper.yamlIn [ ]: