Skip to content

Commit

Permalink
judge: add startup message for landlock
Browse files Browse the repository at this point in the history
  • Loading branch information
Riolku committed Jan 4, 2023
1 parent 13b43c1 commit e8f4ed0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions dmoj/citest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@

from dmoj import judgeenv
from dmoj.contrib import load_contrib_modules
from dmoj.cptbox import has_landlock
from dmoj.executors import executors
from dmoj.testsuite import Tester
from dmoj.utils.ansi import print_ansi


def ci_test(executors_to_test, overrides, allow_fail=frozenset()):
if has_landlock():
print('Running CI with landlock and seccomp...')
else:
print('Running CI with just seccomp...')

result = {}
failed = False
failed_executors = []
Expand Down
1 change: 1 addition & 0 deletions dmoj/cptbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
PTBOX_ABI_X32,
PTBOX_ABI_X64,
PTBOX_ABI_X86,
has_landlock,
)
from dmoj.cptbox.handlers import ALLOW, DISALLOW
from dmoj.cptbox.isolate import FilesystemSyscallKind, IsolateTracer
Expand Down
6 changes: 5 additions & 1 deletion dmoj/judge.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from dmoj import packet
from dmoj.control import JudgeControlRequestHandler
from dmoj.cptbox import has_landlock
from dmoj.error import CompileError
from dmoj.judgeenv import clear_problem_dirs_cache, env, get_supported_problems_and_mtimes, startup_warnings
from dmoj.monitor import Monitor
Expand Down Expand Up @@ -592,7 +593,10 @@ def main(): # pragma: no cover
executors.load_executors()
contrib.load_contrib_modules()

print('Running live judge...')
if has_landlock():
print('Running live judge with landlock and seccomp...')
else:
print('Running live judge with just seccomp...')

for warning in judgeenv.startup_warnings:
print_ansi('#ansi[Warning: %s](yellow)' % warning)
Expand Down

0 comments on commit e8f4ed0

Please sign in to comment.