judge & scoreboard server for parallel programming coureses
- git clone this repository.
- Run
ninja
in the root of this repository. The command builds thesb
andxjudge
binaries. - Create a scoreboardd user & group
scoreboardd
. - Install
xjudge
binary with setgidscoreboardd
.sudo install -Dm2711 -gscoreboardd xjudge /usr/local/bin/xjudge
- Install the
sb
binary intoscoreboardd
's home.sudo install -Dm755 -oscoreboardd -gscoreboardd sb /home/scoreboardd/sb
- Create the directory for the scoreboard socket.
sudo install -dm750 -oscoreboardd -gscoreboardd /run/scoreboard
- (Optional) Install the TA privilege file
/etc/judge.priv
. Users who can read this file are allowed to use privileged features of the judge.sudo install -Dm440 -gta /dev/null /etc/judge.priv
Run the sb
binary as the scoreboard user. The sb
command runs the scoreboard server, which accepts judge requestse from the xjudge
command and outputs the scoreboard as HTML files.
- Configuration files are read from
./config
. - Data is stored in
./storage
- HTML scoreboard is output in the
./out
directory. This can be changed by the--outputdir
flag.
- Every time
xjudge
is invoked by a user, it first determines which homework it is judging. Runningxjudge --homework hw1
judgeshw1
. If/usr/local/bin/hw1-judge
is a symbolic link toxjudge
, then runninghw1-judge
also judgeshw1
. - It communicates with the scoreboard server to ask about the configuration of the the homework. See Configuration.
- It copies the files to a temporary directory.
- It tries to build the target using
ninja
. - It run the cases with the runner. See Runner.
- After collecting the results, the judge submit the results to the scoreboard.
Homeworks are specified in the scoreboard's ./config/*.toml
files. See configs/
in this repository for examples. Each homework is specified by a config file. Each config file specify:
target
: the ninja build target.runner
: the absolute path of the runner.files
: mandantory and optional files for the homework.penalty_time
: time penalty for failing a test case in seconds.cases
: test case names.
Runners are used to actually run each test case, specified by the test cases' name. See runners/
in this repository for examples.
xjudge
runs each test case with: runner [--debug] casename executable
. Where:
runner
is the absolute path of the runner--debug
is a optional flag used to enable verbose output of the runnercasename
is the name of the test caseexecutable
is the target executable built by the students' code
The runner outputs JSON in stdout, with 4 attributes:
passed
: bool, whether the test case is passedtime
: float, the execution time of the test caseverdict
: string, such asAccepted
,Wrong Answer
, etcdetails
: string, optional description for the verdict