fix: remove optional for task.Limit
All checks were successful
build / build (pull_request) Successful in 2m28s
build / build (push) Successful in 2m30s

This commit is contained in:
李衍志523370910113 2025-03-02 11:24:26 +08:00
parent 704c10e917
commit 94dc847a11
7 changed files with 53 additions and 51 deletions

View File

@ -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):

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,