Skip to content

Make default platform configurable in the client#3609

Merged
dmcgowan merged 1 commit intocontainerd:masterfrom
Random-Liu:add-image-with-platform
Sep 4, 2019
Merged

Make default platform configurable in the client#3609
dmcgowan merged 1 commit intocontainerd:masterfrom
Random-Liu:add-image-with-platform

Conversation

@Random-Liu
Copy link
Copy Markdown
Member

@Random-Liu Random-Liu commented Sep 1, 2019

For containerd/cri#1257

The default platform may not always work, we should have getters for users to specify platforms.

In the CRI plugin, our first planned milestone for windows support is WCOW with process isolation only (previous discussion). And the default platform matcher in containerd won't work for that, because LCOW is included.

Signed-off-by: Lantao Liu [email protected]

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Sep 1, 2019

Build succeeded.

@codecov-io
Copy link
Copy Markdown

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3609   +/-   ##
=======================================
  Coverage   42.38%   42.38%           
=======================================
  Files         126      126           
  Lines       13900    13900           
=======================================
  Hits         5891     5891           
  Misses       7123     7123           
  Partials      886      886
Flag Coverage Δ
#linux 45.9% <ø> (ø) ⬆️
#windows 37.2% <ø> (ø) ⬆️

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 95301fe...9996b75. Read the comment docs.

1 similar comment
@codecov-io
Copy link
Copy Markdown

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3609   +/-   ##
=======================================
  Coverage   42.38%   42.38%           
=======================================
  Files         126      126           
  Lines       13900    13900           
=======================================
  Hits         5891     5891           
  Misses       7123     7123           
  Partials      886      886
Flag Coverage Δ
#linux 45.9% <ø> (ø) ⬆️
#windows 37.2% <ø> (ø) ⬆️

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 95301fe...9996b75. Read the comment docs.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Sep 1, 2019

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3609   +/-   ##
=======================================
  Coverage   42.38%   42.38%           
=======================================
  Files         126      126           
  Lines       13901    13901           
=======================================
  Hits         5892     5892           
  Misses       7123     7123           
  Partials      886      886
Flag Coverage Δ
#linux 45.91% <ø> (ø) ⬆️
#windows 37.2% <ø> (ø) ⬆️

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 b039c39...555cb31. Read the comment docs.

@dmcgowan
Copy link
Copy Markdown
Member

dmcgowan commented Sep 3, 2019

The current interface is limiting, however, passing the platform in does not seem like the ideal interface either. Could we have the default platform as configurable within the client. I am assuming that in the case of LCOW support we will want a platform matcher which can match both LCOW and WCOW and handle the ordering between those. How are these functions expected to be invoked?

@dmcgowan dmcgowan added this to the 1.4 milestone Sep 3, 2019
@Random-Liu
Copy link
Copy Markdown
Member Author

Random-Liu commented Sep 3, 2019

@dmcgowan The platform matcher for WCOW (process isolation) is different from WCOW (hyper-V), because the OS version has to be matched. https://github.com/Random-Liu/cri-containerd/blob/windows-support/pkg/containerd/platforms/default_windows.go

Having it in upstream containerd means that we need different matchers for WCOW (process isolation), WCOW (hyperV) and LCOW. Not sure whether we want to do that.

Examples of how these functions will be invoked https://github.com/Random-Liu/cri-containerd/blob/windows-support/pkg/server/image_pull.go#L224

@dmcgowan
Copy link
Copy Markdown
Member

dmcgowan commented Sep 3, 2019

The invocation you linked seems like it could also work with just setting the default platform matcher in the client, rather than using a global default. This would make the client more configurable for those cases where you want the default PlatformMatcher to either be something custom like you linked to, a matcher which is capable of being configured to match both LCOW and WCOW (with an variation of using os version).

@Random-Liu
Copy link
Copy Markdown
Member Author

Random-Liu commented Sep 3, 2019

@dmcgowan Setting a default in the client works much better for me. I thought about that, but not sure whether people will be OK with that slightly bigger change. :)

If we all think that's better, let's do that then! :D

@Random-Liu Random-Liu force-pushed the add-image-with-platform branch from 9996b75 to 555cb31 Compare September 3, 2019 20:34
@Random-Liu
Copy link
Copy Markdown
Member Author

@dmcgowan Done

Comment thread client_opts.go
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

@Random-Liu
Copy link
Copy Markdown
Member Author

I think I also need to handle platforms.DefaultString(). Will do soon.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Sep 3, 2019

Build succeeded.

@Random-Liu
Copy link
Copy Markdown
Member Author

I think I also need to handle platforms.DefaultString(). Will do soon.

NVM. That is used for runtime (runtime spec) selection, which doesn't seem related to the image platform matcher.

@Random-Liu Random-Liu changed the title Add image getters with platform. Make default platform configurable in the client Sep 3, 2019
Copy link
Copy Markdown
Member

@fuweid fuweid 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
Copy Markdown
Contributor

jterry75 commented Sep 4, 2019

@katiewasnothere - FYI

@dmcgowan dmcgowan modified the milestones: 1.4, 1.2.9, 1.3 Sep 4, 2019
@jterry75
Copy link
Copy Markdown
Contributor

jterry75 commented Sep 4, 2019

@dmcgowan - Anything else you want here. LGTM

Copy link
Copy Markdown
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 59a625d into containerd:master Sep 4, 2019
@Random-Liu Random-Liu deleted the add-image-with-platform branch September 5, 2019 00:44
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