File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
packages/edge/infra/client/manager/src/runner Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ use std::path::Path;
4
4
5
5
use super :: { partial_oci_config:: PartialOciConfigUser , seccomp} ;
6
6
7
+ // CPU period in microseconds.
8
+ //
9
+ // https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt
10
+ const CPU_PERIOD : u64 = 100000 ;
11
+
7
12
pub struct ConfigOpts < ' a > {
8
13
pub runner_path : & ' a Path ,
9
14
pub netns_path : & ' a Path ,
@@ -89,14 +94,8 @@ pub fn config(opts: ConfigOpts) -> Result<serde_json::Value> {
89
94
// If `quota` is greater than `period`, it is allowed to use multiple cores.
90
95
//
91
96
// Read more: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/resource_management_guide/sec-cpu
92
- // "quota": CPU_PERIOD * cpu / 1_000,
93
- // "period": CPU_PERIOD,
94
- // Use the env var for the CPU since Nomad handles assigning CPUs to each task
95
- // "cpus": if cpu >= 1_000 {
96
- // Some(template_env_var("NOMAD_CPU_CORES"))
97
- // } else {
98
- // None
99
- // }
97
+ "quota" : CPU_PERIOD * opts. cpu / 1_000 ,
98
+ "period" : CPU_PERIOD ,
100
99
} ) )
101
100
} else {
102
101
None
You can’t perform that action at this time.
0 commit comments