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

demo storing label as custom property with empty string value #53

Merged

Conversation

tarilabs
Copy link
Member

@tarilabs tarilabs commented Apr 3, 2024

In this demo,

  • RegisteredModel gets labels: my-label1, my-label2
  • ModelVersion gets labels: my-label3, my-label4
  • ModelArtifact gets labels: my-label5, my-label6

Description

Custom property of type string, with empty string value, shall be considered a Label; this is also semantically compatible for properties having empty string values in general.

How Has This Been Tested?

robot test/robot/UserStory.robot

Behind the scenes, request payload is exercised as:

POST Request : url=http://localhost:8080/api/model_registry/v1alpha3/registered_models 
 path_url=/api/model_registry/v1alpha3/registered_models 
 headers={'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '235', 'Content-Type': 'application/json'} 
 body=b'{"name": "GkfjQxwk", "description": "Lorem ipsum dolor sit amet", "customProperties": {"my-label1": {"string_value": "", "metadataType": "MetadataStringValue"}, "my-label2": {"string_value": "", "metadataType": "MetadataStringValue"}}}' 

So we can notice this takes the general form of:

{
..., 
"customProperties":
  { "my-label1": {"string_value": "", "metadataType": "MetadataStringValue"}, 
    ...

And analogous response:

POST Response : url=http://localhost:8080/api/model_registry/v1alpha3/registered_models 
 status=201, reason=Created 
 headers={'Content-Type': 'application/json; charset=UTF-8', 'Vary': 'Origin', 'Date': 'Wed, 03 Apr 2024 06:36:10 GMT', 'Content-Length': '314'} 
 body={"createTimeSinceEpoch":"1712126170473","customProperties":{"my-label1":{"metadataType":"MetadataStringValue","string_value":""},"my-label2":{"metadataType":"MetadataStringValue","string_value":""}},"description":"Lorem ipsum dolor sit amet","id":"36","lastUpdateTimeSinceEpoch":"1712126170473","name":"GkfjQxwk"}

Resulting in:

Screenshot 2024-04-03 at 08 47 22

as expected.

References:

Merge criteria:

  • The commits and have meaningful messages; the author will squash them after approval or will ask to merge with squash.
  • [n/a] 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

In this demo,
RegisteredModel gets labels: my-label1, my-label2
ModelVersion gets labels: my-label3, my-label4
ModelArtifact gets labels: my-label5, my-label6

Signed-off-by: Matteo Mortari <[email protected]>
Copy link
Contributor

@dhirajsb dhirajsb left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link

@dhirajsb: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rareddy rareddy self-requested a review April 3, 2024 18:25
Copy link
Contributor

@rareddy rareddy left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhirajsb, rareddy, tarilabs

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit dc872c1 into kubeflow:main Apr 3, 2024
11 checks passed
rkubis pushed a commit to rkubis/model-registry that referenced this pull request Apr 23, 2024
* This commit will change the success label for a 404 return to a yellow warning.

* removing double echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants