diff --git a/joj3_config_generator/models/result.py b/joj3_config_generator/models/result.py index 25b831f..1f77d28 100644 --- a/joj3_config_generator/models/result.py +++ b/joj3_config_generator/models/result.py @@ -1,33 +1,50 @@ -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Optional, Union import humanfriendly from pydantic import BaseModel, Field from pytimeparse.timeparse import timeparse -class CmdFile(BaseModel): - src: Optional[str] = None - content: Optional[str] = None - file_id: Optional[str] = Field(None, serialization_alias="fileId") - name: Optional[str] = None - max: Optional[int] = humanfriendly.parse_size("128m") - symlink: Optional[str] = None - stream_in: Optional[bool] = Field(None, serialization_alias="streamIn") - stream_out: Optional[bool] = Field(None, serialization_alias="streamOut") - pipe: Optional[bool] = None +class LocalFile(BaseModel): + src: str + + +class MemoryFile(BaseModel): + content: str + + +class PreparedFile(BaseModel): + file_id: str = Field(..., alias="fileId") + + +class Collector(BaseModel): + name: str + max: int + pipe: bool = True + + +class Symlink(BaseModel): + symlink: str + + +class StreamIn(BaseModel): + stream_in: bool = Field(..., alias="streamIn") + + +class StreamOut(BaseModel): + stream_out: bool = Field(..., alias="streamOut") + + +InputFile = Union[LocalFile | MemoryFile | PreparedFile | Symlink] class Cmd(BaseModel): args: Optional[List[str]] = None - env: Optional[List[str]] = ["PATH=/usr/bin:/bin:/usr/local/bin"] - stdin: Optional[CmdFile] = CmdFile(content="") - stdout: Optional[CmdFile] = CmdFile( - name="stdout", max=humanfriendly.parse_size("128m") - ) - stderr: Optional[CmdFile] = CmdFile( - name="stderr", max=humanfriendly.parse_size("128m") - ) - cpu_limit: int = Field(timeparse("1s"), serialization_alias="cpuLimit") + env: List[str] = [] + stdin: Optional[Union[InputFile | StreamIn]] = None + stdout: Optional[Union[Collector | StreamOut]] = None + stderr: Optional[Union[Collector | StreamOut]] = None + cpu_limit: int = Field(0, serialization_alias="cpuLimit") real_cpu_limit: int = Field(0, serialization_alias="realCpuLimit") clock_limit: int = Field(2 * timeparse("1s"), serialization_alias="clockLimit") memory_limit: int = Field( @@ -37,7 +54,7 @@ class Cmd(BaseModel): proc_limit: int = Field(50, serialization_alias="procLimit") cpu_rate_limit: int = Field(0, serialization_alias="cpuRateLimit") cpu_set_limit: str = Field("", serialization_alias="cpuSetLimit") - copy_in: Dict[str, CmdFile] = Field({}, serialization_alias="copyIn") + copy_in: Dict[str, InputFile] = Field({}, serialization_alias="copyIn") copy_in_cached: Dict[str, str] = Field({}, serialization_alias="copyInCached") copy_in_dir: str = Field(".", serialization_alias="copyInDir") # reconsider this default situation @@ -52,12 +69,12 @@ class Cmd(BaseModel): class OptionalCmd(BaseModel): - args: Optional[list[str]] = None - env: Optional[list[str]] = ["PATH=/usr/bin:/bin:/usr/local/bin"] - stdin: Optional[CmdFile] = None - stdout: Optional[CmdFile] = None - stderr: Optional[CmdFile] = None - cpu_limit: Optional[int] = Field(timeparse("1s"), serialization_alias="cpuLimit") + args: Optional[List[str]] = None + env: Optional[List[str]] = None + stdin: Optional[Union[InputFile | StreamIn]] = None + stdout: Optional[Union[Collector | StreamOut]] = None + stderr: Optional[Union[Collector | StreamOut]] = None + cpu_limit: Optional[int] = Field(None, serialization_alias="cpuLimit") real_cpu_limit: Optional[int] = Field(None, serialization_alias="realCpuLimit") clock_limit: Optional[int] = Field( 2 * timeparse("1s"), serialization_alias="clockLimit" @@ -69,7 +86,7 @@ class OptionalCmd(BaseModel): proc_limit: Optional[int] = Field(50, serialization_alias="procLimit") cpu_rate_limit: Optional[int] = Field(None, serialization_alias="cpuRateLimit") cpu_set_limit: Optional[str] = Field(None, serialization_alias="cpuSetLimit") - copy_in: Optional[Dict[str, CmdFile]] = Field(None, serialization_alias="copyIn") + copy_in: Optional[Dict[str, InputFile]] = Field(None, serialization_alias="copyIn") copy_in_cached: Optional[Dict[str, str]] = Field( None, serialization_alias="copyInCached" ) diff --git a/joj3_config_generator/processers/task.py b/joj3_config_generator/processers/task.py index 025572f..5f2b0fb 100644 --- a/joj3_config_generator/processers/task.py +++ b/joj3_config_generator/processers/task.py @@ -61,13 +61,13 @@ def get_executor_with_config( else [] ), copy_in={ - file: result.CmdFile(src=f"/home/tt/.config/joj/{file}") + file: result.LocalFile(src=f"/home/tt/.config/joj/{file}") # all copyin files store in this tools folder # are there any corner cases for file in copy_in_files }, stdin=( - result.CmdFile(content="") + result.MemoryFile(content="") if ( (task_stage.parsers is not None) and ("diff" not in task_stage.parsers) @@ -92,7 +92,7 @@ def get_executor_with_config( if task_stage.limit is not None and task_stage.limit.mem is not None else 800 * 1_024 * 1_024 ), - stderr=result.CmdFile( + stderr=result.Collector( name="stderr", max=( task_stage.limit.stderr * 1_000_000_000_000 @@ -100,8 +100,9 @@ def get_executor_with_config( and task_stage.limit.stderr is not None else 800 * 1_024 * 1_024 ), + pipe=True, ), - stdout=result.CmdFile( + stdout=result.Collector( name="stdout", max=( task_stage.limit.stdout * 1_000_000_000_000 @@ -109,6 +110,7 @@ def get_executor_with_config( and task_stage.limit.stdout is not None else 800 * 1_024 * 1_024 ), + pipe=True, ), ), cases=[], @@ -275,7 +277,7 @@ def fix_diff( stage_cases.append( result.OptionalCmd( - stdin=result.CmdFile( + stdin=result.LocalFile( src=f"/home/tt/.config/joj/{task_conf.task.type_}/{stdin}", ), args=(shlex.split(command) if command is not None else None), diff --git a/tests/convert/basic/task.json b/tests/convert/basic/task.json index 5361189..3e50cb9 100644 --- a/tests/convert/basic/task.json +++ b/tests/convert/basic/task.json @@ -17,22 +17,8 @@ "name": "local", "with": { "default": { - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "", - "max": 128000000 - }, - "stdout": { - "name": "stdout", - "max": 128000000 - }, - "stderr": { - "name": "stderr", - "max": 128000000 - }, - "cpuLimit": 1, + "env": [], + "cpuLimit": 0, "realCpuLimit": 0, "clockLimit": 2, "memoryLimit": 128000000, @@ -66,10 +52,6 @@ "-checkFileSumList=a5b63323a692d3d8b952442969649b4f823d58dae26429494f613df160710dfc,b1bbad25b830db0a77b15a033f9ca1b7ab44c1d2d05056412bd3e4421645f0bf,f6740081487ca34963a005209e2e9adfdf6f3561719af082d40fe80145e0cceb,bbeca1491c2f8364821a328a6677c0c5d59ccd60250abac3cec0887eeb9bde3e", "-checkFileNameList=.gitignore,.gitattributes,.gitea/workflows/push.yaml,.gitea/workflows/release.yaml" ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "cpuLimit": 1, "clockLimit": 2, "memoryLimit": 128000000, "procLimit": 50, @@ -91,7 +73,6 @@ "env": [ "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" ], - "cpuLimit": 1, "clockLimit": 2, "memoryLimit": 128000000, "procLimit": 50, @@ -128,20 +109,19 @@ "args": [ "./tools/compile" ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], + "env": [], "stdin": { - "content": "", - "max": 128000000 + "content": "" }, "stdout": { "name": "stdout", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "stderr": { "name": "stderr", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "cpuLimit": 1000000000000000, "realCpuLimit": 0, @@ -153,8 +133,7 @@ "cpuSetLimit": "", "copyIn": { "tools/compile": { - "src": "/home/tt/.config/joj/tools/compile", - "max": 128000000 + "src": "/home/tt/.config/joj/tools/compile" } }, "copyInCached": {}, @@ -218,20 +197,19 @@ "*.cpp", "*.h" ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], + "env": [], "stdin": { - "content": "", - "max": 128000000 + "content": "" }, "stdout": { "name": "stdout", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "stderr": { "name": "stderr", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "cpuLimit": 1000000000000000, "realCpuLimit": 0, @@ -243,8 +221,7 @@ "cpuSetLimit": "", "copyIn": { "tools/filelength": { - "src": "/home/tt/.config/joj/tools/filelength", - "max": 128000000 + "src": "/home/tt/.config/joj/tools/filelength" } }, "copyInCached": { @@ -327,20 +304,19 @@ "h7/build", "h7/ex2.cpp" ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], + "env": [], "stdin": { - "content": "", - "max": 128000000 + "content": "" }, "stdout": { "name": "stdout", - "max": 65000000000000 + "max": 65000000000000, + "pipe": true }, "stderr": { "name": "stderr", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "cpuLimit": 1000000000000000, "realCpuLimit": 0, @@ -352,8 +328,7 @@ "cpuSetLimit": "", "copyIn": { "tests/homework/h7/.clang-tidy": { - "src": "/home/tt/.config/joj/tests/homework/h7/.clang-tidy", - "max": 128000000 + "src": "/home/tt/.config/joj/tests/homework/h7/.clang-tidy" } }, "copyInCached": { @@ -462,20 +437,19 @@ "--quiet", "h7/ex2.cpp" ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], + "env": [], "stdin": { - "content": "", - "max": 128000000 + "content": "" }, "stdout": { "name": "stdout", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "stderr": { "name": "stderr", - "max": 65000000000000 + "max": 65000000000000, + "pipe": true }, "cpuLimit": 1000000000000000, "realCpuLimit": 0, @@ -568,20 +542,19 @@ "--exclude=build", "h7/ex2.cpp" ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], + "env": [], "stdin": { - "content": "", - "max": 128000000 + "content": "" }, "stdout": { "name": "stdout", - "max": 65000000000000 + "max": 65000000000000, + "pipe": true }, "stderr": { "name": "stderr", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "cpuLimit": 1000000000000000, "realCpuLimit": 0, @@ -673,16 +646,16 @@ "./h7/build/ex2-asan", "-a" ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], + "env": [], "stdout": { "name": "stdout", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "stderr": { "name": "stderr", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "cpuLimit": 1000000000000000, "realCpuLimit": 0, @@ -715,12 +688,8 @@ }, "cases": [ { - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], "stdin": { - "src": "/home/tt/.config/joj/homework/h7/e2/case0.in", - "max": 128000000 + "src": "/home/tt/.config/joj/homework/h7/e2/case0.in" }, "cpuLimit": 1000000000, "clockLimit": 2000000000, @@ -732,12 +701,8 @@ ] }, { - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], "stdin": { - "src": "/home/tt/.config/joj/homework/h7/e2/case1.in", - "max": 128000000 + "src": "/home/tt/.config/joj/homework/h7/e2/case1.in" }, "cpuLimit": 1000000000, "clockLimit": 2000000000, @@ -820,19 +785,7 @@ "env": [ "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" ], - "stdin": { - "content": "", - "max": 128000000 - }, - "stdout": { - "name": "stdout", - "max": 128000000 - }, - "stderr": { - "name": "stderr", - "max": 128000000 - }, - "cpuLimit": 1, + "cpuLimit": 0, "realCpuLimit": 0, "clockLimit": 2, "memoryLimit": 128000000, diff --git a/tests/convert/clang-tidy/task.json b/tests/convert/clang-tidy/task.json index a89a7d4..0c0d641 100644 --- a/tests/convert/clang-tidy/task.json +++ b/tests/convert/clang-tidy/task.json @@ -10,6 +10,92 @@ "sandboxToken": "", "outputPath": "/tmp/joj3_result.json", "stages": [ + { + "name": "healthcheck", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "env": [], + "cpuLimit": 0, + "realCpuLimit": 0, + "clockLimit": 2, + "memoryLimit": 128000000, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { + "args": [ + "/usr/local/bin/repo-health-checker", + "-root=.", + "-repoSize=10", + "-checkFileSumList=-checkFileNameList=" + ], + "clockLimit": 2, + "memoryLimit": 128000000, + "procLimit": 50, + "copyOut": [ + "stdout", + "stderr" + ] + }, + { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-check-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "ece280-joj", + "--group-config", + "=100:24" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ], + "clockLimit": 2, + "memoryLimit": 128000000, + "procLimit": 50, + "copyOut": [ + "stdout", + "stderr" + ] + } + ] + } + }, + "parsers": [ + { + "name": "healthcheck", + "with": { + "score": 1 + } + }, + { + "name": "debug", + "with": { + "score": 0 + } + } + ] + }, { "name": "[cq] Clang-tidy", "group": "cq", @@ -26,20 +112,19 @@ "h7/build", "h7/ex2.cpp" ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], + "env": [], "stdin": { - "content": "", - "max": 128000000 + "content": "" }, "stdout": { "name": "stdout", - "max": 65000000000000 + "max": 65000000000000, + "pipe": true }, "stderr": { "name": "stderr", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "cpuLimit": 1000000000000000, "realCpuLimit": 0, @@ -51,12 +136,10 @@ "cpuSetLimit": "", "copyIn": { "tests/homework/h7/.clang-tidy": { - "src": "/home/tt/.config/joj/tests/homework/h7/.clang-tidy", - "max": 128000000 + "src": "/home/tt/.config/joj/tests/homework/h7/.clang-tidy" }, "h7/build/compile_commands.json": { - "src": "/home/tt/.config/joj/h7/build/compile_commands.json", - "max": 128000000 + "src": "/home/tt/.config/joj/h7/build/compile_commands.json" } }, "copyInCached": {}, @@ -164,19 +247,7 @@ "env": [ "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" ], - "stdin": { - "content": "", - "max": 128000000 - }, - "stdout": { - "name": "stdout", - "max": 128000000 - }, - "stderr": { - "name": "stderr", - "max": 128000000 - }, - "cpuLimit": 1, + "cpuLimit": 0, "realCpuLimit": 0, "clockLimit": 2, "memoryLimit": 128000000, diff --git a/tests/convert/cppcheck/task.json b/tests/convert/cppcheck/task.json index 1d8ef63..6f8218f 100644 --- a/tests/convert/cppcheck/task.json +++ b/tests/convert/cppcheck/task.json @@ -10,6 +10,92 @@ "sandboxToken": "", "outputPath": "/tmp/joj3_result.json", "stages": [ + { + "name": "healthcheck", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "env": [], + "cpuLimit": 0, + "realCpuLimit": 0, + "clockLimit": 2, + "memoryLimit": 128000000, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { + "args": [ + "/usr/local/bin/repo-health-checker", + "-root=.", + "-repoSize=10", + "-checkFileSumList=-checkFileNameList=" + ], + "clockLimit": 2, + "memoryLimit": 128000000, + "procLimit": 50, + "copyOut": [ + "stdout", + "stderr" + ] + }, + { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-check-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "ece280-joj", + "--group-config", + "=100:24" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ], + "clockLimit": 2, + "memoryLimit": 128000000, + "procLimit": 50, + "copyOut": [ + "stdout", + "stderr" + ] + } + ] + } + }, + "parsers": [ + { + "name": "healthcheck", + "with": { + "score": 1 + } + }, + { + "name": "debug", + "with": { + "score": 0 + } + } + ] + }, { "name": "[cq] Cppcheck", "group": "cq", @@ -26,20 +112,19 @@ "--quiet", "h7/ex2.cpp" ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], + "env": [], "stdin": { - "content": "", - "max": 128000000 + "content": "" }, "stdout": { "name": "stdout", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "stderr": { "name": "stderr", - "max": 65000000000000 + "max": 65000000000000, + "pipe": true }, "cpuLimit": 1000000000000000, "realCpuLimit": 0, @@ -132,19 +217,7 @@ "env": [ "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" ], - "stdin": { - "content": "", - "max": 128000000 - }, - "stdout": { - "name": "stdout", - "max": 128000000 - }, - "stderr": { - "name": "stderr", - "max": 128000000 - }, - "cpuLimit": 1, + "cpuLimit": 0, "realCpuLimit": 0, "clockLimit": 2, "memoryLimit": 128000000, diff --git a/tests/convert/cpplint/task.json b/tests/convert/cpplint/task.json index f007b8e..7762cdd 100644 --- a/tests/convert/cpplint/task.json +++ b/tests/convert/cpplint/task.json @@ -10,6 +10,92 @@ "sandboxToken": "", "outputPath": "/tmp/joj3_result.json", "stages": [ + { + "name": "healthcheck", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "env": [], + "cpuLimit": 0, + "realCpuLimit": 0, + "clockLimit": 2, + "memoryLimit": 128000000, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { + "args": [ + "/usr/local/bin/repo-health-checker", + "-root=.", + "-repoSize=10", + "-checkFileSumList=-checkFileNameList=" + ], + "clockLimit": 2, + "memoryLimit": 128000000, + "procLimit": 50, + "copyOut": [ + "stdout", + "stderr" + ] + }, + { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-check-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "ece280-joj", + "--group-config", + "=100:24" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ], + "clockLimit": 2, + "memoryLimit": 128000000, + "procLimit": 50, + "copyOut": [ + "stdout", + "stderr" + ] + } + ] + } + }, + "parsers": [ + { + "name": "healthcheck", + "with": { + "score": 1 + } + }, + { + "name": "debug", + "with": { + "score": 0 + } + } + ] + }, { "name": "[cq] Cpplint", "group": "cq", @@ -25,20 +111,19 @@ "--exclude=build", "h7/ex2.cpp" ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], + "env": [], "stdin": { - "content": "", - "max": 128000000 + "content": "" }, "stdout": { "name": "stdout", - "max": 65000000000000 + "max": 65000000000000, + "pipe": true }, "stderr": { "name": "stderr", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "cpuLimit": 1000000000000000, "realCpuLimit": 0, @@ -134,19 +219,7 @@ "env": [ "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" ], - "stdin": { - "content": "", - "max": 128000000 - }, - "stdout": { - "name": "stdout", - "max": 128000000 - }, - "stderr": { - "name": "stderr", - "max": 128000000 - }, - "cpuLimit": 1, + "cpuLimit": 0, "realCpuLimit": 0, "clockLimit": 2, "memoryLimit": 128000000, diff --git a/tests/convert/diff/task.json b/tests/convert/diff/task.json index 76ecc7f..2d7b4dc 100644 --- a/tests/convert/diff/task.json +++ b/tests/convert/diff/task.json @@ -10,6 +10,92 @@ "sandboxToken": "", "outputPath": "/tmp/joj3_result.json", "stages": [ + { + "name": "healthcheck", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "env": [], + "cpuLimit": 0, + "realCpuLimit": 0, + "clockLimit": 2, + "memoryLimit": 128000000, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { + "args": [ + "/usr/local/bin/repo-health-checker", + "-root=.", + "-repoSize=10", + "-checkFileSumList=-checkFileNameList=" + ], + "clockLimit": 2, + "memoryLimit": 128000000, + "procLimit": 50, + "copyOut": [ + "stdout", + "stderr" + ] + }, + { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-check-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "ece280-joj", + "--group-config", + "=100:24" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ], + "clockLimit": 2, + "memoryLimit": 128000000, + "procLimit": 50, + "copyOut": [ + "stdout", + "stderr" + ] + } + ] + } + }, + "parsers": [ + { + "name": "healthcheck", + "with": { + "score": 1 + } + }, + { + "name": "debug", + "with": { + "score": 0 + } + } + ] + }, { "name": "[joj] ex2-asan", "group": "joj", @@ -21,16 +107,16 @@ "./h7/build/ex2-asan", "-a" ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], + "env": [], "stdout": { "name": "stdout", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "stderr": { "name": "stderr", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "cpuLimit": 1000000000000000, "realCpuLimit": 0, @@ -42,8 +128,7 @@ "cpuSetLimit": "", "copyIn": { "h7/build/ex2-asan": { - "src": "/home/tt/.config/joj/h7/build/ex2-asan", - "max": 128000000 + "src": "/home/tt/.config/joj/h7/build/ex2-asan" } }, "copyInCached": {}, @@ -62,12 +147,8 @@ }, "cases": [ { - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], "stdin": { - "src": "/home/tt/.config/joj/homework/h7/e2/case0.in", - "max": 128000000 + "src": "/home/tt/.config/joj/homework/h7/e2/case0.in" }, "cpuLimit": 1000000000, "clockLimit": 2000000000, @@ -79,12 +160,8 @@ ] }, { - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], "stdin": { - "src": "/home/tt/.config/joj/homework/h7/e2/case1.in", - "max": 128000000 + "src": "/home/tt/.config/joj/homework/h7/e2/case1.in" }, "cpuLimit": 1000000000, "clockLimit": 2000000000, @@ -167,19 +244,7 @@ "env": [ "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" ], - "stdin": { - "content": "", - "max": 128000000 - }, - "stdout": { - "name": "stdout", - "max": 128000000 - }, - "stderr": { - "name": "stderr", - "max": 128000000 - }, - "cpuLimit": 1, + "cpuLimit": 0, "realCpuLimit": 0, "clockLimit": 2, "memoryLimit": 128000000, diff --git a/tests/convert/keyword/task.json b/tests/convert/keyword/task.json index 4201fa7..ee59550 100644 --- a/tests/convert/keyword/task.json +++ b/tests/convert/keyword/task.json @@ -10,6 +10,92 @@ "sandboxToken": "", "outputPath": "/tmp/joj3_result.json", "stages": [ + { + "name": "healthcheck", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "env": [], + "cpuLimit": 0, + "realCpuLimit": 0, + "clockLimit": 2, + "memoryLimit": 128000000, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { + "args": [ + "/usr/local/bin/repo-health-checker", + "-root=.", + "-repoSize=10", + "-checkFileSumList=-checkFileNameList=" + ], + "clockLimit": 2, + "memoryLimit": 128000000, + "procLimit": 50, + "copyOut": [ + "stdout", + "stderr" + ] + }, + { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-check-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "ece280-joj", + "--group-config", + "=100:24" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ], + "clockLimit": 2, + "memoryLimit": 128000000, + "procLimit": 50, + "copyOut": [ + "stdout", + "stderr" + ] + } + ] + } + }, + "parsers": [ + { + "name": "healthcheck", + "with": { + "score": 1 + } + }, + { + "name": "debug", + "with": { + "score": 0 + } + } + ] + }, { "name": "[cq] Filelength", "group": "cq", @@ -24,20 +110,19 @@ "*.cpp", "*.h" ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], + "env": [], "stdin": { - "content": "", - "max": 128000000 + "content": "" }, "stdout": { "name": "stdout", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "stderr": { "name": "stderr", - "max": 800000000000000 + "max": 800000000000000, + "pipe": true }, "cpuLimit": 1000000000000000, "realCpuLimit": 0, @@ -49,8 +134,7 @@ "cpuSetLimit": "", "copyIn": { "tools/filelength": { - "src": "/home/tt/.config/joj/tools/filelength", - "max": 128000000 + "src": "/home/tt/.config/joj/tools/filelength" } }, "copyInCached": {}, @@ -132,19 +216,7 @@ "env": [ "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" ], - "stdin": { - "content": "", - "max": 128000000 - }, - "stdout": { - "name": "stdout", - "max": 128000000 - }, - "stderr": { - "name": "stderr", - "max": 128000000 - }, - "cpuLimit": 1, + "cpuLimit": 0, "realCpuLimit": 0, "clockLimit": 2, "memoryLimit": 128000000,