-
Notifications
You must be signed in to change notification settings - Fork 901
integration: add OCI <-> Docker roundtrip tests #306
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
Conversation
|
👍 awesome, thanks @cyphar |
|
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 😄 |
542242c to
6fb41d2
Compare
|
Grrr. Integration tests are failing because we don't have |
don't we have that already? 😕 |
|
Actually, we do... I'm confused why I'm getting this error: What is |
6fb41d2 to
1aab322
Compare
integration/copy_test.go
Outdated
| defer os.RemoveAll(oci2) | ||
|
|
||
| // Docker -> OCI | ||
| assertSkopeoSucceeds(c, "", "--tls-verify=false", "--debug", "--remove-signatures", "copy", "docker://estesp/busybox:amd64", "oci:"+oci1+":latest") |
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.
just use busybox:latest - the amd64 tag is v2s1 only and v2s1->oci isn't implemented.
|
@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 |
923cd6d to
0af8ec3
Compare
😮 |
|
@cyphar I'm sorry I meant the official |
0af8ec3 to
92be06e
Compare
mtrmac
left a comment
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.
Thanks! This is fine and useful as is, the possible expansion of the test is just something to consider, definitely not a blocker.
integration/copy_test.go
Outdated
| // 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") |
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.
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?
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.
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.
92be06e to
fe6ac38
Compare
|
👍 assuming the tests pass, it is not immediately obvious to me why they are / have been failing. |
fe6ac38 to
8feae02
Compare
|
There seems to be another issue |
|
After running this locally, it looks like this is actually another issue with manifest conversion: Which basically ends up boiling down to "we didn't change the manifest type when converting to Docker distribution from OCI": |
|
So the plus side is that this test is already finding bugs. The downside is that this is a bug in the first place. |
|
Alright, this is actually caused by the same issue as containers/image#237. So it has been fixed in |
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]>
8feae02 to
3a7beeb
Compare
|
@runcom Doing it as we speak. It required re-vendoring other things. Oh, and I'm also adding |
|
@cyphar you may need to revendor the image-spec as well https://travis-ci.org/projectatomic/skopeo/builds/202194334#L1698 |
|
@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]>
3a7beeb to
eea384c
Compare
|
@runcom There, done. PTAL. |
|
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 |
|
I will be adding many more tests once |
|
❤️ |
Signed-off-by: Aleksa Sarai [email protected]