Skip to content

Commit

Permalink
runtime: add support for CONNECTOR_CGROUP_PARENT
Browse files Browse the repository at this point in the history
When set, use the desginated cgroup as the parent of started connector
containers.
  • Loading branch information
jgraettinger committed Dec 13, 2024
1 parent 96c35ff commit 05dbf23
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/runtime/src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ pub async fn start(
"--env=LOG_FORMAT=json".to_string(),
format!("--env=LOG_LEVEL={}", log_level.as_str_name()),
// Cgroup memory / CPU resource limits.
// TODO(johnny): we intend to tighten these down further, over time.
"--memory=1g".to_string(),
"--cpus=2".to_string(),
// For now, we support only Linux amd64 connectors.
Expand Down Expand Up @@ -146,6 +145,10 @@ pub async fn start(
])
}

if let Some(cgroup_parent) = std::env::var("CONNECTOR_CGROUP_PARENT").ok() {
docker_args.append(&mut vec!["--cgroup-parent".to_string(), cgroup_parent]);
}

docker_args.append(&mut vec![
// Image to run.
image.to_string(),
Expand Down

0 comments on commit 05dbf23

Please sign in to comment.