Install Judge
Original source: Hướng dẫn cài đặt hệ thống chấm điểm trực tuyến VNOJ sử dụng Docker
Author: Trần Viết Thiện
Install docker
Find out more at Install the Compose plugin!
$ sudo apt-get update
$ sudo apt-get install docker-compose-plugin
Setting up judge configuration on admin site
Access your online judge admin site and navigate to the Judge section.
Create judges and save their judge ID and key (case in point, create three judges named Yuri, Naomi, Sayuki).
Create compilation environment
Download the compilation environment (execute this on both Local Server and Remote Judge):
$ git clone https://github.com/VNOI-Admin/judge-server
$ cd judge-server/.docker
$ sudo apt install make
$ sudo make <judge-tier>
You can replace <judge-tier> with tiervnoj, tier1, tier2, or tier3. Higher tiers include more languages but have larger sizes.
Create judge on the server
Create configuration files for each judge with the format <judge-name>.yml (Yuri, Naomi, Sayuki) and include the following information
id: <judge-name>
key: <judge-key>
problem_storage_globs:
- /problems/*
Note: Replace <judge-name> and <judge-key> with the IDs and keys you previously created on the web.
In this example, we will run Yuri on the Local Server.
Build docker image
$ sudo docker run \
--name <judge-name> \
--network="host" \
-v <directory-to-problem-data-storage>:/problems \
--cap-add=SYS_PTRACE \
-d \
--restart=always \
vnoj/judge-<judge-tier>:latest \
run -p 9999 -c /problems/<judge-name>.yml localhost -A 0.0.0.0 -a 9111
Notes:
- For each judge, replace
<judge-name>,<judge-name>.yml(judge config), and9111(PID) with unique values for each instance. - Judges running on the same Local Server must have different IDs (case in point, replace
9111with9112,9113, etc.). - Adjust the file path to the online judge's problem data storage directory, change
<directory-to-problem-data-storage>to your own configuration.
Check the status of the judge
Open Docker logs to verify the installation result of the judge:
$ sudo docker logs -ft <judge-name>