opendatahub-io / kserve

Standardized Serverless ML Inference Platform on Kubernetes
https://kserve.github.io/website/
Apache License 2.0
0 stars 16 forks source link

Private Endpoint Tasks #371

Open Jooho opened 3 weeks ago

Jooho commented 3 weeks ago

This is tracking GH issue.

Jooho commented 3 weeks ago

Full test

Setup Test Environment to verify all PRs PR list

images

Manual way

Install custom odh operator/kserve operator/odh-model-controller operator


Script way

Loopy Setup refer this doc

git clone   git@github.com:Jooho/loopy.git
cd loopy
make init

or

docker run -it quay.io/jooholee/loopy

cat cluster_info.sh
CLUSTER_CONSOLE_URL=https://console-openshift-console.XXXX
CLUSTER_API_URL=https://api.XXX:443
CLUSTER_ADMIN_ID=admin
CLUSTER_ADMIN_PW=password
CLUSTER_TOKEN=sha256~XXX
CLUSTER_TYPE=ROSA

Install Kserve with a new manifests

loopy playbooks run private-endpoint-poc -p CUSTOM_KSERVE_MANIFESTS=https://github.com/jooho/kserve/tarball/test-manifest  -p CUSTOM_ODH_MODEL_CONTROLLER_MANIFESTS=https://github.com/jooho/odh-model-controller/tarball/test-manifests -vvv -i ./cluster_info.sh

Deploy sample sklearn model

loopy units run test-kserve-sklearn-v2-iris-role -vvv -i ./cluster_info.sh 

Test from the same namespace

  1. Running test pods
    
    TEST_NAMESPACE=kserve-demo

oc label namespace ${TEST_NAMESPACE} pod-security.kubernetes.io/enforce=baseline --overwrite oc label namespace ${TEST_NAMESPACE} pod-security.kubernetes.io/warn=baseline --overwrite oc label namespace ${TEST_NAMESPACE} pod-security.kubernetes.io/audit=baseline --overwrite

oc run test-with-istio -n ${TEST_NAMESPACE} --image=registry.access.redhat.com/rhel7/rhel-tools --annotations=sidecar.istio.io/inject="true" -- sleep infinity 2> /dev/null oc run test -n ${TEST_NAMESPACE} --image=registry.access.redhat.com/rhel7/rhel-tools -- sleep infinity 2> /dev/null


2. curl from a pod with istio-proxy from the same cluster

oc exec test-with-istio -n ${TEST_NAMESPACE} -- curl -s sklearn-example-isvc-iris-v2-rest.${TEST_NAMESPACE}.svc.cluster.local/v2/health/live


3. curl from a pod without istio-proxy from the same cluster

oc exec test -n ${TEST_NAMESPACE} -- curl -sk https://sklearn-example-isvc-iris-v2-rest.${TEST_NAMESPACE}.svc.cluster.local/v2/health/live


## Test from another namespace

1. Running test pods

ANOTHER_NAMESPACE=curl-test oc new-project ${ANOTHER_NAMESPACE} oc label namespace ${ANOTHER_NAMESPACE} pod-security.kubernetes.io/enforce=baseline --overwrite oc label namespace ${ANOTHER_NAMESPACE} pod-security.kubernetes.io/warn=baseline --overwrite oc label namespace ${ANOTHER_NAMESPACE} pod-security.kubernetes.io/audit=baseline --overwrite cat << EOF |oc create -f - kind: ServiceMeshMember apiVersion: maistra.io/v1 metadata: name: default namespace: ${ANOTHER_NAMESPACE} spec: controlPlaneRef: name: data-science-smcp namespace: istio-system EOF

oc run test-with-istio -n ${ANOTHER_NAMESPACE} --image=registry.access.redhat.com/rhel7/rhel-tools -n ${ANOTHER_NAMESPACE} --annotations=sidecar.istio.io/inject="true" -- sleep infinity 2> /dev/null oc run test -n ${ANOTHER_NAMESPACE} --image=registry.access.redhat.com/rhel7/rhel-tools -n ${ANOTHER_NAMESPACE} -- sleep infinity 2> /dev/null


2. curl from a pod with istio-proxy from another cluster

oc exec test-with-istio -n ${ANOTHER_NAMESPACE} -- curl -s sklearn-example-isvc-iris-v2-rest.${TEST_NAMESPACE}.svc.cluster.local/v2/health/live


3. curl from a pod without istio-proxy from another cluster

oc exec test -n ${ANOTHER_NAMESPACE} -- curl -sk https://sklearn-example-isvc-iris-v2-rest.${TEST_NAMESPACE}.svc.cluster.local/v2/health/live