feat: support proc limit (#19)
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				build / build (push) Successful in 1m38s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	build / build (push) Successful in 1m38s
				
			This commit is contained in:
		
							parent
							
								
									7a30ef1bf0
								
							
						
					
					
						commit
						11ca053704
					
				|  | @ -11,6 +11,7 @@ from joj3_config_generator.models.const import ( | ||||||
|     DEFAULT_CPU_LIMIT, |     DEFAULT_CPU_LIMIT, | ||||||
|     DEFAULT_FILE_LIMIT, |     DEFAULT_FILE_LIMIT, | ||||||
|     DEFAULT_MEMORY_LIMIT, |     DEFAULT_MEMORY_LIMIT, | ||||||
|  |     DEFAULT_PROC_LIMIT, | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -66,6 +67,7 @@ class Limit(BaseModel): | ||||||
|     cpu: int = DEFAULT_CPU_LIMIT |     cpu: int = DEFAULT_CPU_LIMIT | ||||||
|     stdout: int = DEFAULT_FILE_LIMIT |     stdout: int = DEFAULT_FILE_LIMIT | ||||||
|     stderr: int = DEFAULT_FILE_LIMIT |     stderr: int = DEFAULT_FILE_LIMIT | ||||||
|  |     proc: int = DEFAULT_PROC_LIMIT | ||||||
| 
 | 
 | ||||||
|     model_config = ConfigDict(validate_assignment=True) |     model_config = ConfigDict(validate_assignment=True) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -8,7 +8,6 @@ from joj3_config_generator.models import result, task | ||||||
| from joj3_config_generator.models.common import Memory, Time | from joj3_config_generator.models.common import Memory, Time | ||||||
| from joj3_config_generator.models.const import ( | from joj3_config_generator.models.const import ( | ||||||
|     DEFAULT_CLOCK_LIMIT_MULTIPLIER, |     DEFAULT_CLOCK_LIMIT_MULTIPLIER, | ||||||
|     DEFAULT_PROC_LIMIT, |  | ||||||
|     JOJ3_CONFIG_ROOT, |     JOJ3_CONFIG_ROOT, | ||||||
| ) | ) | ||||||
| from joj3_config_generator.models.task import Parser as ParserEnum | from joj3_config_generator.models.task import Parser as ParserEnum | ||||||
|  | @ -97,8 +96,9 @@ def get_executor_with( | ||||||
|             copy_in_cached={file: file for file in cached}, |             copy_in_cached={file: file for file in cached}, | ||||||
|             copy_out_cached=file_export, |             copy_out_cached=file_export, | ||||||
|             cpu_limit=Time(task_stage.limit.cpu), |             cpu_limit=Time(task_stage.limit.cpu), | ||||||
|             clock_limit=2 * Time(task_stage.limit.cpu), |             clock_limit=DEFAULT_CLOCK_LIMIT_MULTIPLIER * Time(task_stage.limit.cpu), | ||||||
|             memory_limit=Memory(task_stage.limit.mem), |             memory_limit=Memory(task_stage.limit.mem), | ||||||
|  |             proc_limit=task_stage.limit.proc, | ||||||
|             stderr=result.Collector( |             stderr=result.Collector( | ||||||
|                 name="stderr", pipe=True, max=Memory(task_stage.limit.stderr) |                 name="stderr", pipe=True, max=Memory(task_stage.limit.stderr) | ||||||
|             ), |             ), | ||||||
|  | @ -203,7 +203,7 @@ def fix_diff( | ||||||
|             cpu_limit=case_stage.limit.cpu, |             cpu_limit=case_stage.limit.cpu, | ||||||
|             clock_limit=DEFAULT_CLOCK_LIMIT_MULTIPLIER * case_stage.limit.cpu, |             clock_limit=DEFAULT_CLOCK_LIMIT_MULTIPLIER * case_stage.limit.cpu, | ||||||
|             memory_limit=case_stage.limit.mem, |             memory_limit=case_stage.limit.mem, | ||||||
|             proc_limit=DEFAULT_PROC_LIMIT, |             proc_limit=task_stage.limit.proc, | ||||||
|         ) |         ) | ||||||
|         if cmd.args == executor.with_.default.args: |         if cmd.args == executor.with_.default.args: | ||||||
|             cmd.args = None |             cmd.args = None | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user