manager: Introduce FsManager

`Manager` is a trait to unify the interface of cgroups. It is designed for
OCI containers. Its `set()` takes Linux resources of the OCI spec to set
cgroups.

The `FsManager`, the concrete implementation of `Manager`, manipulates
cgroups through cgroupfs, and supports both cgroups v1 and v2.

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
This commit is contained in:
Xuewei Niu
2025-07-11 20:55:23 +08:00
parent b8031f1a21
commit 1250cbe182
9 changed files with 1456 additions and 32 deletions
+2
View File
@@ -17,9 +17,11 @@ nix = { version = "0.25.0", default-features = false, features = ["event", "fs",
libc = "0.2"
serde = { version = "1.0", features = ["derive"], optional = true }
thiserror = "1"
oci-spec = { version = "0.8.1", optional = true }
[dev-dependencies]
libc = "0.2.76"
[features]
default = []
oci = ["oci-spec"]