Make OCI code reuseable across projects without Zarf #2286
AustinAbro321
started this conversation in
Ideas
Replies: 1 comment
-
Note we should let uds-cli know the following:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background
Currently Zarf is a CLI with portions of it's code available as a library; part of this library is OCI functions for Zarf packages. These functions have become generally useful across Defense Unicorns projects such as UDS CLI. However, we do not adhere to the same promises around breaking changes as we do for general zarf cli usage. This can lead to difficulty for consumers of Zarf as a library to keep pace and not cause churn around breaking changes. Additionally, the code is currently heavily opinionated towards Zarf and needs to be refactored to be more useful for other projects. It can also be slow to contribute to the Zarf library as it is coupled to the Zarf release cycle.
Objective
Goals
Non-goals
Terminology
ORAS - https://oras.land/docs/. All references to ORAS refer to
oras-go/v2
layers - https://github.com/opencontainers/image-spec/blob/main/layer.md. In our case, layers are not built in a series of steps. They represent the paths of a filesystem.
remote - ORAS's
remote.Repository
descriptor - https://github.com/opencontainers/image-spec/blob/main/descriptor.md
Design
This library will be an opinionated wrapper client around the ORAS library to make it easier to execute common OCI operations such as pull, push, copy, and fetch. The client leverages the go option pattern for optional instantiation parameters.
Pull functions pull down layers either from descriptors or paths, via the
org.opencontainers.image.title
annotation.Push functions take in content and push to the remote repository.
Copy takes in two remotes and copies all the contents from one remote to another. Manifest creation and tagging is handled outside of this copy function. ProgressWriter is an interface in this package accepted as an optional parameter. It allows callers to write to a progress bar as the contents are copied.
This library will maintain a thin wrapper around
ocispec.Manifest
for ease of use for certain common manifest queries.Similarly we expose some utility functions for common ORAS / descriptor use cases.
Beta Was this translation helpful? Give feedback.
All reactions