Skip to content

Conversation

@cyphar
Copy link
Contributor

@cyphar cyphar commented Dec 28, 2016

There have been a long string of bugs discovered while testing this
functionality, and it's quite important the we ensure that this doesn't
break.

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

There have been a long string of bugs discovered while testing this
functionality, and it's quite important the we ensure that this doesn't
break.

Signed-off-by: Aleksa Sarai <[email protected]>
@cyphar
Copy link
Contributor Author

cyphar commented Dec 28, 2016

DO NOT MERGE. This depends on containers/image#193 (thus also #279) and containers/image#143.

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.

(Very nitpicky comments, feel free to ignore; and most importantly, containers/image#192 needs to be decided first.)


// docker-archive -> OCI image layout
ociDest := "busybox-latest"
defer os.RemoveAll(ociDest)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this one not a TempDir as above? (Perhaps check how TestCopyDirSignature does this, with so many directories.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it should be a TempDir.

c.Assert(err, check.IsNil)
}

// Make sure that docker-archive is identical to docker.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not really describing the test… what would “a local file being identical to a remote repository” (or is it “to a daemon”) mean? And docker does nothing with OCI…

I guess, a test is a test is a test, and it is useful even if not explained, but knowing what is being tested could make it easier in the future to figure out whether a failure is a bug in the test or in the software being tested.

// "pull": docker: → docker-archive:
assertSkopeoSucceeds(c, "", "copy", "docker://busybox", "docker-archive:"+ar1+"/archive.tar:busybox")
// "copy": docker-archive: → dir:
assertSkopeoSucceeds(c, "", "copy", "docker-archive:"+ar1+"/archive.tar", "dir:"+dir1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it essential that this uncompressess the layers (per #279 and containers/image#193 ), or does it not matter here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This does matter for the test below. However, since the original idea behind containers/image#193 was NACK'd, the current system will have the blobs decompressed in the docker-archive: case but I don't think it'll happen in the docker:// case.

But first lets get the other stuff merged and we can figure out how to make a nice integration test once the code works.

assertSkopeoSucceeds(c, "", "copy", "docker-archive:"+ar1+"/archive.tar", "dir:"+dir1)
// "pull": docker: → dir:
assertSkopeoSucceeds(c, "", "copy", "docker://busybox", "dir:"+dir2)
out := combinedOutputOfCommand(c, "diff", "-urN", dir1, dir2)
Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, layers should match (either uncompressed or unmodified); but why should we expect the manifest, which has been thrown away in the copy to docker-archive:ar1, and generated from scratch in the copy from it, to match (and keep matching) byte-for-byte the manifest stored in the remote docker://busybox repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll split this test to look like #306, where we have a test that checks something that must be invariant but also an extra test that checks the things-that-should-be-the-same, with a comment explaining the situation.


// OCI image layout -> docker-archive
assertSkopeoSucceeds(c, "", "copy", "oci:"+ociDest, "docker-archive:"+ar2+"/archive.tar")
c.Assert(err, check.IsNil)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these two copies intended to be just a minimal smoke test, or is there a more specific kind of failure this is testing for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There were a variety of failures that would happen if you tried to test going from OCI to Docker, back to OCI then back to Docker. This is a smoke test to ensure that at the very least we don't have asymmetric issues with one side of the conversion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For example, the most recent series of issues we've seen would've been caught by this smoke test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

However, I will add some extra round-trip style tests (like #306) once the two important PRs are merged. I'm not going to waste time writing lots of detailed tests until we all agree on the implementations (especially semantics like compression, which massively change what invariants we can test).

@cyphar
Copy link
Contributor Author

cyphar commented Feb 15, 2017

#305 wouldn't have happened if we had these tests in place... sigh

@cyphar
Copy link
Contributor Author

cyphar commented Feb 15, 2017

I'm going to make a separate PR for doing regular OCI <-> Docker tests. Because really need these tests in place.

@mtrmac
Copy link
Contributor

mtrmac commented Feb 15, 2017

#305 wouldn't have happened if we had these tests in place... sigh

FWIW, note that containers/image#148 is still pending.

@cyphar
Copy link
Contributor Author

cyphar commented Feb 15, 2017

Yeah, which is why I've split out #306 so we get /some/ tests in place.

@rhatdan
Copy link
Member

rhatdan commented Aug 14, 2017

Is this pull request still being worked on ?

@cyphar
Copy link
Contributor Author

cyphar commented Aug 14, 2017

I haven't touched this in a while, but we still should include these tests. Also, there are some other issues that I've found in skopeo (such as the tags being lost bug) that we need to make sure don't get regressed on.

I'll rebase and rework this patch when I get a chance this week.

@rhatdan
Copy link
Member

rhatdan commented Mar 8, 2018

@cyphar This needs an update or it needs to be closed.

@cyphar
Copy link
Contributor Author

cyphar commented Mar 13, 2018

/me will rebase (and probably rewrite) this.

@rhatdan
Copy link
Member

rhatdan commented Sep 21, 2018

@cyphar Nothing has happened to this PR in 6 months, should I close?

@rhatdan
Copy link
Member

rhatdan commented Apr 25, 2019

@cyphar I am closing this since nothing has happened in over a year. Reopen if you are still interested in workin on it.

@rhatdan rhatdan closed this Apr 25, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 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