1
0
Fork 0
mirror of https://github.com/containers/youki synced 2024-05-09 17:16:16 +02:00

Move cgroups crate to crate directory

This commit is contained in:
Furisto 2021-10-20 21:28:57 +02:00
parent 017febada0
commit 610c95c176
No known key found for this signature in database
GPG Key ID: 40C5F0E00523478B
47 changed files with 95 additions and 2 deletions

View File

@ -7,7 +7,7 @@ description = "A container runtime written in Rust"
[workspace]
members = [
"cgroups",
"crates/*",
"seccomp",
]
exclude = [
@ -39,7 +39,7 @@ chrono = { version="0.4", features = ["serde"] }
once_cell = "1.6.0"
futures = { version = "0.3", features = ["thread-pool"] }
oci-spec = { git = "https://github.com/containers/oci-spec-rs", rev = "d6fb1e91742313cd0d0085937e2d6df5d4669720" }
cgroups = { version = "0.1.0", path = "./cgroups" }
cgroups = { version = "0.1.0", path = "./crates/cgroups" }
systemd = { version = "0.8", default-features = false, optional = true }
dbus = "0.9.2"
tabwriter = "1"

View File

@ -0,0 +1,93 @@
// use anyhow::{Context, Result};
// use oci_spec::runtime::{
// LinuxBlockIo, LinuxBlockIoBuilder, LinuxBuilder, LinuxResourcesBuilder,
// LinuxThrottleDeviceBuilder, LinuxWeightDeviceBuilder, Spec, SpecBuilder,
// };
// use test_framework::{ConditionalTest, TestGroup, TestResult};
// fn create_spec() -> Result<Spec> {
// let major = 8;
// let minor = 0;
// let spec = SpecBuilder::default()
// .linux(
// LinuxBuilder::default()
// .resources(
// LinuxResourcesBuilder::default()
// .block_io(
// LinuxBlockIoBuilder::default()
// .weight(500u16)
// .leaf_weight(100u16)
// .weight_device(vec![
// LinuxWeightDeviceBuilder::default()
// .major(major)
// .minor(minor)
// .weight(200u16)
// .build()
// .context("could not build weight device")?,
// // LinuxWeightDeviceBuilder::default()
// // .major(8)
// // .minor(1)
// // .weight(300u16)
// // .build()
// // .context("could not build weight device")?,
// ])
// .throttle_read_bps_device(vec![
// LinuxThrottleDeviceBuilder::default()
// .major(major)
// .minor(minor)
// .rate(value)
// .build()
// .context("could not build read bps device spec")?,
// ])
// .throttle_read_iops_device(vec![
// LinuxThrottleDeviceBuilder::default()
// .major(major)
// .minor(minor)
// .build()
// .context("could not build read iops device spec")?,
// ])
// .throttle_write_bps_device(vec![
// LinuxThrottleDeviceBuilder::default()
// .major(major)
// .minor(minor)
// .build()
// .context("could not build write bps device spec")?,
// ])
// .throttle_write_iops_device(vec![
// LinuxThrottleDeviceBuilder::default()
// .major(major)
// .minor(minor)
// .build()
// .context("could not build write iops device spec")?,
// ])
// .build()
// .context("could not build block io spec")?,
// )
// .build()
// .context("could not build resource spec")?,
// )
// .build()
// .context("could not build linux spec")?,
// )
// .build()
// .context("could not build spec")?;
// Ok(spec)
// }
// pub fn get_test_group<'a>() -> TestGroup<'a> {
// let mut test_group = TestGroup::new("cgroup_blkio");
// let test = ConditionalTest::new("first", Box::new(validate), Box::new(test_blkio));
// test_group.add(vec![Box::new(test)]);
// test_group
// }
// pub fn test_blkio() -> TestResult {
// todo!();
// }
// pub fn validate() -> bool {
// todo!();
// }