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

Adds an endpoint to get a registered model by id #339

Merged

Conversation

alexcreasy
Copy link
Contributor

@alexcreasy alexcreasy commented Sep 3, 2024

Description

Adds an endpoint to fetch registered models by id.

How Has This Been Tested?

Test rig setup:

  1. Deploy MR backend (you can follow the guide using kind in the docs)
  2. Deploy BFF with e.g. make run PORT=4000 MOCK_K8S_CLIENT=true
  3. Add a model to one of the registries:
curl -i -X POST "http://localhost:4000/api/v1/model-registry/model-registry/registered_models" \
     -H "Content-Type: application/json" \
     -d '{
  "customProperties": {
    "my-label9": {
      "metadataType": "MetadataStringValue",
      "string_value": "val"
    }
  },
  "description": "bella description",
  "externalId": "9927",
  "name": "bella",
  "owner": "eder",
  "state": "LIVE"
}'

Test routine:

  1. Verify the endpoint returns a 200 and the model from the endpoint: curl -i localhost:4000/api/v1/model-registry/model-registry/registered_models/1
  2. Try with a different non existent id and verify that a 404 is returned: curl -i localhost:4000/api/v1/model-registry/model-registry/registered_models/fluglebinder

Merge criteria:

  • All the commits have been signed-off (To pass the DCO check)
  • The commits have meaningful messages; the author will squash them after approval or in case of manual merges 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.
  • Code changes follow the kubeflow contribution guidelines.

If you have UI changes

  • The developer has added tests or explained why testing cannot be added.
  • Included any necessary screenshots or gifs if it was a UI change.
  • Verify that UI/UX changes conform the UX guidelines for Kubeflow.

@Griffin-Sullivan
Copy link
Contributor

Griffin-Sullivan commented Sep 3, 2024

FYI there's a typo in the commit message. Adds and endpoint to get individual registered models

Copy link
Contributor

@Griffin-Sullivan Griffin-Sullivan left a comment

Choose a reason for hiding this comment

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

Tested the changes. Everything is working for me.

@lucferbux
Copy link
Contributor

Changes seem to work fine, great work here, I subscribe to @Griffin-Sullivan questions, once that's sorted out we can lgtm it!

@alexcreasy alexcreasy force-pushed the get-registered-model-endpoint branch from 11053bf to 28fed11 Compare September 4, 2024 12:14
@Griffin-Sullivan
Copy link
Contributor

Changes are good to me

@alexcreasy
Copy link
Contributor Author

/approve

@alexcreasy
Copy link
Contributor Author

/lgtm

Copy link

@alexcreasy: you cannot LGTM your own PR.

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.

@alexcreasy
Copy link
Contributor Author

I mean, that's fair that I can't LGTM it myself technically, but Griffen just did :P

Copy link
Member

@ederign ederign left a comment

Choose a reason for hiding this comment

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

@alexcreasy just some small changes related to our API design. Another option is to use https://pkg.go.dev/github.com/julienschmidt/httprouter#Router.RedirectTrailingSlash , but we would need to investigate better if there is any side effect of using it.

Also, could you please add the example from the PR in our README?

@alexcreasy alexcreasy force-pushed the get-registered-model-endpoint branch from 28fed11 to 65c0cbc Compare September 5, 2024 16:00
@google-oss-prow google-oss-prow bot added size/L and removed size/M labels Sep 5, 2024
@alexcreasy alexcreasy force-pushed the get-registered-model-endpoint branch 2 times, most recently from 5434cb6 to d520713 Compare September 5, 2024 16:05
@alexcreasy
Copy link
Contributor Author

@ederign think we should be gtg now

Signed-off-by: Alex Creasy <alex@creasy.dev>
@alexcreasy alexcreasy force-pushed the get-registered-model-endpoint branch from d520713 to 8e28767 Compare September 5, 2024 17:26
@ederign
Copy link
Member

ederign commented Sep 5, 2024

/lgtm

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexcreasy, ederign, Griffin-Sullivan

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 c026630 into kubeflow:main Sep 5, 2024
15 checks passed
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.

4 participants