|
27 | 27 | "metadata": {}, |
28 | 28 | "outputs": [], |
29 | 29 | "source": [ |
30 | | - "!pip install kserve==0.7.0" |
| 30 | + "!pip install kserve==0.15.0" |
31 | 31 | ] |
32 | 32 | }, |
33 | 33 | { |
|
40 | 40 | }, |
41 | 41 | { |
42 | 42 | "cell_type": "code", |
43 | | - "execution_count": 2, |
| 43 | + "execution_count": null, |
44 | 44 | "id": "a38cbeda-eb60-4469-b861-559950886453", |
45 | 45 | "metadata": {}, |
46 | 46 | "outputs": [], |
|
67 | 67 | }, |
68 | 68 | { |
69 | 69 | "cell_type": "code", |
70 | | - "execution_count": 3, |
| 70 | + "execution_count": null, |
71 | 71 | "id": "6a621ac9-1847-4249-b12a-76cf23620534", |
72 | 72 | "metadata": {}, |
73 | 73 | "outputs": [], |
|
94 | 94 | }, |
95 | 95 | { |
96 | 96 | "cell_type": "code", |
97 | | - "execution_count": 4, |
| 97 | + "execution_count": null, |
98 | 98 | "id": "9a7f9b69-a305-482b-a9e1-0b706ba11341", |
99 | 99 | "metadata": {}, |
100 | 100 | "outputs": [], |
|
104 | 104 | "api_version = constants.KSERVE_GROUP + '/' + kserve_version\n", |
105 | 105 | "\n", |
106 | 106 | "isvc = V1beta1InferenceService(api_version=api_version,\n", |
107 | | - " kind=constants.KSERVE_KIND,\n", |
| 107 | + " kind=constants.KSERVE_KIND_INFERENCESERVICE,\n", |
108 | 108 | " metadata=client.V1ObjectMeta(\n", |
109 | 109 | " name=name, namespace=namespace, annotations={'sidecar.istio.io/inject':'false'}),\n", |
110 | 110 | " spec=V1beta1InferenceServiceSpec(\n", |
111 | 111 | " predictor=V1beta1PredictorSpec(\n", |
112 | 112 | " sklearn=(V1beta1SKLearnSpec(\n", |
113 | | - " storage_uri=\"gs://kfserving-samples/models/sklearn/iris\"))))\n", |
| 113 | + " storage_uri=\"gs://kfserving-examples/models/sklearn/1.0/model\"))))\n", |
114 | 114 | ")" |
115 | 115 | ] |
116 | 116 | }, |
|
189 | 189 | " ]\n", |
190 | 190 | "}\n", |
191 | 191 | "\n", |
192 | | - "response = requests.post(isvc_url, json=inference_input)\n", |
| 192 | + "response = requests.post(f\"{isvc_url}/v1/models/{name}:predict\", json=inference_input)\n", |
193 | 193 | "print(response.text)" |
194 | 194 | ] |
195 | 195 | }, |
|
221 | 221 | "metadata": {}, |
222 | 222 | "outputs": [], |
223 | 223 | "source": [ |
224 | | - "!kubectl create -f https://raw.githubusercontent.com/kserve/kserve/release-0.7/docs/samples/v1beta1/sklearn/v1/perf.yaml -n kubeflow-user-example-com" |
| 224 | + "creation_output=!kubectl create -f https://raw.githubusercontent.com/kserve/kserve/release-0.15/docs/samples/v1beta1/sklearn/v1/perf.yaml -n {namespace}\n", |
| 225 | + "creation_output" |
| 226 | + ] |
| 227 | + }, |
| 228 | + { |
| 229 | + "cell_type": "code", |
| 230 | + "execution_count": null, |
| 231 | + "id": "a17377b8-30b8-43c2-a39c-da6aded3ff40", |
| 232 | + "metadata": {}, |
| 233 | + "outputs": [], |
| 234 | + "source": [ |
| 235 | + "job_name = creation_output[0].split(\"/\")[-1].split(\" \")[0]\n", |
| 236 | + "job_name" |
225 | 237 | ] |
226 | 238 | }, |
227 | 239 | { |
|
239 | 251 | "metadata": {}, |
240 | 252 | "outputs": [], |
241 | 253 | "source": [ |
242 | | - "!kubectl get pods --namespace=kubeflow-user-example-com | grep load" |
| 254 | + "get_pod_output=!kubectl get pods -n {namespace} | grep {job_name}\n", |
| 255 | + "get_pod_output" |
| 256 | + ] |
| 257 | + }, |
| 258 | + { |
| 259 | + "cell_type": "code", |
| 260 | + "execution_count": null, |
| 261 | + "id": "2d6318ef-0360-4eae-8775-f1a1ac6e5fac", |
| 262 | + "metadata": {}, |
| 263 | + "outputs": [], |
| 264 | + "source": [ |
| 265 | + "pod_name=get_pod_output[0].split(\" \")[0]\n", |
| 266 | + "pod_name" |
243 | 267 | ] |
244 | 268 | }, |
245 | 269 | { |
|
257 | 281 | "metadata": {}, |
258 | 282 | "outputs": [], |
259 | 283 | "source": [ |
260 | | - "!kubectl logs <job-name> -n kubeflow-user-example-com" |
| 284 | + "!kubectl logs {pod_name} -n {namespace}" |
261 | 285 | ] |
262 | 286 | }, |
263 | 287 | { |
|
302 | 326 | ], |
303 | 327 | "metadata": { |
304 | 328 | "kernelspec": { |
305 | | - "display_name": "Python 3", |
| 329 | + "display_name": "Python 3 (ipykernel)", |
306 | 330 | "language": "python", |
307 | 331 | "name": "python3" |
308 | 332 | }, |
|
316 | 340 | "name": "python", |
317 | 341 | "nbconvert_exporter": "python", |
318 | 342 | "pygments_lexer": "ipython3", |
319 | | - "version": "3.8.10" |
| 343 | + "version": "3.11.10" |
320 | 344 | } |
321 | 345 | }, |
322 | 346 | "nbformat": 4, |
|
0 commit comments