fix: remove optional for task.Limit
This commit is contained in:
parent
704c10e917
commit
94dc847a11
|
@ -2,7 +2,9 @@ from datetime import datetime
|
|||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Type
|
||||
|
||||
import humanfriendly
|
||||
from pydantic import BaseModel, Field, model_validator
|
||||
from pytimeparse.timeparse import timeparse
|
||||
|
||||
|
||||
class ParserResultDetail(BaseModel):
|
||||
|
@ -51,10 +53,10 @@ class Files(BaseModel):
|
|||
|
||||
|
||||
class Limit(BaseModel):
|
||||
mem: Optional[int] = 800
|
||||
cpu: Optional[int] = 1000
|
||||
stderr: Optional[int] = 800
|
||||
stdout: Optional[int] = 800
|
||||
mem: int = humanfriendly.parse_size("128M")
|
||||
cpu: int = timeparse("1s")
|
||||
stderr: int = humanfriendly.parse_size("128M")
|
||||
stdout: int = humanfriendly.parse_size("128M")
|
||||
|
||||
|
||||
class Stage(BaseModel):
|
||||
|
|
|
@ -115,18 +115,18 @@
|
|||
},
|
||||
"stdout": {
|
||||
"name": "stdout",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"stderr": {
|
||||
"name": "stderr",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"cpuLimit": 1000000000000000,
|
||||
"cpuLimit": 1000000000000,
|
||||
"realCpuLimit": 0,
|
||||
"clockLimit": 2000000000000000,
|
||||
"memoryLimit": 838860800,
|
||||
"clockLimit": 2000000000000,
|
||||
"memoryLimit": 134217728000000,
|
||||
"stackLimit": 0,
|
||||
"procLimit": 50,
|
||||
"cpuRateLimit": 0,
|
||||
|
@ -203,18 +203,18 @@
|
|||
},
|
||||
"stdout": {
|
||||
"name": "stdout",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"stderr": {
|
||||
"name": "stderr",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"cpuLimit": 1000000000000000,
|
||||
"cpuLimit": 1000000000000,
|
||||
"realCpuLimit": 0,
|
||||
"clockLimit": 2000000000000000,
|
||||
"memoryLimit": 838860800,
|
||||
"clockLimit": 2000000000000,
|
||||
"memoryLimit": 134217728000000,
|
||||
"stackLimit": 0,
|
||||
"procLimit": 50,
|
||||
"cpuRateLimit": 0,
|
||||
|
@ -309,13 +309,13 @@
|
|||
},
|
||||
"stderr": {
|
||||
"name": "stderr",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"cpuLimit": 1000000000000000,
|
||||
"cpuLimit": 1000000000000,
|
||||
"realCpuLimit": 0,
|
||||
"clockLimit": 2000000000000000,
|
||||
"memoryLimit": 838860800,
|
||||
"clockLimit": 2000000000000,
|
||||
"memoryLimit": 134217728000000,
|
||||
"stackLimit": 0,
|
||||
"procLimit": 50,
|
||||
"cpuRateLimit": 0,
|
||||
|
@ -431,7 +431,7 @@
|
|||
},
|
||||
"stdout": {
|
||||
"name": "stdout",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"stderr": {
|
||||
|
@ -439,10 +439,10 @@
|
|||
"max": 65000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"cpuLimit": 1000000000000000,
|
||||
"cpuLimit": 1000000000000,
|
||||
"realCpuLimit": 0,
|
||||
"clockLimit": 2000000000000000,
|
||||
"memoryLimit": 838860800,
|
||||
"clockLimit": 2000000000000,
|
||||
"memoryLimit": 134217728000000,
|
||||
"stackLimit": 0,
|
||||
"procLimit": 50,
|
||||
"cpuRateLimit": 0,
|
||||
|
@ -535,13 +535,13 @@
|
|||
},
|
||||
"stderr": {
|
||||
"name": "stderr",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"cpuLimit": 1000000000000000,
|
||||
"cpuLimit": 1000000000000,
|
||||
"realCpuLimit": 0,
|
||||
"clockLimit": 2000000000000000,
|
||||
"memoryLimit": 838860800,
|
||||
"clockLimit": 2000000000000,
|
||||
"memoryLimit": 134217728000000,
|
||||
"stackLimit": 0,
|
||||
"procLimit": 50,
|
||||
"cpuRateLimit": 0,
|
||||
|
@ -625,17 +625,17 @@
|
|||
"env": [],
|
||||
"stdout": {
|
||||
"name": "stdout",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"stderr": {
|
||||
"name": "stderr",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"cpuLimit": 1000000000000000,
|
||||
"cpuLimit": 1000000000000,
|
||||
"realCpuLimit": 0,
|
||||
"clockLimit": 2000000000000000,
|
||||
"clockLimit": 2000000000000,
|
||||
"memoryLimit": 95656304705536,
|
||||
"stackLimit": 0,
|
||||
"procLimit": 50,
|
||||
|
|
|
@ -37,13 +37,13 @@
|
|||
},
|
||||
"stderr": {
|
||||
"name": "stderr",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"cpuLimit": 1000000000000000,
|
||||
"cpuLimit": 1000000000000,
|
||||
"realCpuLimit": 0,
|
||||
"clockLimit": 2000000000000000,
|
||||
"memoryLimit": 838860800,
|
||||
"clockLimit": 2000000000000,
|
||||
"memoryLimit": 134217728000000,
|
||||
"stackLimit": 0,
|
||||
"procLimit": 50,
|
||||
"cpuRateLimit": 0,
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
},
|
||||
"stdout": {
|
||||
"name": "stdout",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"stderr": {
|
||||
|
@ -40,10 +40,10 @@
|
|||
"max": 65000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"cpuLimit": 1000000000000000,
|
||||
"cpuLimit": 1000000000000,
|
||||
"realCpuLimit": 0,
|
||||
"clockLimit": 2000000000000000,
|
||||
"memoryLimit": 838860800,
|
||||
"clockLimit": 2000000000000,
|
||||
"memoryLimit": 134217728000000,
|
||||
"stackLimit": 0,
|
||||
"procLimit": 50,
|
||||
"cpuRateLimit": 0,
|
||||
|
|
|
@ -36,13 +36,13 @@
|
|||
},
|
||||
"stderr": {
|
||||
"name": "stderr",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"cpuLimit": 1000000000000000,
|
||||
"cpuLimit": 1000000000000,
|
||||
"realCpuLimit": 0,
|
||||
"clockLimit": 2000000000000000,
|
||||
"memoryLimit": 838860800,
|
||||
"clockLimit": 2000000000000,
|
||||
"memoryLimit": 134217728000000,
|
||||
"stackLimit": 0,
|
||||
"procLimit": 50,
|
||||
"cpuRateLimit": 0,
|
||||
|
|
|
@ -24,17 +24,17 @@
|
|||
"env": [],
|
||||
"stdout": {
|
||||
"name": "stdout",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"stderr": {
|
||||
"name": "stderr",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"cpuLimit": 1000000000000000,
|
||||
"cpuLimit": 1000000000000,
|
||||
"realCpuLimit": 0,
|
||||
"clockLimit": 2000000000000000,
|
||||
"clockLimit": 2000000000000,
|
||||
"memoryLimit": 95656304705536,
|
||||
"stackLimit": 0,
|
||||
"procLimit": 50,
|
||||
|
|
|
@ -30,18 +30,18 @@
|
|||
},
|
||||
"stdout": {
|
||||
"name": "stdout",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"stderr": {
|
||||
"name": "stderr",
|
||||
"max": 800000000000000,
|
||||
"max": 128000000000000000000,
|
||||
"pipe": true
|
||||
},
|
||||
"cpuLimit": 1000000000000000,
|
||||
"cpuLimit": 1000000000000,
|
||||
"realCpuLimit": 0,
|
||||
"clockLimit": 2000000000000000,
|
||||
"memoryLimit": 838860800,
|
||||
"clockLimit": 2000000000000,
|
||||
"memoryLimit": 134217728000000,
|
||||
"stackLimit": 0,
|
||||
"procLimit": 50,
|
||||
"cpuRateLimit": 0,
|
||||
|
|
Loading…
Reference in New Issue
Block a user