#-*- mode: org; tab-width: 4; indent-tabs-mode: t; -*-
Copyright (C) 2009 Jakob Truelsen. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled ”GNU Free Documentation License”.
The djudge is a relativly simple judging solution, its security is based on apparmor. The main structure of the system is as follows.
A server called an Overlord, has the role of governing work, it is a single point of failure and a nice bottle neck. The Overlord does almost no work itself, instead all the work is send to Drones. A Drone can connect to the Overlord, they comunicate via The Drone Overlord Protocol. Two types of Clients can connect to the Overlord, a synchronious and an asyncronious, each Client issues commands according to The Client Overlord Protocol. These orders are then forwarded by the Overlord to one or all Drones.
All communication between applications consists of a series of packages. A package is simply a binary string terminated by a newline (‘\n’). Any occurences of ‘\n’ or ‘\’ within a package must be escaped as “\\n” and “\\” respectivly.
The client start by sending either “syncclient” or “asyncclient” dependent on the type of the client. To which the overlord must respord with “success”. All following communication is request respose based. The client sends one of the following requests and the overlord responds:
- status
- The client sends the message “status”, the overlord reponds with a Run Code, followed by a package contaning a textual representation of the status of the server. This command is instant.
- list
- The client sends the message “list”, the overlord responds with a package for each entry it has, containing its name. Finally it sends a package contaning the empty string. This command is instant.
- dispose
- The client send the message “dispose”, followed by the name of an entry. The overlord the deletes deletes the entry from its repository, and lazyly asks all Drones to do the same. It then sends a Run Code, followed by a package conating some text that can safely be ignored. This command is instant.
- push
- The client sends the message “push”, followed by the name af an entry. The entry must allredy be in the overlord repository. The overlord then makes all drones currently attached, import the entry named. It then returns a Run Code, followed by a package contaning some textual description of what has happened that can safely bee igrored. This command is instant.
- import
- The client sends the message “import”, followed by an entry name and a tar.bz2 archive. The overlord will check that the archive contains an valid entry and that the name is unused. It will place the entry in its repository. And return a Run Code followed by a package contaning various information depending on the Run Code. This command is not instant.
- judge
- The client sends the message “judge”, followed by an entry name, a language name and a blob contaning the source code to be judged. The overlord then forwards this information to a drone that judges the program. It then return a Run Code followed by a package contaning information depending on the Run Code.
The “config.ini” file must hold the configuration for the entry
- memory
- Memory limit in megabytes, default: 100mb.
- output
- Output limit in kilobytes, default: 50mb. Note this is realy only relavant if a special judge is used.
- timebase
- Let x be the number of seconds, the reference solution took to run on the given input, then the time limit for the given problem will be time := timebase + timescale x.
- timescale
- see timebase, default 0.0;
- displayfailedinput
- If true, display the input on which a user fails, to the user, default: false.
- languages
- Comma seperated list of allowed languages, default: all.