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
k8s CRI Support added to bucketbench #31
Conversation
Looks fine overall, ping @estesp |
contrib/container_config.json
Outdated
@@ -0,0 +1,54 @@ | |||
{ | |||
"metadata": { | |||
"name": "powertest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/powertest/bucketbench/ ?
Thanks @kunalkushwaha ; will do a complete review over the next day or so. Looks good in general and will answer specific approach questions in review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All comments are fairly minor. Thanks, it looks good overall @kunalkushwaha!
I'm thinking maybe binary
entry in YAML should change to clientpath
? That way overloading it for binary paths and UNIX socket paths doesn't seem to crazy as both fit the description of "client path", whether a direct binary for drivers that use it, or socket path for gRPC-based drivers. What do you think?
contrib/sandbox_config.json
Outdated
"security.alpha.kubernetes.io/seccomp/pod": "unconfined" | ||
}, | ||
"linux": { | ||
"cgroup_parent": "/Burstable/pod_123-456", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this /Burstable/pod_123-456
useful/necessary, or just copied from somewhere else? Maybe it doesn't matter, but would be nice for this to be as "default"/vanilla as can be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied it from CRI-O 's contrib files. Will try to make it more generic.
driver/containerd.go
Outdated
@@ -101,6 +101,11 @@ func (c *ContainerdContainer) Detached() bool { | |||
return true | |||
} | |||
|
|||
//GetPodID return pod-id assosicated with container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: s/assosicated/associated/
Maybe for all the drivers which will not implement GetPodID
add a second sentence to the comment "only used by CRI-based drivers"
driver/containerd_ctr.go
Outdated
@@ -90,6 +90,11 @@ func (c *CtrContainer) Detached() bool { | |||
return true | |||
} | |||
|
|||
//GetPodID return pod-id assosicated with container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same typo as the containerd driver :) Also, same comment about noting this is stubbed out only for use with CRI drivers
driver/cri.go
Outdated
) | ||
|
||
const ( | ||
defaultPodImage = "docker.io/ibmcom/pause:3.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update to the gcr.io pause image reference per @runcom's comment?
driver/cri.go
Outdated
const ( | ||
defaultPodImage = "docker.io/ibmcom/pause:3.0" | ||
defaultPodNamePrefix = "pod" | ||
defaultSanboxConfig = "contrib/sandbox_config.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: s/defaultSanboxConfig/defaultSandboxConfig
driver/cri.go
Outdated
runtimeClient := pb.NewRuntimeServiceClient(conn) | ||
imageClient := pb.NewImageServiceClient(conn) | ||
|
||
pconfig, err := loadPodSandboxConfig(defaultSanboxConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/defaultSanboxConfig/defaultSandboxConfig
driver/docker.go
Outdated
@@ -82,6 +82,11 @@ func (c *DockerContainer) Command() string { | |||
return c.cmdOverride | |||
} | |||
|
|||
//GetPodID return pod-id assosicated with container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same typo as other drivers; and same comment about unused outside of CRI implementation
driver/driver.go
Outdated
@@ -19,6 +19,8 @@ const ( | |||
// Null driver represents an empty driver for use by benchmarks that | |||
// require no driver | |||
Null | |||
//CRI driver represents k8s Container Runtime Interface | |||
CRI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add this above Null
so that Null
is the last driver in the list? Not a big deal, but.. :)
driver/driver.go
Outdated
@@ -95,6 +100,8 @@ func New(dtype Type, path string) (Driver, error) { | |||
return NewCtrDriver(path) | |||
case Null: | |||
return nil, nil | |||
case CRI: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above re: Null being the last entry
driver/runc.go
Outdated
@@ -91,6 +91,11 @@ func (c *RuncContainer) State() string { | |||
return c.state | |||
} | |||
|
|||
//GetPodID return pod-id assosicated with container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as other drivers: typo and comment about unused :)
- Support for CRI driver type added to helper functions of Driver Interface Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
- config file added for CRI - Examples yaml file added for CRI Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
Have incorporated all suggestion with this update. Please check once more. |
LGTM Merging as the tip |
This PR is for adding support of CRI interface of k8s to bucketbench.
//cc @estesp @runcom @Random-Liu
PS: Sorry for this creating this big PR, didn't found any other way to break into smaller one.