Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Shell script openshift-ci make some REST call to MR #295

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

tarilabs
Copy link
Member

@tarilabs tarilabs commented Feb 8, 2024

In the scope of testing of Model Registry in openshift-ci:

  • make a Shell script which invokes some REST calls to MR,
  • so to make sure the REST endpoint is responsive,
  • then create a K8s ISVC on the cluster,
  • and display the MR InferenceService entities.

Later, in a subsequent issue/PR, once:

is merged, the last bulletpoint can be automated and placed under test in the final part of this script so to make sure the K8s ISVC on the cluster reflected as a precise MR InferenceService entity.

Description

Resolves #294

How Has This Been Tested?

Tested with:

OCP_CLUSTER_NAME="rosa.mmortari-rosa-h.w0x4.p3.openshiftapps.com"

Result:

Registered Model ID: 27
Model Version ID: 28
Model Artifact ID: 14
inferenceservice.serving.kserve.io/demo-20240208144831 created
InferenceService entities on MR:
{"items":[],"nextPageToken":"","pageSize":0,"size":0}

Screenshot 2024-02-08 at 14 48 57

Screenshot 2024-02-08 at 14 49 04

Merge criteria:

  • The commits and have meaningful messages; the author will squash them after approval or will ask to merge with squash.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@tarilabs tarilabs requested review from tonyxrmdavidson, lampajr and a team February 8, 2024 13:52
Comment on lines +78 to +79
"mr-registered-model-id": "$rm_id"
"mr-model-version-id": "$mv_id"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the K8s ISVC is created with the IDs from the MR REST calls

Comment on lines +92 to +94
# TODO this will continue once we have MC PR merged from: https://github.com/opendatahub-io/odh-model-controller/pull/135
iss_mr=$(curl -s -X 'GET' "$MR_HOSTNAME/api/model_registry/v1alpha1/inference_services" \
-H 'accept: application/json')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As confirmed to offline review, this will eventually transform into a loop-while, waiting for the condition than some InferenceService entity on MR is valorized with the registeredModelId, modelVersionId as needed.

(once opendatahub-io/odh-model-controller#135 merged)

This described change, I suggest to be done in a subsequent PR, as this covers already for basic REST functionality.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (44ce399) 76.42% compared to head (fa2b5a4) 76.42%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #295   +/-   ##
=======================================
  Coverage   76.42%   76.42%           
=======================================
  Files          17       17           
  Lines        1909     1909           
  Branches       73       73           
=======================================
  Hits         1459     1459           
  Misses        276      276           
  Partials      174      174           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

In the scope of testing of Model Registry in openshift-ci:
- make a Shell script which invokes some REST calls to MR,
- so to make sure the REST endpoint is responsive,
- then create a K8s ISVC on the cluster,
- and display the MR InferenceService entities.

Later, in a subsequent issue/PR, once:
opendatahub-io/odh-model-controller#135
is merged, the last bulletpoint can be automated and placed under test in the final part of this script so to make sure the K8s ISVC on the cluster reflected as a precise MR InferenceService entity.
Copy link
Contributor

@lampajr lampajr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good starting point, I think this could be refined in subsequent PRs if needed

Copy link
Contributor

@tonyxrmdavidson tonyxrmdavidson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is great for a starting point and /lgtm. Only thing I might add is to remove the entity using a rest api call once the reconciliation step is completed succesfully. That can be done later though.

Copy link
Contributor

@isinyaaa isinyaaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just a nit on the shebang highlighted below :) still, I expect that we're not going to use this script a lot outside of the CI setup, so feel free to merge whatever works.

test/scripts/rest.sh Show resolved Hide resolved
@tarilabs
Copy link
Member Author

Only thing I might add is to remove the entity using a rest api call once the reconciliation step is completed succesfully

there is no concept of deletion in MLMD and consequently no concept of deletion also on MR.
an entity could only be patch-ed to a different state, such as:

https://github.com/opendatahub-io/model-registry/blob/901f8745b35fd777c2886b501955443c4247730e/api/openapi/model-registry.yaml#L920-L928

@tarilabs tarilabs merged commit 921b05e into opendatahub-io:main Feb 12, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide Shell script openshift-ci make some REST call to MR
5 participants