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

feat(bff): create endpoint to list all model versions #707

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

ederign
Copy link
Member

@ederign ederign commented Jan 16, 2025

Description

This PR introduces a new endpoint to fetch all model versions:

# GET /api/v1/model_registry/{model_registry_id}/model_versions
curl -i -H "kubeflow-userid: [email protected]" "http://localhost:4000/api/v1/model_registry/model-registry/model_versions?namespace=kubeflow"

In this PR:

  • clients/ui/bff/README.md: adding readme for new endpoint
  • clients/ui/bff/internal/api/app.go: adding new route
  • clients/ui/bff/internal/api/model_versions_handler.go: new handler to get all models version
  • clients/ui/bff/internal/api/model_versions_handler_test.go: companion tests
  • clients/ui/bff/internal/api/registered_models_handler.go: small rename to avoid clash
  • clients/ui/bff/internal/mocks/model_registry_client_mock.go: mock implementation
  • clients/ui/bff/internal/repositories/model_version.go : repository for get all model version (call to MR)
  • clients/ui/bff/internal/repositories/model_version_test.go: companion tests
  • clients/ui/bff/internal/repositories/registered_model.go: refactoring to avoid clash
  • clients/ui/bff/internal/repositories/registered_model_test.go: refactoring to avoid clash

How Has This Been Tested?

With --mock-k8s-client=true --mock-mr-client=false:

http://localhost:4000/api/v1/model_registry/model-registry/model_versions?namespace=kubeflow
{
  "data": {
    "items": [
      {
        "author": "kubeflow-user",
        "createTimeSinceEpoch": "1729029766652",
        "customProperties": {
          
        },
        "description": "fsdfsd",
        "id": "4",
        "lastUpdateTimeSinceEpoch": "1729029766652",
        "name": "fsdfsd",
        "registeredModelId": "3",
        "state": "LIVE"
      },
    ...
    ],
    "nextPageToken": "",
    "pageSize": 0,
    "size": 8
  }
}
```

http://localhost:4000/api/v1/model_registry/model-registry/model_versions/4?namespace=kubeflow
{
"data": {
"author": "kubeflow-user",
"createTimeSinceEpoch": "1729029766652",
"customProperties": {

},
"description": "fsdfsd",
"id": "4",
"lastUpdateTimeSinceEpoch": "1729029766652",
"name": "fsdfsd",
"registeredModelId": "3",
"state": "LIVE"

}
}



## Merge criteria:
<!--- This PR will be merged by any repository approver when it meets all the points in the checklist -->
- All the commits have been [_signed-off_](https://github.com/kubeflow/community/tree/master/dco-signoff-hook#signing-off-commits)  (To pass the `DCO` check)

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
- [ ] 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](https://www.kubeflow.org/docs/about/contributing/).

If you have UI changes

<!--- You can ignore these if you are doing Go Model Registry REST server, MR Python client, manifest, controller, internal logic, etc changes; aka non-UI / visual changes -->
- [X] The developer has added tests or explained why testing cannot be added.
- [X] Included any necessary screenshots or gifs if it was a UI change.
- [X] Verify that UI/UX changes conform the UX guidelines for Kubeflow.

Copy link
Contributor

@lucferbux lucferbux left a comment

Choose a reason for hiding this comment

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

/lgtm

Tested and it's working, approving since i need it for my dev.

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lucferbux

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 f9f78c3 into kubeflow:main Jan 16, 2025
16 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.

2 participants