-
Notifications
You must be signed in to change notification settings - Fork 62
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
Allow specifying a separate target reference to push in kit push
#685
base: main
Are you sure you want to change the base?
Conversation
Add a two-argument version of `kit push` that allows pushing local modelkits without explicitly tagging them first. When specified with one argument, e.g. kit push example.com/myorg/myrepo:mytag we'll push the locally-tagged ModelKit as before. When specified with two arguments, e.g. kit push myorg/mymodel:mytag example.com/neworg/newrepo:newtag we'll push the locally tagged model to the remote registry under a differente repository
The modelkits should be tagged with the target registry and repository before | ||
they can be pushed` | ||
If specified without a destination, the ModelKit should be tagged locally before | ||
pushing.` |
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 think it "must" be tagged otherwise push will fail.
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.
Updated, but I think the wording here is generally strange -- if you type kit push quay.io/myorg/mymodel:latest
, what does that mean if you don't have a modelkit tagged quay.io/myorg/mymodel:latest
?
} | ||
if modelRef.Registry == "localhost" { | ||
return fmt.Errorf("registry is required when pushing") | ||
return fmt.Errorf("failed to parse reference %s: %w", args[0], err) | ||
} | ||
if len(extraTags) > 0 { | ||
return fmt.Errorf("reference cannot include multiple tags") |
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.
now that there are 2 references, we should qualify this one as source reference similiar to the dest one.
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 didn't want to complicate the wording too much (so we do distinguish them by labelling the target target
). If specified with one argument, calling it the source reference doesn't make a lot of sense to me, as it's both the source and destination.
opts.destModelRef = destRef | ||
} | ||
|
||
if opts.destModelRef.Registry == "localhost" { |
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.
localhost
is a valid use case in local testing. Is this making it impossible?
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.
Nope :)
This check has always been here -- it's because we adopted the podman convention of using localhost
as the registry placeholder in references (so that they're still valid). Local usage isn't impacted, since you would likely tag your ModelKit localhost:5050
, which doesn't match.
For context, we need a way to store and parse references to ModelKits that don't have full information, while the OCI spec requires both a registry
and repository
. For example, completely untagged ModelKits are represented localhost/_@<digest>
.
Description
Allow specifying a separate push target, so that you don't have to tag ModelKits locally before pushing (similar to what podman--but not docker--does).
Linked issues
I didn't create an issue for this one yet, but I figured it'd be useful while working on #684, which by default tags according to the HF repo