model-registry icon indicating copy to clipboard operation
model-registry copied to clipboard

MLMD: order_by_creation_time on model iteration fails to execute

Open rareddy opened this issue 1 year ago • 1 comments

Describe the bug order_by_creation_time on model iteration fails to execute

To Reproduce

case 1:

On an existing model registry if I execute the following Python client code

for version in registry.get_model_versions("FLUX.1-dev").order_by_update_time():
    print(version)

it fails with

ServiceException: (500)
Reason: Internal Server Error
HTTP response headers: <CIMultiDictProxy('Content-Type': 'application/json; charset=UTF-8', 'Vary': 'Origin', 'Date': 'Fri, 06 Sep 2024 17:58:27 GMT', 'Content-Length': '467', 'x-envoy-upstream-service-time': '23', 'Server': 'istio-envoy')>
HTTP response body: code='' message="rpc error: code = Internal desc = mysql_query failed: errno: Expression #1 of ORDER BY clause is not in SELECT list, references column 'model_registry.table_0.create_time_since_epoch' which is not in SELECT list; this is incompatible with DISTINCT, error: Expression #1 of ORDER BY clause is not in SELECT list, references column 'model_registry.table_0.create_time_since_epoch' which is not in SELECT list; this is incompatible with DISTINCT"

case 2:

if I execute the following Python client code

for version in registry.get_model_versions("FLUX.1-dev").order_by_creation_time():
    print(version)

it fails with

ServiceException: (500)
Reason: Internal Server Error
HTTP response headers: <CIMultiDictProxy('Content-Type': 'application/json; charset=UTF-8', 'Vary': 'Origin', 'Date': 'Fri, 06 Sep 2024 18:00:33 GMT', 'Content-Length': '477', 'x-envoy-upstream-service-time': '24', 'Server': 'istio-envoy')>
HTTP response body: code='' message="rpc error: code = Internal desc = mysql_query failed: errno: Expression #1 of ORDER BY clause is not in SELECT list, references column 'model_registry.table_0.last_update_time_since_epoch' which is not in SELECT list; this is incompatible with DISTINCT, error: Expression #1 of ORDER BY clause is not in SELECT list, references column 'model_registry.table_0.last_update_time_since_epoch' which is not in SELECT list; this is incompatible with DISTINCT"

Expected behavior it return collection as expected by method contract.

Additional context Check all the functions that return an iterator for the behavior and fix if needs to be in other places and have functional tests to validate the fix.

rareddy avatar Sep 06 '24 18:09 rareddy

I appreciate @isinyaaa the linking from https://github.com/opendatahub-io/ml-metadata/pull/12

but I don't believe that would actually fully fix this issue (https://github.com/kubeflow/model-registry/issues/358), since we rely on the upstream MLMD image shared with KFP in the KFMR manifests too:

https://github.com/kubeflow/model-registry/blob/533d2607ac649944589bde8d1884fa300144f5f0/manifests/kustomize/base/model-registry-deployment.yaml#L54

I would also encourage to create https://github.com/opendatahub-io/ml-metadata/pull/12 also upstream.

wdyt?

i.e. the https://github.com/opendatahub-io/ml-metadata/pull/12 is awesome, and thank you, but that will not be sufficient to close this https://github.com/kubeflow/model-registry/issues/358

tarilabs avatar Sep 10 '24 14:09 tarilabs

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Dec 10 '24 04:12 github-actions[bot]

This issue has been automatically closed because it has not had recent activity. Please comment "/reopen" to reopen it.

github-actions[bot] avatar Dec 31 '24 04:12 github-actions[bot]