Conversation
| return fmt.Errorf("failed to generate test data: %w", err) | ||
| } | ||
| } | ||
| // image with non-distributable layers |
There was a problem hiding this comment.
These tests appear to be conflating two concepts 😇
For lack of an officially spec-defined term, blobs whose descriptors include the urls key are colloquially known as "foreign layers", and technically any blob could be foreign (with zero change to the mediaType), although most registries probably validate config differently from layers in that respect (I know Docker Hub certainly does 😇).
Non-distributable layers (those with mediaType of application/vnd.oci.image.layer.nondistributable.v1.tar*), on the other hand, may or may not be explicitly "foreign" (ie, they may or may not have urls set).
-
This OPTIONAL property specifies a list of URIs from which this object MAY be downloaded.
-
https://github.com/opencontainers/image-spec/blob/v1.1.1/layer.md#non-distributable-layers
Descriptors referencing non-distributable layers MAY include
urlsfor downloading these layers directly; however, the presence of theurlsfield SHOULD NOT be used to determine whether or not a layer is non-distributable.
(For historical curiosity, this evolved/matured/split in two parts from the application/vnd.docker.image.rootfs.foreign.diff.tar.gzip media type in the previous "Docker Image Manifest Version 2, Schema 2" spec: https://github.com/distribution/distribution/blob/10e4312e62ab3b0c53bc0e31ade82fbe38af1b43/docs/content/spec/manifest-v2-2.md#:~:text=application/vnd.docker.image.rootfs.foreign.diff.tar.gzip%3A%20%22Layer%22%2C%20as%20a%20gzipped%20tar%20that%20should%20never%20be%20pushed -- this is where I've cribbed the term "foreign layer" from, because "blob/descriptor with urls set" is a mouthful.)
There was a problem hiding this comment.
Are you suggesting that we test non-distributable layers without a URL defined, and the blob is still not pushed. Or are you suggesting that we define a foreign layer test, where the URL is defined, but the media type is not a non-distributable media type?
There was a problem hiding this comment.
Yeah, as I clarified on the call yesterday (and writing here for posterity), I think I'm suggesting we should probably test all the permutations (urls and not urls, pushed blob and not pushed blob, and regular and nondistributable media types for both variances).
09d8222 to
335d913
Compare
4fa7051 to
ccbec5e
Compare
This reworks the conformance tests to verify the various APIs with different sets of data. The configuration allows various APIs and types of data to be disabled. The configuration will default to the tests appropriate for a specific version of the spec. However, new types of data may still be pushed when testing older versions of the spec. The tests are also designed to be run with `go build` rather than `go test`. This will allow the conformance tests themselves to be tested in the future. Attempts to run the tests with `go test` and the previous configuration variables should still work, but support for this is deprecated and warning will be included in the output to update. The results now include a new results.yaml including the configuration and the result of each API and type of data tested. Processing this on the oci-conformance repo requires a separate PR there. This redesign was necessary to allow the conformance tests to scale with the different types of data we are seeing. This includes data with a subject, artifacts, and new digest algorithms. Signed-off-by: Brandon Mitchell <git@bmitch.net>
5d4e2bf to
d4010d8
Compare
|
@opencontainers/distribution-spec-maintainers while looking at the options for reusing auth tokens between requests, I'm seeing the following options:
Is there a preference for which option we should use for the conformance test (at least pending the outcome of wg-auth)? |
|
I like Option 5 the most, but I'm not sure if it's completely safe. Given that these tests are for the dist spec (and there is no auth spec), I'm not terribly concerned about trying to match client behavior around auth, and so if Option 5 let's us reuse tokens the most and do these test faster, I'm all for it. That said, since there is no auth spec... I know this approach works for Docker Hub and several other registries, but it's not guaranteed that every registry generates tokens the same way off of repository and http method, so it could introduce unrelated errors. Because of that, Option 4 is probably the safest from a compatibility standpoint, and should at least provide marginal re-use. |
This is a redesign of the conformance tests with the following goals:
go test. This will allow unit testing and avoid some of the Go testing wrappers.This is still in draft for now, with this open PR for better visibility. Various remaining tasks include:
Other wish list items:
Merging this will unblock #543. Closes #548. Closes #501. Closes #416.