-
Notifications
You must be signed in to change notification settings - Fork 19
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
RHOAIENG-3458: Add a models command to the CLI #227
Conversation
@devguyio: This pull request references RHOAIENG-3458 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
/assign @StevenTobin @LaVLaS |
@devguyio: This pull request references RHOAIENG-3458 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: devguyio, Sara4994 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I have just one question about the currently unused fields of the model.
cursor int | ||
choices int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@devguyio I noticed that these are not used. Are they a preparation for the next step when a use will be able to choose a model and operate on it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to disregard my Go-related comments, since I haven't used it in about 3 years probably, and have never used the bubbletea stuff 🙃
@@ -0,0 +1,163 @@ | |||
/* | |||
Copyright 2023 KStreamer Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this copyright assignment correct? Just checking in case it's from some pre-existing default in your editor.
return errMsg{err} | ||
} | ||
if httpRes.StatusCode != 200 { | ||
fmt.Printf("not 200: %d\n", httpRes.StatusCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this log message redundant, given the error message being returned? How does fmt.Printf get handled in the interactive text UI?
return registeredModelsMsg(models) | ||
} | ||
|
||
type model struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this would be better named more specifically to say that model
here is a bubbletea concept, given that the file name (models.go
) refers to AI models in a model registry? 😵💫
func (m model) View() string { | ||
if m.err != nil { | ||
return errorStyle.Render(fmt.Sprintf("Error: %s", m.err)) | ||
// return "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment could probably be deleted
{Title: "Description", Width: 60}, | ||
} | ||
|
||
rows := make([]table.Row, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the length 0 here could be more optimally set to len(m.registeredModelsList.Items)
? That might have an impact on the code structure though, since the nil check from line 111 would have to encompass this too
os.Exit(1) | ||
} | ||
if m.(model).err != nil { | ||
// cmd.PrintErrf("Error: %v\n", m.(model).err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commented code could probably be removed
@grdryn thanks for the review. This PR was merged by mistake and a lot of the comments you mentioned were addressed in #234 . Basically, the So I suggest that you check that PR and consider it the proposed state of the |
Yeah, for sure, I plan to get around to looking at #234 soon too. I just figured that one would make more sense once I'd seen these earlier ones (that I know you'd mentioned had been merged accidentally). |
Description
Add a
models
command that lists registered models from the model registry.This PR is stacked on top of #222 .
How Has This Been Tested?
modelregistry-sample
service in the namespace where you installed the model registrycli
directory, run the cli using go, the URL of the model registry is set via the env varMODEL_REGISTRY_URL
which defaults tohttp://localhost:8080
.cd cli go run cmd/main.go
Merge criteria: