-
Notifications
You must be signed in to change notification settings - Fork 259
Connecting the ICPC Tools with DOMjudge
NOTE: this is still a WIP since the current ICPC Tools builds are broken
The ICPC Tools are a set of tools that can be used for ICPC-style contests. This page describes setting up some of them with DOMjudge:
- The CDS, which is needed for other tools to connect to.
- The resolver, which can be used to resolve a frozen scoreboard and announce winners.
- The presentation admin, a tool that can be used to control presentation clients.
- The presentation client, a tool that can display useful and nice information during a contest.
To use the ICPC Tools the following is needed:
- A running DOMjudge 7.0+ installation.
- Admin access to the DOMjudge installation.
- An active contest in that DOMjudge instance.
- A server (or other machine) to run the CDS. The CDS can run on Windows, Linux and macOS. This server should be able to reach the DOMjudge installation and the machines named below should be able to reach the server.
- A GUI machine to run the presentation admin.
- A GUI machine to run the resolver. This can be the same machine as the presentation admin, since the tools will not have to run at the same time. This machine should be hooked up to a beamer or big screen in the room where you will announce the results.
- One or more GUI machines to run presentation clients. Normally these are set up in the room(s) where the teams are sitting during the contest and hooked up to a beamer or big screen.
- A recent build of the ICPC Tools. Note that the builds on the ICPC Tools home page are not new enough; the builds that are linked there at the bottom might be, but this version is recommended and this guide is written using that version.
Note that the resolver supports running multiple connected machines in client/server mode, but this is will not be explained in this guide.
All machines that will run (one of) the ICPC Tools will require Java.
In DOMjudge, create a user with the API reader
, API writer
and Source code reader
roles and give it some (secure) password. Note down the username and password somewhere. Also note down the CID of the contest you want to use, which can be found on the jury contest page.
Note: if you run DOMjudge with the configuration option data_source
set to either 1
or 2
, you need to use the external ID of the contest instead of the CID. By default DOMjudge runs with data_source=0
and unless you know what you are doing you should not have to change this. However, DOMjudge Demoweb runs with data_source=1
so if you use that for testing use the external ID!
Download the ICPC tools from here and upload wlp.CDS-2.1.23.zip
to the server that will run the CDS. Unpack the ZIP file. Rename the wlp
directory to cds
so there is no confusion as to what the directory contains.
Replace the contests of the cds/usr/servers/cds/config/cdsConfig.xml
file with the following, replacing the values as instructed:
<cds>
<!-- Set location= to a directory that the user that will run the CDS can write to -->
<contest location="/home/cds/contest-data" recordReactions="false">
<!-- Set the url to the URL of your DOMjudge installation, followed by /api/contests/<cid>, where <cid> is your CID or external ID -->
<!-- Set the user and password to the user you created in the previous step -->
<ccs
url="https://www.domjudge.org/demoweb/api/contests/nwerc18"
user="cds"
password="somepassword" />
</contest>
</cds>
Now edit the file cds/usr/servers/cds/users.xml
and change the password of all the users to something secure. Do not change the usernames, otherwise you also need to update server.xml
in the same directory.
If you want a banner and/or logo to appear on presentations, you should do the following:
- Create the directory specified by
location
from the above XML. - Place a file called
banner.png
and/orlogo.png
in it.
If you have taken team photo's and want to show them, create a directory called teams
in the location
directory and create a subdirectory for every team named after the team ID from DOMjudge. In it, create a file called photo.jpg
.
If you have organization logo's, create a directory called organizations
in the location
directory and create a subdirectory for every organization named after the organization ID from DOMjudge. In it, create a file called logo.png
.
Now you can start the CDS by running cds/bin/server run cds
. This will keep a window open with some logging. If you want to run it in the background, use cds/bin/server start cds
(use stop
to stop it again).
Browse to https://:8443 and ignore the SSL error (see the last section of this page if you want to use a Let's Encrypt certificate). Click on Overview
just below the contest and it will pop up a login prompt. Enter the admin
credentials from the users.xml
file and you should get a page with some information. The first time you do this the CDS will get information from the DOMjudge event feed, so it might take a while, especially if the connection between DOMjudge and the CDS server is not very fast. You can click around a bit in the interface to see what it contains. At some point the value after Last event:
on the overview page should show the (contest-relative) time of the last event that occurred. You can check this value to be sure that the whole event feed up to the current point in time has been processed.
You should keep the CDS running at all times or at least while presentation clients are running or when you are starting up the resolver.
From the ICPC Tools zip, unpack presentationAdmin-2.1.23.zip
on the machine that will administer the presentation clients. Open a terminal and run:
cd <directory where the presentation admin has been unpacked to, normally called presentationAdmin-2.1.23>
./presAdmin.sh https://<server ip>:8443/ presAdmin <presAdmin password>
Replace <presAdmin password>
with the password of the presAdmin
user from users.xml
.
This will start up a GUI interface, that will later show all connected clients.
From the ICPC Tools zip, unpack presentations-2.1.23.zip
on the machines that will run the presentation clients. Open a terminal and run:
cd <directory where the presentation client has been unpacked to, normally called presentations-2.1.23>
./client.sh <someid> https://<server ip>:8443/ presentation <presAdmin password>
Replace <id>
with a unique ID that can be used to recognize this machine and <presentation password>
with the password of the presentation
user from users.xml
.
This will start up a full screen presentation client on the primary display of the machine, which can be controlled by the presentation admin.
TODO: when the client and admin doesn't crash anymore, explain how to use the admin and what presentations work
From the ICPC Tools zip, unpack resolver-2.1.23.zip
on the machines that will run the resolver. Open a terminal and run:
cd <directory where the presentation client has been unpacked to, normally called presentations-2.1.23>
./awards.sh
TODO explain awards tool to set up awards when it doesn't crash anymore
After saving the JSON from from the awards tool, we can run the resolver on it by running the following:
cd <directory where the presentation client has been unpacked to, normally called presentations-2.1.23>
./resolver.sh <path to directory containing JSON>
If you place a logo.png
file in the same directory as that JSON file, it will be displayed on the first page of the resolver. You can also copy the teams
and organizations
folders from the CDS, so they will show up during resolving.
Some useful arguments for the resolver are:
-
--fast 0.15
: speed up the resolver by a lot; useful for testing and verifying results. -
--display 2
: display the resolver on the secondary screen.
The resolver is controlled using the keyboard. The following keys are useful to know:
-
Q
(capital q): quit the resolver -
space
: move one step forward -
+
/-
: speed up / slow down the resolver one step