Skip to content

Compress import blobs in Docker compatibility code#3135

Merged
estesp merged 1 commit intocontainerd:masterfrom
dmcgowan:archive-importer-docker-types
Jul 17, 2019
Merged

Compress import blobs in Docker compatibility code#3135
estesp merged 1 commit intocontainerd:masterfrom
dmcgowan:archive-importer-docker-types

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

Ensure the manifest which gets created using the Docker compatibility code compresses the blob before creating the manifest. This ensures consistency with manifests generated by Docker.

Comment thread images/archive/importer.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the filter functionality is TODO item right now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ugh... well as long as this code doesn't panic, just shouldn't assume then that the result is non empty. Maybe an ok check on labels would be safer.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You are referring to the local implementation, the metadata store that will normally be used handles it. Either way, the implementation should always handle the case where the filter wasn't applied.

@thaJeztah
Copy link
Copy Markdown
Member

One test failing;

travis_time:start:0784a800
�[0K$ if [ "$GOOS" = "linux" ]; then sudo PATH=$PATH GOPATH=$GOPATH make integration ; fi
+ integration
�[36mINFO�[0m[0000] running tests against containerd              �[36mrevision�[0m=5efaa135ae416092734eec6353c9d41642d6e73f �[36mruntime�[0m=io.containerd.runc.v1 �[36mversion�[0m=v1.2.0-375-g5efaa13

...

--- FAIL: TestImport (0.50s)
    --- PASS: TestImport/DockerV2.0 (0.07s)
    --- FAIL: TestImport/DockerV2.1 (0.14s)
        import_test.go:117: unexpected layer hash sha256:901311b0a6763e6eaccf6a25884408c28f4168bdfd92f4a13a90b48505875ba7, expected sha256:352adfeb0dc6e28699635c5911cf33e2e0a86aedf85a5a99bba97749000ae1c7
    --- PASS: TestImport/OCI-BadFormat (0.01s)
    --- PASS: TestImport/OCI (0.09s)
    --- PASS: TestImport/OCIPrefixName (0.09s)
    --- PASS: TestImport/OCIPrefixName#01 (0.10s)

travis_time:start:0b23fc44
�[0K$ if [ "$GOOS" = "linux" ]; then sudo PATH=$PATH GOPATH=$GOPATH TESTFLAGS_PARALLEL=1 make integration ; fi
+ integration
�[36mINFO�[0m[0000] running tests against containerd              �[36mrevision�[0m=5efaa135ae416092734eec6353c9d41642d6e73f �[36mruntime�[0m=io.containerd.runc.v1 �[36mversion�[0m=v1.2.0-375-g5efaa13


--- FAIL: TestImport (0.50s)
    --- PASS: TestImport/DockerV2.0 (0.06s)
    --- FAIL: TestImport/DockerV2.1 (0.16s)
        import_test.go:117: unexpected layer hash sha256:901311b0a6763e6eaccf6a25884408c28f4168bdfd92f4a13a90b48505875ba7, expected sha256:352adfeb0dc6e28699635c5911cf33e2e0a86aedf85a5a99bba97749000ae1c7
    --- PASS: TestImport/OCI-BadFormat (0.01s)
    --- PASS: TestImport/OCI (0.08s)
    --- PASS: TestImport/OCIPrefixName (0.09s)
    --- PASS: TestImport/OCIPrefixName#01 (0.09s)

@dmcgowan dmcgowan force-pushed the archive-importer-docker-types branch from 91e7f40 to d487167 Compare April 3, 2019 22:59
@dmcgowan dmcgowan added this to the 1.3-beta.0 milestone Apr 3, 2019
@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 4, 2019

Codecov Report

Merging #3135 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3135   +/-   ##
=======================================
  Coverage   45.24%   45.24%           
=======================================
  Files         111      111           
  Lines       11978    11978           
=======================================
  Hits         5419     5419           
  Misses       5725     5725           
  Partials      834      834
Flag Coverage Δ
#linux 49.28% <ø> (ø) ⬆️
#windows 40.59% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9bc2315...8d1ae23. Read the comment docs.

Comment thread images/archive/importer.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"failed to truncate writer`?

Comment thread images/archive/importer.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"failed to commit"?

Comment thread images/archive/importer.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not specific to this PR, but we should have const and godoc for labels

Comment thread import_test.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can we use t.Fatal?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not necessary, these are errors which should never occur but I much prefer panic to assigning to _

Ensure the manifest which gets created using the Docker
compatibility code compresses the blob before creating
the manifest. This ensures consistency with manifests
used by Docker.

Signed-off-by: Derek McGowan <[email protected]>
@dmcgowan dmcgowan force-pushed the archive-importer-docker-types branch from d487167 to 8d1ae23 Compare April 4, 2019 17:35
Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 129942c into containerd:master Jul 17, 2019
@dmcgowan dmcgowan deleted the archive-importer-docker-types branch September 10, 2019 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants