Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:

- name: Run tests
run: |
# github runner kernel for some reason doesn't have ext4 quota
# support, but does have tmpfs quotas
export TEST_QUOTAS=tmpfs
docker compose -p cms -f docker/docker-compose.test.yml run --rm testcms

- name: Upload test results to Codecov
Expand Down
12 changes: 9 additions & 3 deletions cms/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,20 @@ class DatabaseConfig:

@dataclass()
class WorkerConfig:
keep_sandbox: bool = False
# TODO delete entirely??
pass


@dataclass()
class FSQuotaSettings:
kb: int
inodes: int


@dataclass()
class SandboxConfig:
sandbox_implementation: str = "isolate"
# Max size of each writable file during an evaluation step, in KiB.
max_file_size: int = 1024 * 1024 # 1 GiB
fs_quota: FSQuotaSettings | None = None
# Max processes, CPU time (s), memory (KiB) for compilation runs.
compilation_sandbox_max_processes: int = 1000
compilation_sandbox_max_time_s: float = 10.0
Expand Down
12 changes: 2 additions & 10 deletions cms/grading/Job.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def __init__(
multithreaded_sandbox: bool = False,
archive_sandbox: bool = False,
shard: int | None = None,
keep_sandbox: bool = False,
sandboxes: list[str] | None = None,
sandbox_digests: dict[str, str] | None = None,
info: str | None = None,
Expand All @@ -108,9 +107,6 @@ def __init__(
allow multithreading.
archive_sandbox: whether the sandbox is to be archived.
shard: the shard of the Worker completing this job.
keep_sandbox: whether to forcefully keep the sandbox,
even if other conditions (the config, the sandbox status)
don't warrant it.
sandboxes: the paths of the sandboxes used in
the Worker during the execution of the job.
sandbox_digests: the digests of the sandbox archives used to
Expand Down Expand Up @@ -148,7 +144,6 @@ def __init__(
self.multithreaded_sandbox = multithreaded_sandbox
self.archive_sandbox = archive_sandbox
self.shard = shard
self.keep_sandbox = keep_sandbox
self.sandboxes = sandboxes
self.sandbox_digests = sandbox_digests
self.info = info
Expand All @@ -172,7 +167,6 @@ def export_to_dict(self) -> dict:
'multithreaded_sandbox': self.multithreaded_sandbox,
'archive_sandbox': self.archive_sandbox,
'shard': self.shard,
'keep_sandbox': self.keep_sandbox,
'sandboxes': self.sandboxes,
'sandbox_digests': self.sandbox_digests,
'info': self.info,
Expand Down Expand Up @@ -303,7 +297,6 @@ def __init__(
task_type: str | None = None,
task_type_parameters: object = None,
shard: int | None = None,
keep_sandbox: bool = False,
sandboxes: list[str] | None = None,
sandbox_digests: dict[str, str] | None = None,
info: str | None = None,
Expand All @@ -330,7 +323,7 @@ def __init__(

Job.__init__(self, operation, task_type, task_type_parameters,
language, multithreaded_sandbox, archive_sandbox,
shard, keep_sandbox, sandboxes, sandbox_digests, info, success,
shard, sandboxes, sandbox_digests, info, success,
text, files, managers, executables)
self.compilation_success = compilation_success
self.plus = plus
Expand Down Expand Up @@ -520,7 +513,6 @@ def __init__(
task_type: str | None = None,
task_type_parameters: object = None,
shard: int | None = None,
keep_sandbox: bool = False,
sandboxes: list[str] | None = None,
sandbox_digests: dict[str, str] | None = None,
info: str | None = None,
Expand Down Expand Up @@ -566,7 +558,7 @@ def __init__(
"""
Job.__init__(self, operation, task_type, task_type_parameters,
language, multithreaded_sandbox, archive_sandbox,
shard, keep_sandbox, sandboxes, sandbox_digests, info, success,
shard, sandboxes, sandbox_digests, info, success,
text, files, managers, executables)
self.input = input
self.output = output
Expand Down
Loading