Skip to content

cni: pass in the cgroupPath capability argument#8067

Merged
mxpv merged 2 commits intocontainerd:mainfrom
squeed:cni-cgroup-path
Feb 15, 2023
Merged

cni: pass in the cgroupPath capability argument#8067
mxpv merged 2 commits intocontainerd:mainfrom
squeed:cni-cgroup-path

Conversation

@squeed
Copy link
Copy Markdown
Contributor

@squeed squeed commented Feb 8, 2023

There is a new CNI capability argument, cgroupPath, where runtimes can pass cgroup paths to CNI plugins.

(see: containernetworking/cni#936)

Implement that.

Signed-off-by: Casey Callendrello [email protected]

@k8s-ci-robot
Copy link
Copy Markdown

Hi @squeed. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

Copy link
Copy Markdown

@aditighag aditighag left a comment

Choose a reason for hiding this comment

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

🚀

Comment thread pkg/cri/sbserver/sandbox_run.go Outdated
@MikeZappa87 MikeZappa87 self-assigned this Feb 8, 2023
@fuweid
Copy link
Copy Markdown
Member

fuweid commented Feb 8, 2023

/cc

@k8s-ci-robot k8s-ci-robot requested a review from fuweid February 8, 2023 15:37
@MikeZappa87
Copy link
Copy Markdown
Member

/ok-to-test

@k8s-ci-robot
Copy link
Copy Markdown

@MikeZappa87: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/ok-to-test

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.

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

Comment thread pkg/cri/sbserver/sandbox_run.go Outdated
@squeed
Copy link
Copy Markdown
Contributor Author

squeed commented Feb 8, 2023

This is not unit-testable (due to the structure of go-cni), but I spun up a test cluster and saw this passed in correctly. Specifically, my debug plugin saw this as the CNI configuration:

{
  "capabilities": {
    "cgroupPath": true
  },
  "cniVersion": "0.3.1",
  "enable-debug": true,
  "name": "cdc-cni-debug",
  "runtimeConfig": {
    "cgroupPath": "/kubelet.slice/kubelet-kubepods.slice/kubelet-kubepods-besteffort.slice/kubelet-kubepods-besteffort-pod1735c29c_32af_407c_aa34_9ec25fbef089.slice"
  },
  "type": "cdc-cni-debug"
}

@fuweid
Copy link
Copy Markdown
Member

fuweid commented Feb 9, 2023

It is not related to your change. It seems it's env issue. Retrying

Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName                                                  
-------  ------    -----      -----     ------     --  -- -----------                                                  
     96       8    18752       64[24](https://github.com/containerd/containerd/actions/runs/4125687270/jobs/7126754034#step:23:25)       0.05    184   1 containerd                                                   

IgnoreCase : True
LineNumber : 4
Line       : System.Diagnostics.Process (containerd)
Filename   : InputStream
Path       : InputStream
Pattern    : containerd
Context    : 
Matches    : {0}

critest.exe : The term 'critest.exe' is not recognized as the name of a cmdlet, function, script file, or operable 
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At D:\a\_temp\c9357b88-b470-48[31](https://github.com/containerd/containerd/actions/runs/4125687270/jobs/7126754034#step:23:32)-892f-0a3182ab57b4.ps1:11 char:1
+ critest.exe --runtime-endpoint=npipe://.//pipe//containerd-containerd ...
+ ~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (critest.exe:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : CommandNotFoundException

@squeed
Copy link
Copy Markdown
Contributor Author

squeed commented Feb 9, 2023

@fuweid should I bump the version of go-cni? I would need a version bump (or to pick up master)

@fuweid
Copy link
Copy Markdown
Member

fuweid commented Feb 10, 2023

Hi @squeed The CI issue has been fixed by #8074. You can rebase it and repush.

should I bump the version of go-cni? I would need a version bump (or to pick up master)

Let's pick up master in this pr, since we just release v1.1.8 for go-cni. 😂
If there is no following change before containerd v1.7, we will file new release for go-cni and bump to it.

Copy link
Copy Markdown
Member

@mxpv mxpv left a comment

Choose a reason for hiding this comment

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

LGTM on green

@squeed
Copy link
Copy Markdown
Contributor Author

squeed commented Feb 13, 2023

rebased; pulled in go-cni tip. Otherwise no changes.

@fuweid
Copy link
Copy Markdown
Member

fuweid commented Feb 14, 2023

@squeed please use go mod tidy to update go.sum. Thanks!

@squeed
Copy link
Copy Markdown
Contributor Author

squeed commented Feb 14, 2023

@fuweid oops, sorry about that. Fixed!

Signed-off-by: Casey Callendrello <[email protected]>
There is a new CNI capability argument, cgroupPath, where runtimes can
pass cgroup paths to CNI plugins.

Implement that.

Signed-off-by: Casey Callendrello <[email protected]>
@squeed
Copy link
Copy Markdown
Contributor Author

squeed commented Feb 14, 2023

aha, I needed to make vendor

@mxpv mxpv merged commit 495e1a5 into containerd:main Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants