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;
44
55use  super :: { partial_oci_config:: PartialOciConfigUser ,  seccomp} ; 
66
7+ // CPU period in microseconds. 
8+ // 
9+ // https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt 
10+ const  CPU_PERIOD :  u64  = 100000 ; 
11+ 
712pub  struct  ConfigOpts < ' a >  { 
813	pub  runner_path :  & ' a  Path , 
914	pub  netns_path :  & ' a  Path , 
@@ -89,14 +94,8 @@ pub fn config(opts: ConfigOpts) -> Result<serde_json::Value> {
8994						// If `quota` is greater than `period`, it is allowed to use multiple cores. 
9095						// 
9196						// 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 , 
10099					} ) ) 
101100				}  else { 
102101					None 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments