containerd / rust-extensions

Rust crates to extend containerd
https://containerd.io
Apache License 2.0
168 stars 65 forks source link

Path of cgroup is wrong when running a container in a container. #237

Open aa624545345 opened 6 months ago

aa624545345 commented 6 months ago

https://github.com/containerd/rust-extensions/blob/main/crates/shim/src/cgroup.rs#L195 cgroup-rs

Burning1020 commented 6 months ago

Could you explain the reason more specificlly?

aa624545345 commented 6 months ago

get_cgroups_relative_paths_by_pid returns wrong cgroup paths because relative paths obtained from /proc/.../cgroup is not the true path, they shoud be trimed with the root path get from the third column of /proc/.../mountinfo.

This error only occurs when running a container in a container, running directly on the host is fine.

A specific description can be found here: https://github.com/kata-containers/cgroups-rs/issues/131.

aa624545345 commented 6 months ago

If cgroup-rs library remains unchanged, it is possible because for kata containers, they may not have a requirement for running a container withina container. In that case, would the rust-extentions consider fixing this bug?

Bug fix for cgroup-rs is here: https://github.com/kata-containers/cgroups-rs/pull/132/commits

aa624545345 commented 5 months ago

@Burning1020 @kzys @dims @caniszczyk Hi, cgroups-rs seems have no intention to fix this bug. The issue i rased in cgroup-rs haven't received reponse for a month. Are you intrerested in fixing it? I can submit a new pr, collect the cgroup paths after here.

Burning1020 commented 5 months ago

@aa624545345 Hi, I notice you have committed a PR to cgroup-rs and I think it should be fixed in it because cgroup-rs is a public crate not only used in kata-containers.

Mossaka commented 4 months ago

I noticed there are fairly amount of activities on Kata containers slack channel so I reached out to them, hopefully I could draw attention to get some feedback for your PR, @aa624545345.

https://katacontainers.slack.com/archives/C879ACQ00/p1711667146047859

aa624545345 commented 3 months ago

I noticed there are fairly amount of activities on Kata containers slack channel so I reached out to them, hopefully I could draw attention to get some feedback for your PR, @aa624545345.

https://katacontainers.slack.com/archives/C879ACQ00/p1711667146047859

Oh, thx.