-
Notifications
You must be signed in to change notification settings - Fork 183
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
Simplifying the ORAS client experience #114
Comments
What do people think about simplifying the ORAS client experience?Initially,
with everything by default. It was easy and simple until we shfit lots of configs from defaults to CLI. Therefore, simplifying the ORAS client experience indeed follows the orignal philosophy of this tool. Does
|
Thanks @shizhMSFT, For the file name, I was hoping to see some other thoughts before commenting. |
@SteveLasker Please re-open this issue if it is still valid and up to date. |
Simplifying the ORAS Client Experience
When pushing artifacts to an OCI compliant registry, a
manifest.config.mediaType
is required to identify the artifact, andlayer.config.mediaType
s are required for each layer.As we look to improve on the current experiences, the current ORAS client requires either too little, defaulting in the wrong defaults, or too much, creating a less than productive experience, easy to make mistakes.
To provide a progressive disclosure experience, I'm proposing two changes:
orasConfig
file, enabling the user to provide the repetitive values to the oras client.unkown
mediaTypes
for the artifact and layers. ORAS mediaTypes should default to unknown #115Current Basic Example
Walking through a simple example, the user specifies the artifact path and the files.
This generates a manifest that defaults to
application/vnd.oci.image.config.v1+json
for the artifact andvnd.oci.image.layer.v1.tar
for the layers.This is incorrect, as
application/vnd.oci.image.config.v1+json
andvnd.oci.image.layer.v1.tar
are reserved for container images that would be instanced with the docker or containerD client. For the initial experience to be correct, the user must specify their type, which they may not be ready to think about.This is the context behind the two-stage proposal.
Providing
mediaTypes
To properly set the
mediaTypes
with the current version of the ORAS client, the user would have to provide a much more complex cli call:This isn't something the user would want to type each time. Considering these values don't change very often, requiring them to be entered each time leads to frustration and errors.
Optimizing for Usage
There are a few small enhancements we could make, such as a config file for defining the artifact
mediaType
.However, what do we do about the layer
mediaTypes
?I considered a mapping of extensions to
mediaTypes
However, this doesn't scale well as an artifact could likely use the same
.tar
or even.md
extension for several layer types.Even in the simplest case, the user would still need to pass in the collection of files, each time.
orasConfig
Artifact authors define these types once for an artifact. They continue to iterate, possibly adding new files. To simplify ORAS usage, either as a client or go library, an
orasConfig
is proposed.The elements to be stored in the mapping file include:
example:
demo42.azurecr.io
artifactName: The content addressable path to the artifact.
example:
demo42.azurecr.io/samples/docs-in-markdown:v1
artifactType: the single mediaType used to define the artifact.
example:
application/vnd.contoso.docs-in-markdown.config.v1+json
layerTypes: a collection of layer types used for the artifact.
example:
application/vnd.oci.image.layer.v1.tar
application/vnd.oci.image.layer.v1.tar+gzip
files: a collection of files to upload, mapped to a specific type, with wildcard support to minimize having to specify every file.
example:
Smart Defaults
Using a config file, the user could minimize the content they would type with the ORAS client:
or, we could make orasConfig.yaml a default, if found:
If the
orasConfig.yaml
isn't found, the ORAS client generates an error.orasConfig Format
The usual
yaml
vs.json
format debate is the obvious, but lets consider this file is mostly user editable. There's likely not a lot of content. For this reason, even with the normal space vs. tab yaml issues, I'm proposing the following yaml format.Why the Nested Layer Collections?
The types of artifacts likely group into 3 different scenarios:
Some artifact types, like the docker/OCI image format, depend on ordinal layers to build the filesystem layout. In these cases, it's critical the layers can be specified in a specific order, with their respective types.
In the above example, the first type
readme.layer
could be repeated aftercontent.layer
. This example is a bit contrived, but it future-proofs the design to support the three scenarios, without too much complexity.orasConfig Tokens
To support dynamic environments, environment variables would be supported.
Once the
orasConfig.yaml
file is defined, the user simply add/edits files in the collection. Or, iterates on the types. They can then simply typeoras push
from the directory of the orasConfig.yaml file.Correlation to Artifact Mapping Schema
The above proposal is not meant to be a replacement of the Artifact Mapping Definition
There are two use cases for development and publishing
What's in a Name?
The thing I'm most debating, and looking for suggestions, is how to name the 3 types of "config" files.
Assuming we agree to the following scenarios:
manifest.config.json
, used by artifact tooling. See Config Schema Validation for more info.Working reference of names:
Conversation
orasConfig
make sense when ORAS is used as a library?orasConfig.yaml
) ?The text was updated successfully, but these errors were encountered: