kserve / models-web-app

KServe models web UI
Apache License 2.0
32 stars 40 forks source link

Logs not showing in v0.13.0-rc.0 #87

Open MatthiasCarnein opened 1 month ago

MatthiasCarnein commented 1 month ago

While testing the latest release candidate (kserve/models-web-app:v0.13.0-rc.0), I noticed that logs are not showing for some InferenceServices in the models web app. The issue seems to occur when the InferenceService has no annotations.

The models web app pod prints the following traceback:

Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/src/apps/common/routes/get.py", line 30, in get_inference_service
"serviceLogs", get_inference_service_logs(inference_service),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/src/apps/common/routes/get.py", line 44, in get_inference_service_logs
if svc["metadata"]["annotations"].get(
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: 'annotations'
rimolive commented 1 month ago

Does this happen with 0.10 image of Models Web app?

I suspect it will happen with older images because this change is from a year ago. Question to you: What is the case where an InferenceService has no annotations?

MatthiasCarnein commented 1 month ago

The 0.10 image is working fine for me, I'm only seeing this in the latest rc. I vaguely remember seeing a similar github issue for one of the other web app so maybe this was introduced by a change in the shared code?

I believe most InferenceService have no annotation by default. If you check the examples from the website, none of them do, e.g. https://kserve.github.io/website/latest/modelserving/v1beta1/torchserve/#create-the-torchserve-inferenceservice

(I'm talking about the InferenceService kind, not the created pod).

MatthiasCarnein commented 1 month ago

Ah I see it what you mean. The issue was probably introduced on Mar 6 2023 here: https://github.com/kserve/models-web-app/commit/50cc49348dcbf514d047650073978245fc0281fc

The v0.10.0 image tag was published on Feb 7 2023 though. So this seems to be an older issue which now surfaces since the image is rebuilt.