-
Notifications
You must be signed in to change notification settings - Fork 185
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: support oci layout target #692
Conversation
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Codecov Report
@@ Coverage Diff @@
## main #692 +/- ##
==========================================
- Coverage 73.17% 63.22% -9.95%
==========================================
Files 16 18 +2
Lines 574 688 +114
==========================================
+ Hits 420 435 +15
- Misses 123 220 +97
- Partials 31 33 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
cmd/oras/internal/option/target.go
Outdated
// Target option struct. | ||
type BinaryTarget struct { | ||
From Target | ||
To Target | ||
} |
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'm not a big fan of this target parameter. It seems like the type could be encoded in the source and destination like URIs. Create a factory method like you that creates a destination and sources based on the string. E.g.: oras cp file://image.tgz oci://harbor.mine.demo:30003/hello:latest
The default could be an oci registry so oras cp file://image.tgz harbor.mine.demo:30003/hello:latest
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.
Thanks @TerryHowe for reviewing this. Indeed, the OCI layout type could be encoded in the source and destination like URIs(and it's really a good user experience), but there are still other configurable options that requires user input:
- what is the source tag/digest for copying?
The example scenario you are giving should be copying from a local oci layout fileimage.tgz
towards a remote registryharbor.mine.demo:30003/hello
with taglatest
. We can useoci://
to specify the source type and ignorehttp(s)://
in the dest, so the command looks like below
oras cp oci://image.tgz harbor.mine.demo:30003/hello:latest
In the command, only the path of an oci-layout is provided but what should be copied from image.tgz
is not specified, either we create a new flag for that or we use a delimitor so user can specify both path and org.opencontainers.image.ref.name
at the same time.
- what is the type of oci-layout, is it a tarball or folder?
ORAS is able to speculate those if an oci layout target is the copy source, but what if the copy destination is an oci-layout?
Say thethe command is:oras cp harbor.mine.demo:30003/hello:latest oci://image
. Without dedicated flags,
the user can possibly want pullharbor.mine.demo:30003/hello:latest
and add it to 1) a local oci layout folder namedimage
; 2) a local oci layout tarball namedimage
;
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.
BTW I am still working on the design spec for supporting oci layout, will share it to you if once it's ready for review
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Will separate changes to smaller PRs |
close as it's merged |
This PR added a new flag
--oci
to support oci layout in all commands EXCEPT below:oras manifest delete
,oras blob delete
: oras-go doesn't support Garbage Collection for OCI targets.oras discover
: OCI layout referrer is not well designed in oras-go yet and graph predecessors won't contain artifact type.oras login
,oras logout
andoras repo ls
: OCI layout itself represents a local repository, not a remote registry and won't need to support those.The reference format of a OCI layout reference is
<path>[:<tag>|@<digest>]
You can:
ghcr.io/oras-project/oras
with tagv0.16.0
you can inspect the pulled image via
oci-layout
in registrysome.registry
with tagfrom-folder
, you can simply door push from a tarball