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

Implement basic 'jmm models' command #6

Merged
merged 1 commit into from
Feb 9, 2024
Merged

Implement basic 'jmm models' command #6

merged 1 commit into from
Feb 9, 2024

Conversation

amisevsk
Copy link
Contributor

@amisevsk amisevsk commented Feb 9, 2024

Add basic implementation of jmm models command that prints artifacts in the local store. Prints digest, maintainer, format, and size for now.

Sample output:

❯ jmm models
DIGEST                                                                    MAINTAINER   MODEL FORMAT   SIZE
sha256:65784f6eae42940f917ed44b2f3f236f8a09b4a83064966eb081ef3aa2d47215   gorkem       onnx           28.9 MiB

Two concerns here, though:

  1. I think we might me misusing oci.Store -- it's not entirely clear how index.json should work and if it supports multiple images at all. From my understanding, index.json is supposed to be the index for a single image (?).
  2. Tests are still to come; since this code interacts with disk fairly heavily, I'll need to refactor the artifact.Store code to make it so we can sub out implementations in testing.

@amisevsk amisevsk requested a review from gorkem February 9, 2024 15:06
configHome string
}

func (opts *ModelsOptions) readGlobalConfig() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was using the function name as complete to do things like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can rename it -- I chose this because complete was a little unclear to me ("complete from where?")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My assumption would've been that with viper/etc we don't need to do this manual wiring for every command (what's the point of a global option if its invisible until we explicitly assign it?) :)

Add basic implementation of `jmm models` command that prints artifacts
in the local store. Prints digest, maintainer, format, and size for now.

Signed-off-by: Angel Misevski <[email protected]>
@amisevsk amisevsk merged commit 7b350c6 into main Feb 9, 2024
1 check passed
@amisevsk amisevsk deleted the jmm-models branch February 9, 2024 18:00
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.

2 participants