-
Notifications
You must be signed in to change notification settings - Fork 48
Create Image Tools Interface #26
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Image Tools Interface | ||
|
|
||
| The below document describes an interface for the OCI Image Tools project as desired by the OCI Certification Program working group (Cert WG.) | ||
|
|
||
| Goals: | ||
| * An engineer can verify a container image complies with the OCI Image Spec (https://github.com/opencontainers/image-spec/releases) | ||
|
|
||
| Inputs: | ||
| * (REQUIRED): Path or reference to a container image | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If distribution is out of scope of image-spec, what would a "reference" be? A |
||
| * (OPTIONAL): If the user would like verbose output | ||
| * (OPTIONAL): Which version of the OCI Image Spec to validate against | ||
| (IF the OCI Image Tool supports multiple OCI Image Spec versions; Default to highest supported) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. “IF” → “If”? |
||
|
|
||
| Outputs: | ||
| * Number of cases run | ||
| * Number of cases passed | ||
| * Number of cases failed | ||
| * List of cases failed | ||
| * Version of OCI Image Tools | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and maybe git commit of the tool? With this data points in a structured output (i.e. xml, json, etc) then it could be more deterministically used for badges, etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I like this, but note that in a similar context the OCI consensus (as voiced by @duglin here) was that a consistent API for extracting the implementation version was not required for interop.
Does this matter? Hopefully the version of the test suite/tools and the digest(s) of the tested object would be sufficient without recourse to the validation timestamp. Higher-level tooling can always add a timestamp if it feels it would be useful.
This is tricky for stuff outside of CAS. For example, if validation was pointed at an image-layout via a HTTP URL, or at a directory, what digest hash do you show for complaining about “I couldn't find
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replying to comments from @vbatts and @wking:
I was thinking that 'version of the OCI Image Tools' would be sufficient since only released versions of the tools will be relevant for image validation.
I didn't think of this, but it makes sense. I'll update the PR.
@vbatts Would you mind suggesting what this might look like?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| * Version of OCI Image Spec | ||
| * (IF VERBOSE) List of cases passed | ||
|
|
||
| ## Possible Example | ||
|
|
||
| INPUT: | ||
| `oci-image-tools image validate <image>` | ||
|
|
||
| OUTPUT (default): | ||
| ``` | ||
| OCI Image Tools vX.Y.Z validating <image> with OCI Image Spec vA.B.C: | ||
| Case 12: FAILED: Image using reserved field key: https://github.com/opencontainers/image-spec/blob/master/descriptor.md#reserved | ||
| Results: | ||
| * Ran: 24 / 24 (100%) validation cases | ||
| * Passed: 23 / 24 (96%) | ||
| * Failed: 1 / 24 (4%) | ||
| ``` | ||
|
|
||
| OUTPUT (verbose): | ||
| ``` | ||
| OCI Image Tools vX.Y.Z validating <image> with OCI Image Spec vA.B.C: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be good to look at rust's compiler error documentation for the items that might be required here for each error. As this is, it is a little hard to parse. Let's also take a peak at Go's output: Each line is marked as "starting test" and "ending test" ( Something like this might work: Notice that the status and result lines are marked with a leading character, leaving the other output to be expressive. There may be better characters than
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could also use TAP rather than making our own output format. |
||
| Case 1: PASSED: … | ||
| Case 2: PASSED: … | ||
| … | ||
| Case 12: FAILED: Image using reserved field key: https://github.com/opencontainers/image-spec/blob/master/descriptor.md#reserved | ||
| Case 13: PASSED: … | ||
| … | ||
| Case 24: PASSED: … | ||
| Results: | ||
| * Ran: 24 / 24 (100%) validation cases | ||
| * Passed: 23 / 24 (96%) | ||
| * Failed: 1 / 24 (4%) | ||
| ``` | ||
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.
Trailing whitespace on this line (and a few others):