Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mountpoint as CRI image filesystem storage identifier. #59475

Merged
merged 1 commit into from
Feb 9, 2018

Conversation

Random-Liu
Copy link
Member

@Random-Liu Random-Liu commented Feb 7, 2018

Fixes #57356.

This PR changes CRI to use mountpoint as storage identifier. See #57356 (comment).

Note that:

  1. This doesn't work with devicemapper for now. Please feel free to propose change for device mapper, we can discuss more about this after this first version is merged. @mrunalp @runcom
  2. mountpoint is added as new field in StorageIdentifier now. After Update Container Runtime Interface to use enumerated namespace modes #58973 is merged, we can remove the UUID field in v1alpha2.

/cc @yujuhong @feiskyer @yguo0905 @dashpole @mikebrow @abhi @kubernetes/sig-node-api-reviews

Release note:

CRI starts using moutpoint as image filesystem identifier instead of UUID.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 7, 2018
@Random-Liu
Copy link
Member Author

Random-Liu commented Feb 7, 2018

A container runtime implementation is here containerd/cri#601.

I've manually tested it, and it works. The CI https://k8s-testgrid.appspot.com/sig-node-containerd will catch more issue if there is any.

Copy link
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

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

question

@@ -3183,6 +3183,9 @@ func (m *UInt64Value) GetValue() uint64 {
type StorageIdentifier struct {
// UUID of the device.
Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

somewhat related: do we plan to keep the UUID field? If so, what is it used for now that we are passing the mount point?

Copy link
Contributor

Choose a reason for hiding this comment

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

read the PR description, ignore :)

@dashpole
Copy link
Contributor

dashpole commented Feb 7, 2018

/lint

Copy link
Contributor

@k8s-ci-robot k8s-ci-robot left a comment

Choose a reason for hiding this comment

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

@dashpole: 5 warnings.

In response to this:

/lint

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@@ -84,7 +84,7 @@ func (c *Mock) WatchEvents(request *events.Request) (*events.EventChannel, error
return args.Get(0).(*events.EventChannel), args.Error(1)
}

func (c *Mock) GetFsInfoByFsUUID(uuid string) (cadvisorapiv2.FsInfo, error) {
args := c.Called(uuid)
func (c *Mock) GetDirFsInfo(path string) (cadvisorapiv2.FsInfo, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported method Mock.GetDirFsInfo should have comment or be unexported. More info.

@@ -3196,6 +3199,13 @@ func (m *StorageIdentifier) GetUuid() string {
return ""
}

func (m *StorageIdentifier) GetMountpoint() string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported method StorageIdentifier.GetMountpoint should have comment or be unexported. More info.

@@ -77,6 +77,6 @@ func (cu *cadvisorUnsupported) WatchEvents(request *events.Request) (*events.Eve
return nil, unsupportedErr
}

func (c *cadvisorUnsupported) GetFsInfoByFsUUID(uuid string) (cadvisorapiv2.FsInfo, error) {
func (c *cadvisorUnsupported) GetDirFsInfo(path string) (cadvisorapiv2.FsInfo, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint naming: receiver name c should be consistent with previous receiver name cu for cadvisorUnsupported. More info.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@@ -77,6 +77,6 @@ func (cu *cadvisorClient) WatchEvents(request *events.Request) (*events.EventCha
return &events.EventChannel{}, nil
}

func (c *cadvisorClient) GetFsInfoByFsUUID(uuid string) (cadvisorapiv2.FsInfo, error) {
func (c *cadvisorClient) GetDirFsInfo(path string) (cadvisorapiv2.FsInfo, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint naming: receiver name c should be consistent with previous receiver name cu for cadvisorClient. More info.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@@ -76,6 +76,6 @@ func (c *Fake) WatchEvents(request *events.Request) (*events.EventChannel, error
return new(events.EventChannel), nil
}

func (c *Fake) GetFsInfoByFsUUID(uuid string) (cadvisorapiv2.FsInfo, error) {
func (c *Fake) GetDirFsInfo(path string) (cadvisorapiv2.FsInfo, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported method Fake.GetDirFsInfo should have comment or be unexported. More info.

@yujuhong
Copy link
Contributor

yujuhong commented Feb 7, 2018

Le'ts wait for the version bump PR to land first.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 7, 2018
@Random-Liu
Copy link
Member Author

Random-Liu commented Feb 7, 2018

Rebased and switched to v1alpha2.

@@ -1105,8 +1105,8 @@ message UInt64Value {

// StorageIdentifier uniquely identify the storage..
message StorageIdentifier{
// UUID of the device.
string uuid = 1;
// Mountpoint of the image filesystem.
Copy link
Contributor

Choose a reason for hiding this comment

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

The StorageIdentifier is a more generic message type. The comment should not include "image filesystem".

On the other hand, is StorageIdentifier still an accurate name, or should we rename it to, say, FilesystemIdentifier?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will do then.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Changed to FilesystemIdentifier.

@Random-Liu Random-Liu added this to the v1.10 milestone Feb 8, 2018
@mrunalp
Copy link
Contributor

mrunalp commented Feb 8, 2018

@sameo PTAL.

@mrunalp
Copy link
Contributor

mrunalp commented Feb 8, 2018

👍 We can add pool name in a follow-on for device mapper.

@dashpole
Copy link
Contributor

dashpole commented Feb 9, 2018

Code changes lgtm. I also agree with the idea of using mountpoint as an identifier.

@dashpole
Copy link
Contributor

dashpole commented Feb 9, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 9, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dashpole, Random-Liu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these OWNERS Files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants