Skip to content

Conversation

@cyphar
Copy link
Contributor

@cyphar cyphar commented Feb 15, 2017

Signed-off-by: Aleksa Sarai [email protected]

@runcom
Copy link
Member

runcom commented Feb 15, 2017

👍

awesome, thanks @cyphar

@cyphar
Copy link
Contributor Author

cyphar commented Feb 15, 2017

Wait, wait. I pushed this so I can test it because Docker takes forever here. 😉

@runcom
Copy link
Member

runcom commented Feb 15, 2017

Wait, wait. I pushed this so I can test it because Docker takes forever here.

yeah, it was an OK from the on the intention 😄

@cyphar cyphar force-pushed the oci-roundtrip-tests branch 2 times, most recently from 542242c to 6fb41d2 Compare February 15, 2017 15:11
@cyphar
Copy link
Contributor Author

cyphar commented Feb 15, 2017

Grrr. Integration tests are failing because we don't have docker-archive. Maybe if I implement docker:// -> oci: conversion this will become easier?

@runcom
Copy link
Member

runcom commented Feb 15, 2017

Maybe if I implement docker:// -> oci: conversion this will become easier?

don't we have that already? 😕

@cyphar
Copy link
Contributor Author

cyphar commented Feb 15, 2017

Actually, we do... I'm confused why I'm getting this error:

time="2017-02-15T15:26:41Z" level=fatal msg="Error creating an updated image manifest: Conversion of image manifest from application/vnd.docker.distribution.manifest.v1+prettyjws to application/vnd.oci.image.manifest.v1+json is not implemented" 

What is ourRegistry running and why the hell is it broken?

@cyphar cyphar force-pushed the oci-roundtrip-tests branch from 6fb41d2 to 1aab322 Compare February 15, 2017 15:33
defer os.RemoveAll(oci2)

// Docker -> OCI
assertSkopeoSucceeds(c, "", "--tls-verify=false", "--debug", "--remove-signatures", "copy", "docker://estesp/busybox:amd64", "oci:"+oci1+":latest")
Copy link
Member

@runcom runcom Feb 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just use busybox:latest - the amd64 tag is v2s1 only and v2s1->oci isn't implemented.

@runcom
Copy link
Member

runcom commented Feb 15, 2017

@cyphar you have some flags-related issues in the tests and also, please take into account my comment #306 (comment) about not using that busybox tag

@cyphar cyphar force-pushed the oci-roundtrip-tests branch 2 times, most recently from 923cd6d to 0af8ec3 Compare February 15, 2017 16:25
@cyphar
Copy link
Contributor Author

cyphar commented Feb 15, 2017

@runcom

time="2017-02-15T16:40:37Z" level=fatal msg="can not copy docker://estesp/busybox:latest: manifest contains multiple images" 

😮

@runcom
Copy link
Member

runcom commented Feb 15, 2017

@cyphar I'm sorry I meant the official busybox:latest image not estesp/busybox:latest

Copy link
Contributor

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is fine and useful as is, the possible expansion of the test is just something to consider, definitely not a blocker.

// Docker -> OCI
assertSkopeoSucceeds(c, "", "--tls-verify=false", "--debug", "copy", ourRegistry+"busybox:oci_copy", "oci:"+oci2+":another-tag")
// OCI -> Docker
assertSkopeoSucceeds(c, "", "--tls-verify=false", "--debug", "copy", "oci:"+oci2+":another-tag", ourRegistry+"busybox:oci_copy2")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an obvious kind of comparison that can be done in here to make sure that we do not only don’t report any error, but that we actually copy and convert the images succesfully?

Perhaps check that oci1’s and busybix_oci_copy2 list of layer digests is exactly the same? That the config is identical between oci and oci2, between the two ourRegistry/busybox copies?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was thinking of doing that. First I'm just trying to get this to pass (I'm getting weird registry errors). Still working on it. And I can't run it locally because Docker appears to be broken on my machine.

@cyphar cyphar force-pushed the oci-roundtrip-tests branch from 92be06e to fe6ac38 Compare February 15, 2017 17:58
@mtrmac
Copy link
Contributor

mtrmac commented Feb 15, 2017

👍 assuming the tests pass, it is not immediately obvious to me why they are / have been failing.

@cyphar cyphar force-pushed the oci-roundtrip-tests branch from fe6ac38 to 8feae02 Compare February 15, 2017 18:13
@runcom
Copy link
Member

runcom commented Feb 15, 2017

There seems to be another issue

@cyphar
Copy link
Contributor Author

cyphar commented Feb 16, 2017

After running this locally, it looks like this is actually another issue with manifest conversion:

