Tiny judge server. docker based.
akapen is judge server for competitive programming. Every judges run on secure docker container.
just type 4 commands.
git clone https://github.com/kekeho/akapen
cd akapen
docker-compose build # build akapen
sh build-worker.sh # build worker containers
docker-compose up
then, boot all system include redis(port: 6379) and akapen.
Throw task json like ↓ into redis compile_queue
list.
{
"user": {
"id": "abc1234"
},
"uuid": "e8411f06-c3db-436b-8d57-7af03c962b5f",
"language": "python3",
"code": "print(input())",
"input": "abcdef",
"assert": "abcdef\n",
"memory": "1M",
"time": "1000000000"
}
Judge results will appear on redis results
list.
{
"user": {
"id": "abc1234"
},
"uuid": "e8411f06-c3db-436b-8d57-7af03c962b5f",
"language": "python3",
"code": "print(input())",
"input": "abcdef",
"assertion": "abcdef\n",
"memory": "1M",
"time": "1000000000",
"status": "AC",
"output": "abcdef\n",
"stderr": "",
"exec_time": "432427451"
}
Now, just supported only AC
, WA
, RE
, TLE
, Compiled
, JSE
status | detail |
---|---|
AC | Accepted |
WA | Wrong Answer |
RE | Runtime Error |
TLE | Time Limit Exceeded |
Compiled | Compiled |
JSE | Judge server Error |
Now, just supported only python3.
- CPU limit
1 judge container can use single core, 5% of all (cpu-period=100000, cpu-quota=5000) - Offline
- PIDs limit
10 (anti fork-bomb) - Time info
exec_time gets from docker inspect (StartedAt, FinishedAt)
In akapen, the unit of time is nanoseconds
docker-compose run judge nimble test