Add normalization with ai/ prefix for official models#126
Add normalization with ai/ prefix for official models#126ericcurtin wants to merge 1 commit intodocker:mainfrom
Conversation
|
I think |
aec62fb to
c448de9
Compare
|
@xenoscopic WDYT? I repushed |
|
@xenoscopic I do have a question, I want to test this end to end manually, model-cli + model-distribution, my attempt is this: doesn't seem to work. I tried a couple of other things, didn't get anything to work. Searching for an efficient end to end workflow. Also another question along these lines, how can I see the prints/logs from each component in an end to end test like this if I do get it working. Preferably I'd like to run without containers. If possible. Rather than rebuild and re-run a whole container, just rebuild the binaries required during development. I tried to run I'm on Linux at the moment. I also get this when I try and build container images: |
|
Hey @ericcurtin
We should document this but model-cli will respect the in model-runner repo: And then set WRT the substance of this PR I am onboard with the idea of However, I think this implementation would result in the default namespace always appearing in the tag in the list. E.g. if you I think what we we want to do instead is:
I think the easiest way to get the behavior we want without causing inconsistencies would be set the default namespace for the parsing library to use or supply a |
c448de9 to
fba85f9
Compare
So we can set our own defaults Signed-off-by: Eric Curtin <ericcurtin17@gmail.com>
fba85f9 to
697724e
Compare
|
@ekcasey @xenoscopic how does this look? |
xenoscopic
left a comment
There was a problem hiding this comment.
Looks pretty good to me, happy to +1 once it passes CI. We really should get a +1 from @ilopezluna or @ekcasey though since they know the code much better.
| normalizedRef := normalizeReference(reference) | ||
|
|
||
| // Validate the normalized reference | ||
| if _, err := name.ParseReference(normalizedRef); err != nil { |
There was a problem hiding this comment.
It would be nice if we could avoid doing this twice, maybe we could just have a NoramlizeAndParseReference() function since most cases call ParseReference directly after Normalize.
|
|
||
| // Simple name - add default domain and official prefix | ||
| return defaultDomain + "/" + officialRepoPrefix + name | ||
| } No newline at end of file |
There was a problem hiding this comment.
The files are missing a trailing newline, which may be what's failing the linter. You'll need to do a go fmt ./registry/... on the PR.
| if err == nil { | ||
| t.Error("expected error when trying to connect to non-existent registry") | ||
| } |
There was a problem hiding this comment.
It would be a bit nicer if you could use errors.Is here to look for some sort of sentinel error (or, failing that, match on err.Error(), even though it's a bit fragile), otherwise we don't really know that the failure came after normalization.
| "testing" | ||
| ) | ||
|
|
||
| func TestNormalize(t *testing.T) { |
There was a problem hiding this comment.
Can you also add some tests for local registries, like localhost:5000/...?
|
Happy to keep this post monorepo merge also @xenoscopic don't want to block that |
|
@ericcurtin no worries, I think we can get it in before then. Most of my comments are just suggestions, I think the |
|
I found minor differences which I think are related with @ekcasey comment. For example having I'm not sure of the implications of this difference but it seems safer if we also consider the comparison as @ekcasey mentioned:
I've run into more issues, but I think its because something must be updated in the model-cli first, sharing just in case: Finally a comment about #126 (comment), sorry @xenoscopic for missing your message! |
|
We will address it in the mono repo, so closing this one |
So we can set our own defaults