ERRO[0129] response completed with error                 err.code=manifest unknown err.detail=errors verifying manifest: unrecognized manifest content type  err.message=manifest unknown go.version=go1.7.5 http.request.host=localhost:5555 http.request.id=3c0d5fa4-9df2-4d45-8
d85-a2e81d3a69fe http.request.method=GET http.request.remoteaddr=127.0.0.1:58722 http.request.uri=/v2/busybox/manifests/latest http.request.useragent=Go-http-client/1.1 http.response.contenttype=application/json; charset=utf-8 http.response.duration=1.544431ms http.response
.status=404 http.response.written=84 instance.id=2334cfb3-48f9-4a5d-8692-0cbbc26c1cf8 vars.name=busybox vars.reference=latest version=v2.1.0+unknown
127.0.0.1 - - [16/Feb/2017:09:42:16 +0000] "GET /v2/busybox/manifests/latest HTTP/1.1" 404 84 "" "Go-http-client/1.1"

Which basically ends up boiling down to "we didn't change the manifest type when converting to Docker distribution from OCI":

%  cat /tmp/registry/docker/registry/v2/blobs/sha256/56/560799532c865dc38f12595b8a7eb8b602c9fcb608df90abe89499e6a0135483/data
{"schemaVersion":2,"config":{"mediaType":"application/vnd.oci.image.config.v1+json","size":575,"digest":"sha256:34166908e15c5badddab5191bca8bd0e4f429aeeecfba5ac37b387d9bb57b65b"},"layers":[{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":677628,"digest":"sha256:4b0bc1c4050b03c95ef2a8e36e25feac42fd31283e8c30b3ee5df6b043155d3c"}]}

@cyphar
Copy link
Contributor Author

cyphar commented Feb 16, 2017

So the plus side is that this test is already finding bugs. The downside is that this is a bug in the first place.

@cyphar
Copy link
Contributor Author

cyphar commented Feb 16, 2017

Alright, this is actually caused by the same issue as containers/image#237. So it has been fixed in containers/image.

@runcom
Copy link
Member

runcom commented Feb 16, 2017

Alright, this is actually caused by the same issue as containers/image#237. So it has been fixed in containers/image.

can you revendor as part of this PR?

This includes fixes required to add OCI roundtrip integration tests
(namely f9214e1d9d5d ("oci: remove MIME type autodetection")).

Signed-off-by: Aleksa Sarai <[email protected]>
@cyphar cyphar force-pushed the oci-roundtrip-tests branch from 8feae02 to 3a7beeb Compare February 16, 2017 10:27
@cyphar
Copy link
Contributor Author

cyphar commented Feb 16, 2017

@runcom Doing it as we speak. It required re-vendoring other things. Oh, and I'm also adding image-tools validation so we can be even more sure about the validity of the output.

@runcom
Copy link
Member

runcom commented Feb 16, 2017

@cyphar you may need to revendor the image-spec as well https://travis-ci.org/projectatomic/skopeo/builds/202194334#L1698

@cyphar
Copy link
Contributor Author

cyphar commented Feb 16, 2017

@runcom Trust me, it's much more than that. Wait for the commit message, I've had to revendor at least 7 projects.

@runcom
Copy link
Member

runcom commented Feb 16, 2017

@runcom Trust me, it's much more than that. Wait for the commit message, I've had to revendor at least 7 projects.

I see, ping me when done pls, I want this merged asap

This test is just a general smoke test to make sure there are no errors
with skopeo, but also verifying that after passing through several
translation steps an OCI image will remain in fully working order.

Signed-off-by: Aleksa Sarai <[email protected]>
In order to make sure that we don't create invalid OCI images that are
consistently invalid, add additional checks to ensure that both of the
generated OCI images in the round-trip test are valid according to the
upstream validator.

This commit vendors the following packages (deep breath):
* oci/image-tools@7575a093636327fc41bdb043a581d04b78cae233, which requires
* oci/[email protected] [revendor, but is technically an update
  because I couldn't figure out what version was vendored last time]
* oci/[email protected]
* xeipuuv/gojsonschema@6b67b3f
* xeipuuv/gojsonreference@e02fc20
* xeipuuv/gojsonpointer@e0fe6f6
* go4org/go4@7ce08ca

Signed-off-by: Aleksa Sarai <[email protected]>
@cyphar cyphar force-pushed the oci-roundtrip-tests branch from 3a7beeb to eea384c Compare February 16, 2017 11:51
@cyphar
Copy link
Contributor Author

cyphar commented Feb 16, 2017

@runcom There, done. PTAL.

@cyphar
Copy link
Contributor Author

cyphar commented Feb 16, 2017

The "warnings" in the log are because opencontainers/image-spec#548 (or opencontainers/image-spec#560) hasn't been merged yet. But the actual validation is working as expected, and this is similar validation to the kind I'm doing in umoci (though in umoci it's much more extreme).

@cyphar
Copy link
Contributor Author

cyphar commented Feb 16, 2017

I will be adding many more tests once docker-archive is merged. This is just a stop-gap to guarantee things don't break in the meantime.

@runcom runcom merged commit 226dc99 into containers:master Feb 16, 2017
@cyphar
Copy link
Contributor Author

cyphar commented Feb 16, 2017

❤️

@cyphar cyphar deleted the oci-roundtrip-tests branch February 16, 2017 12:15
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants