Skip to content

Conversation

@TBBle
Copy link
Contributor

@TBBle TBBle commented Jul 16, 2020

archive/tar_windows.go mostly consisted of two large functions reimplementing functions in https://github.com/microsoft/go-winio/, which is already a dependency of this file.

This uses those functions instead, as a deduplication, and preparation for implementing diff.Comparer, per #4394.

Note that until microsoft/go-winio#175 is merged and vendored, this brings in a fork of Go's archive/tar, used as winio_tar only in archive/tar_windows.go. Once that lands, the changes in archive/tar.go and archive/tar_opts.go can be reverted. <== This is now done in v0.4.15.

https://github.com/microsoft/go-winio/ is revendored from v0.4.14 to v0.4.15, but most of the upstream changes were in code that vndr excluded before this PR anyway, and the changes that are included (see 8b05980ba5467b2c61815bf74cf82f73dd3dff64) are trivial refactorings. Edit: Rebased on the move from vndr to Go Modules, which had already pulled in 0.4.15.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jul 16, 2020

Build succeeded.

@TBBle TBBle force-pushed the use_gowinio_for_reading_tarballs branch from 613d3c6 to 9ad6300 Compare July 17, 2020 05:42
@theopenlab-ci
Copy link

theopenlab-ci bot commented Jul 17, 2020

Build succeeded.

@TBBle
Copy link
Contributor Author

TBBle commented Jul 17, 2020

I'd note that it makes sense to keep the API passing the io.Reader rather than a TarReader, because the current (unpublished) hcsshim API that implements the remaining layer-specific code takes an io.Reader as well. Although it doesn't currently provide a way to interrupt the process via ctx as applyWindowsLayer does.

@thaJeztah
Copy link
Member

@tonistiigi PTAL

@TBBle TBBle force-pushed the use_gowinio_for_reading_tarballs branch from 9ad6300 to 4230671 Compare July 17, 2020 18:04
@theopenlab-ci
Copy link

theopenlab-ci bot commented Jul 17, 2020

Build succeeded.

@TBBle TBBle changed the title Use go-winio for reading tarballs Use go-winio for applying tarballs Jul 17, 2020
@TBBle TBBle force-pushed the use_gowinio_for_reading_tarballs branch from 4230671 to 31362ec Compare July 21, 2020 09:43
@theopenlab-ci
Copy link

theopenlab-ci bot commented Jul 21, 2020

Build succeeded.

@TBBle TBBle mentioned this pull request Jul 21, 2020
8 tasks
@jterry75
Copy link
Contributor

@kevpar - ptal

@jterry75
Copy link
Contributor

@ambarve - PTAL

@TBBle TBBle force-pushed the use_gowinio_for_reading_tarballs branch from 31362ec to 206d7a4 Compare July 28, 2020 13:13
@theopenlab-ci
Copy link

theopenlab-ci bot commented Jul 28, 2020

Build succeeded.

@ambarve
Copy link
Contributor

ambarve commented Jul 28, 2020

LGTM!

@TBBle TBBle force-pushed the use_gowinio_for_reading_tarballs branch from 206d7a4 to 9229633 Compare July 30, 2020 16:50
@theopenlab-ci
Copy link

theopenlab-ci bot commented Jul 30, 2020

Build succeeded.

@TBBle
Copy link
Contributor Author

TBBle commented Jul 31, 2020

recheck

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jul 31, 2020

Build succeeded.

@TBBle
Copy link
Contributor Author

TBBle commented Jul 31, 2020

recheck

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jul 31, 2020

Build succeeded.

@TBBle
Copy link
Contributor Author

TBBle commented Jul 31, 2020

recheck

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jul 31, 2020

Build succeeded.

@TBBle
Copy link
Contributor Author

TBBle commented Aug 16, 2020

As noted at microsoft/go-winio#175 (comment), we might need to merge and vendor microsoft/go-winio#175 before this goes in, as there's possibly a regression here in applying any Windows Container layers containing a file larger than 8gB (although I haven't confirmed this regression: the go-winio bug is about creating layers (microsoft/Windows-Containers#43 (comment)), so I'm assuming it has the same bug in applying layers, but it is only an assumption).

However, the only code I'm aware of for creating WIndows Container layers is in https://github.com/microsoft/go-winio/ anyway (containerd can't do it until #4399 which depends on this PR, and Docker Engine uses the go-winio code: moby/moby#40444) so I suspect there's literally no existing Windows Container images containing a file larger than 8gB anyway.

