Skip to content

add check that snapshotter supports the image platform when unpacking#3927

Merged
mxpv merged 1 commit intocontainerd:masterfrom
katiewasnothere:snapshotter_check
Dec 16, 2020
Merged

add check that snapshotter supports the image platform when unpacking#3927
mxpv merged 1 commit intocontainerd:masterfrom
katiewasnothere:snapshotter_check

Conversation

@katiewasnothere
Copy link
Copy Markdown

This work is to prevent a snapshotter from attempting to unpack an image with a platform the snapshotter doesn't support.

For example, a windows snapshotter attempting to unpack an image with a target linux/amd64 platform. Previously, the snapshotter would attempt to unpack this image and fail with an obscure message. This work instead returns an error earlier on indicating the underlying issue that the snapshotter doesn't support the target image platform.

Additionally updated the target windows image used for testing.

Signed-off-by: Kathryn Baldauf [email protected]

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jan 3, 2020

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jan 3, 2020

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jan 4, 2020

Build succeeded.

@jterry75
Copy link
Copy Markdown
Contributor

jterry75 commented Jan 6, 2020

GOGC=75 golangci-lint run
�[1mclient.go:788�[0m:24: �[31m`platfroms` is a misspelling of `platforms`�[0m (misspell)
	log.G(ctx).WithField("platfroms", snPlatforms).Info("snapshotter supported platforms")
	                      �[33m^�[0m
Makefile:124: recipe for target 'check' failed

@jterry75
Copy link
Copy Markdown
Contributor

jterry75 commented Jan 6, 2020

@crosbymichael - Daemon seems to be panicking with this change. Do we have the panic.log anywhere to inspect?

@jterry75
Copy link
Copy Markdown
Contributor

jterry75 commented Jan 6, 2020

It could also be a deadlock I guess due to the client timeout on every test.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 6, 2020

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 6, 2020

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 6, 2020

Build succeeded.

@katiewasnothere
Copy link
Copy Markdown
Author

@crosbymichael could someone PTAL, sorry it's been a while 😁

@kzys
Copy link
Copy Markdown
Member

kzys commented Nov 16, 2020

Looks good to me. I'm not a reviewer though.

@mxpv
Copy link
Copy Markdown
Member

mxpv commented Nov 18, 2020

Should we make this check optional (or up to client)? I can think of cross platform scenario: for instance if we use linux only dev mapper snapshotter to get a windows image and run it on a VM?

@katiewasnothere
Copy link
Copy Markdown
Author

katiewasnothere commented Nov 18, 2020

Should we make this check optional (or up to client)? I can think of cross platform scenario: for instance if we use linux only dev mapper snapshotter to get a windows image and run it on a VM?

@mxpv Yeah that seems like a fair thing to do. Do you have any suggestions on how we should expose this option to the client?

@tonistiigi
Copy link
Copy Markdown
Member

FYI #2469

Buildkit uses a wrapper around differ/applier to support the migration between Linux layer tarballs and Windows layer tarballss. Ideally, containerd would do it itself.

For buildkit use case, it is certainly important to unpack layers for a different Linux architecture. For cross-building you may just unpack and copy new files without the ability to run them or you can run them with an emulator.

@mxpv
Copy link
Copy Markdown
Member

mxpv commented Nov 18, 2020

@mxpv Yeah that seems like a fair thing to do. Do you have any suggestions on how we should expose this option to the client?

How do you feel about adding an UnpackOpt ? Something like Image.Unpack(WithSnapshotterPlatformCheck)?

For buildkit use case, it is certainly important to unpack layers for a different Linux architecture.

yup, another use case to have this as an optional check.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Dec 9, 2020

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Dec 9, 2020

Build succeeded.

@katiewasnothere
Copy link
Copy Markdown
Author

@mxpv Done :)

Copy link
Copy Markdown
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.

This looks great just one small comment.

Comment thread client.go Outdated
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Dec 10, 2020

Build succeeded.

Copy link
Copy Markdown
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. Thanks!

@katiewasnothere
Copy link
Copy Markdown
Author

@mxpv or @jterry75 can we merge this?

@mxpv mxpv merged commit a5f9613 into containerd:master Dec 16, 2020
@katiewasnothere katiewasnothere deleted the snapshotter_check branch December 16, 2020 22:40
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.

5 participants