Unless moby/moby#40444 was a regression, and it used to work, but I've never seen a working version. That would imply Docker Engine used to contain better layer creation code, which would be weird.

@olljanat
Copy link
Contributor

@jterry75 I think that it is time to you look this one as @ambarve did leave LGTM comment after your request but it this be reviewed by someone on maintainer role (+ this is very Windows specific change).

@kevpar
Copy link
Member

kevpar commented Sep 14, 2020

LGTM (not a maintainer). This looks to be mostly changing from an implementation in containerd/containerd to the implementation that was added in Microsoft/go-winio, but the actual code is pretty much the same.

As far as I can tell, any concern about working with 8GB+ files would have already been present, unless I'm missing something.

@kevpar
Copy link
Member

kevpar commented Sep 14, 2020

Justin is currently on leave, so I don't think he will be able to look. We should try to get another maintainer to take a look.

@TBBle
Copy link
Contributor Author

TBBle commented Sep 15, 2020

The 8gB file bug was in this PR before I rebased on microsoft/go-winio#175. So it's not here now, but was here up until September 9th.

The bug doesn't exist in current master, because it's using archive/tar from Go, the same thing go-winio was changed to use in that PR.

@TBBle TBBle force-pushed the use_gowinio_for_reading_tarballs branch from 1e3629c to b29981a Compare November 28, 2020 07:34
@TBBle
Copy link
Contributor Author

TBBle commented Nov 28, 2020

Rebased to current master, and go-winio revendored to v0.4.15 (no relevant changes compared to the previous commit-SHA I was using).

@theopenlab-ci
Copy link

theopenlab-ci bot commented Nov 28, 2020

Build succeeded.

@thaJeztah
Copy link
Member

@dmcgowan @tonistiigi @stevvooe ptal

@jterry75
Copy link
Contributor

@kevpar - You still good with this? I can sign off

TBBle added 3 commits December 3, 2020 02:40
Signed-off-by: Paul "TBBle" Hampson <[email protected]>
applyFunc now takes an io.Reader instead of a tar.Reader because I'm
trying to mirror the API of the not-yet-exposed implementation of this
same behaviour in github.com/Microsoft/hcsshim/internal/ociwclayer,
with an eye to later moving to that implementation it is ever exposed.

Signed-off-by: Paul "TBBle" Hampson <[email protected]>
Specifically, all the functions above applyWindowsLayer are actually
used by the (generic) applyNaive code, while the functions below this
point are specific to applyWindowsLayer.

Signed-off-by: Paul "TBBle" Hampson <[email protected]>
@TBBle TBBle force-pushed the use_gowinio_for_reading_tarballs branch from b29981a to 78f31af Compare December 2, 2020 15:43
@TBBle
Copy link
Contributor Author

TBBle commented Dec 2, 2020

Rebased for Go Modules support, no code-changes were required. Also, huzzah, Modules.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Dec 2, 2020

Build succeeded.

@TBBle
Copy link
Contributor Author

TBBle commented Dec 2, 2020

Test failure in Linux Integration is surely unrelated to my changes. I'm sure I've seen that losetup randomly in other CI runs.

@ambarve
Copy link
Contributor

ambarve commented Dec 4, 2020

LGTM!
@jterry75 Can you merge this? Thanks.

Copy link
Contributor

@jterry75 jterry75 left a comment

Choose a reason for hiding this comment

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

LGTM

@jterry75
Copy link
Contributor

jterry75 commented Dec 4, 2020

@TBBle - Agree this change should not have affected the test issue here.

@jterry75
Copy link
Contributor

jterry75 commented Dec 4, 2020

@thaJeztah / @tonistiigi - Either of you want to take a look here. I am good with this change.

Copy link
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 - I re-ran tests but the actions runner IP actually hit DockerHub pull rate limits.. our first time, that I'm aware of :)

Windows and Linux integration ran against the PR (as well as unit tests); cgroups/SELinux testing is immaterial for this PR.

Copy link
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM

@dmcgowan dmcgowan merged commit 9c398e1 into containerd:master Dec 6, 2020
@TBBle TBBle deleted the use_gowinio_for_reading_tarballs branch December 7, 2020 02:45
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.

8 participants