Giter Club home page Giter Club logo

domjudge-packaging's Introduction

DOMjudge-logo

DOMjudge

pipeline status Coverity Scan Status CodeQL alerts

This is the Programming Contest Jury System "DOMjudge" version 8.4.0DEV

DOMjudge is a system for running a programming contest, like the ICPC regional and world championship programming contests.

Documentation

For more information on installation and requirements see the documentation under the doc/manual directory. There is an HTML version of the documentation available, prebuilt from reStructuredText sources.

There's also team documentation available, prebuilt in PDF format from reStructuredText sources, but it contains default/example settings. To include the correct settings for your local environment, DOMjudge has to be properly configured first, as parts of the configuration are used in it (e.g. the URL to the team interface of DOMjudge). For more information, see the documentation.

All documentation is also available online at the DOMjudge homepage: https://www.domjudge.org/documentation Please note that this documentation is from the latest stable release and thus might not apply to your version.

A fresh copy of the repository source tree must first be bootstrapped, generating the configure script and documentation. This can be done by running 'make dist', see the online documentation, section "Developer information" for more details.

There is a wiki which collects other pieces of information about specific configurations or integrations: https://github.com/DOMjudge/domjudge/wiki

Copyright & Licensing

DOMjudge is Copyright (c) 2004 - 2024 by the DOMjudge developers and all respective contributors. The current DOMjudge developers are Jaap Eldering, Nicky Gerritsen, Keith Johnson, Thijs Kinkhorst, Mart Pluijmaekers, Michael Vasseur and Tobias Werth; see the manual for a complete list of contributors.

DOMjudge, including its documentation, is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. See the file COPYING.

Additionally, parts of this system are based on other programs, which are covered by other copyrights. This will be noted in the files themselves and these copyrights/attributions can also be found in the DOMjudge manual.

The following JavaScript libraries/snippets are included:

  • coloris: Momo Bassit, licensed under the MIT license, see COPYING.MIT.
  • Ace editor: licensed under the BSD licence, see COPYING.BSD.

The default validator from the Kattis problemtools package is included, licensed under the MIT licence, see COPYING.MIT.

The M4 autoconf macros are licensed under all-permissive and GPL3+ licences; see the respective files under m4/ for details.

The DOMjudge tarball ships external library dependencies in the webapp/vendor directory. These are covered by their individual licenses as specified in the file composer.lock.

Contact

The DOMjudge homepage can be found at: https://www.domjudge.org/

Announcements of new releases are sent to our low volume announcements mailinglist. Subscription to this list is done via https://www.domjudge.org/mailman/postorius/lists/domjudge-announce.domjudge.org/

The developers can be reached through the mailinglist [email protected]. You need to be subscribed before you can post. Information, subscription and archives are available at: https://www.domjudge.org/mailman/postorius/lists/domjudge-devel.domjudge.org/

DOMjudge has a Slack workspace where a number of developers and users of DOMjudge linger. More information can be found at https://www.domjudge.org/chat

domjudge-packaging's People

Contributors

agcom avatar bodo-riediger avatar dup4 avatar edomora97 avatar eldering avatar incaseoftrouble avatar jeremy-c-london avatar jgleitz avatar kevinjil avatar meistert avatar mike-ghinea avatar nickygerritsen avatar nya3jp avatar pingiun avatar thijskh avatar tom93 avatar tossy310 avatar ubergeek42 avatar vmcj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

domjudge-packaging's Issues

Install docs with domserver

After the installation of domserver I found there's no documentation installed. So the documentation links in admin page won't work.

Documentation:
Judge manual (also PDF)
Administrator manual (also PDF)
Team manual (PDF only)

I think we can add

sudo -u domjudge make docs
make install-docs

to /docker/domserver/build.sh in order to make those links work and avoid the ugly File not found. error.

Dockerized judgehost can't judge

After submitting something, verdict is "compiler-error" and output is:

Compiling failed with exitcode 255, compiler output:
/opt/domjudge/judgehost/bin/runguard: creating cgroup: Failed to remove a non-empty group(50029)
Try `/opt/domjudge/judgehost/bin/runguard --help' for more information.
Error: failed to set /sys/fs/cgroup/cpuset/domjudge/dj_cgroup_1454_1521230721/cpuset.mems: Permission denied
Error: failed to set /sys/fs/cgroup/cpuset/domjudge/dj_cgroup_1454_1521230721/cpuset.cpus: Permission denied

7.1.1 Docker Domserver Invalid credentials for admin/admin

Description of the problem

The default password described in docker document is invalid for domserver 7.1.1 on docker

Your environment

Include details about your installation here.

  • DOMjudge version 7.1.1
  • Operating system Windows 10 Docker
  • nginx

Steps to reproduce

Replace this with a description how we can reproduce your bug.

Expected behaviour

successfully login.

Actual behaviour

get Invalid credentials.

Any other information that you want to share?

domserver:latest

Dockerized judgehost makes it hard to see custom comparer errors

[Apr 12 17:05:27.345] judgedaemon[36]: Judge started on judge-1-0 [DOMjudge/5.3.3]
[Apr 12 17:05:27.349] judgedaemon[36]: Registering judgehost on endpoint http://<REDACTED>/api
[Apr 12 17:05:27.636] judgedaemon[36]: Found unfinished judging j246 in my name; given back
[Apr 12 17:05:28.157] judgedaemon[36]: Judging submission s26 (endpoint default) (t1/p8/java), id j247...
[Apr 12 17:05:29.136] judgedaemon[36]: Working directory: /opt/domjudge/judgehost/judgings/judge-1-0/endpoint-default/c2-s26-j247
[Apr 12 17:05:31.060] judgedaemon[36]: executing chroot script: 'chroot-startstop.sh start'
[Apr 12 17:05:31.714] testcase_run.sh[169]: Comparing failed with exitcode 255, compare script output:
/opt/domjudge/judgehost/bin/runguard: cannot start `/opt/domjudge/judgehost/judgings/judge-1-0/endpoint-default/executable/Heidi_Learns_Hashing__Easy__cmp/run': No such file or directory
Try `/opt/domjudge/judgehost/bin/runguard --help' for more information.
[Apr 12 17:05:31.723] judgedaemon[36]: error: Unknown exitcode from testcase_run.sh for s26, testcase 1: 1

After ignoring the testcase and running bash into the container:

root@judge-1:/# ls -lha /opt/domjudge/judgehost/judgings/judge-1-0/endpoint-default/executable/Heidi_Learns_Hashing__Easy__cmp/run
-rwxr-xr-x 1 domjudge domjudge 1.6K Apr 12 16:59 /opt/domjudge/judgehost/judgings/judge-1-0/endpoint-default/executable/Heidi_Learns_Hashing__Easy__cmp/run

So clearly the file exists. Not sure what's going on there, investigating...

Ease deployment and maintenance

Context: After some tests & small contests, we are starting to use Domjudge a lot more. We are planning to host the AdaByron (an Spanish competitive programming contest http://ada-byron.es/) this year, so the objective was to simplify the deployment and maintenance of DomJudge as much as possible, so you may create your own instance without a deep knowledge of Domjudge or Docker internals.

All the customizations for our use case can be seen in the following repo: https://github.com/rmartinsanta/domjudge-automation.

Steps to test:

  1. Install Ubuntu Server (tested with 18.04.3) in a VM or equivalent.
  2. Clone the repo (git clone https://github.com/rmartinsanta/domjudge-automation)
  3. Install and reboot (./install-domjudge.sh)

The installation script will do all the tedious tasks, and give further instructions when finished.
There is a monitoring stack ready to use (cd mon-template && docker-compose up -d), that will expose Grafana on port 3000.

There is one thing I do not like but I have not found an alternative way to do it:
I am exposing the docker socket to the judgehost container (needed to dinamically assign a CPU ID), but as the container is already privileged, I do not think it is dangerous from a security point of view, correct me if I am wrong.

I would like to known your opinion about it, which parts would you like to add to this repo (so I can open a PR with them), what could be improved, etc.

How to start judgehost

Hello

I have installed the live image and entered the option 'domserver & judgehost', but for some reason when I enter the 'judgehosts' option, the server appears offline.

How can I set it to online and working?

Thanks

Dockerized DOMserver 5.3.3 fails to start because of missing domjudge-fpm.conf

First attempt:

sed: can't read /etc/php/7.0/fpm/pool.d/domjudge.conf: No such file or directory

Next reboots:

ln: failed to create symbolic link '/etc/php/7.0/fpm/pool.d/domjudge.conf': File exists

This is because /opt/domjudge/domserver/etc/domjudge-fpm.conf does not exist in 5.3.3.

BTW, I think the check at https://github.com/DOMjudge/domjudge-packaging/blob/master/docker/domserver/scripts/start.sh#L89 is incorrect, it should be -L (check symlink) since the script creates a symlink and not a file.
Sed can be used with --follow-symlinks to edit the linked file and not the link itself.

Compile Error Judgehost

I've been running judgehost docker (different machine) using this code
docker run -it --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --name judgehost-0 --hostname judgedaemon-0 -e DAEMON_ID=0 -e DOMSERVER_BASEURL=http://192.168.1.7:12345/ -e JUDGEDAEMON_USERNAME=judgehost -e JUDGEDAEMON_PASSWORD=password domjudge/judgehost:latest

but after I test submit a code for a problem , judgehost can't compile the code

[Jun 07 21:35:39.856] judgedaemon[40]: Judge started on judgedaemon-0-0 [DOMjudge/5.3.2]
[Jun 07 21:35:39.861] judgedaemon[40]: Registering judgehost on endpoint http://192.168.1.7:12345/api
[Jun 07 21:35:40.098] judgedaemon[40]: No submissions in queue (for endpoint default), waiting...
[Jun 07 21:35:55.425] judgedaemon[40]: Judging submission s7 (endpoint default) (t2/p1/java), id j7...
[Jun 07 21:35:55.755] judgedaemon[40]: Working directory: /opt/domjudge/judgehost/judgings/judgedaemon-0-0/endpoint-default/c2-s7-j7
[Jun 07 21:35:55.831] judgedaemon[40]: Fetching new executable 'java_javac_detect'
[Jun 07 21:35:57.058] judgedaemon[40]: Judging s7/j7: compile error
[Jun 07 21:35:57.204] judgedaemon[40]: No submissions in queue (for endpoint default), waiting...
[Jun 07 21:36:17.660] judgedaemon[40]: Judging submission s8 (endpoint default) (t2/p1/cpp), id j8...
[Jun 07 21:36:18.057] judgedaemon[40]: Working directory: /opt/domjudge/judgehost/judgings/judgedaemon-0-0/endpoint-default/c2-s8-j8
[Jun 07 21:36:18.129] judgedaemon[40]: Fetching new executable 'cpp'
[Jun 07 21:36:18.388] judgedaemon[40]: Judging s8/j8: compile error
[Jun 07 21:36:18.583] judgedaemon[40]: No submissions in queue (for endpoint default), waiting...

Compiling failed with exitcode 255, compiler output:
/opt/domjudge/judgehost/bin/runguard: creating cgroup: Failed to remove a non-empty group(50029)
Try `/opt/domjudge/judgehost/bin/runguard --help' for more information.
Error: failed to set /sys/fs/cgroup/memory/domjudge/dj_cgroup_75_1528400097/memory.memsw.limit_in_bytes: Cgroup, requested group parameter does not exist

domjudge/domserver:7.2.0 failed to restart

Description of the problem

I try to restart the domserver docker, and it fails to run the /script/start.sh and logs:

[..] Updating database credentials file
sed: can't read webapp/.env.local.php: No such file or directory

Your environment

  • centos 7.7

Steps to reproduce

similar with #50 ,
docker-compose.yml:

version: "3"
services:
    database:
        image: mariadb:10.4
        hostname: database
        networks:
            - domjudge_net
        env_file:
            - domserver.env
        volumes:
            - ../data/database:/var/lib/mysql
        command: --max-connections=1000
    domserver:
        image: domjudge/domserver:7.2.0
        hostname: domserver
        networks:
            - domjudge_net
        env_file:
            - domserver.env
        volumes:
            - /sys/fs/cgroup:/sys/fs/cgroup:ro
        ports:
            - 127.0.0.1:5283:80
        depends_on:
            - database
networks:
    domjudge_net:
        driver: bridge

domjudge.env::

CONTAINER_TIMEZONE=Asia/Shanghai
TZ=Asia/Shanghai
MYSQL_HOST=database
MYSQL_DATABASE=domjudge
MYSQL_USER=domjudge
MYSQL_PASSWORD=b9NIhdxuJAhqcVW8bg4RgUni
MYSQL_ROOT_PASSWORD=UmHDaoOMl1Nzoke1lyV5FZbSfYXmJvkO
DJ_DB_INSTALL_BARE=1
  • docker-compose up -d
  • docker-compose restart

Expected behaviour

Success. Or it may fail due to some database or network problems.

Actual behaviour

It fails during the early run of /script/start.sh.

Here is the full log:

[..] Setting timezone

Current default time zone: 'Asia/Shanghai'
Local time is now:      Wed Feb 19 14:51:52 CST 2020.
Universal Time is now:  Wed Feb 19 06:51:52 UTC 2020.

[ok] Container timezone set to: Asia/Shanghai

[..] Changing nginx and PHP configuration settings
[ok] Done changing nginx and PHP configuration settings

[..] Updating database credentials file
grep: webapp/.env.local: No such file or directory
[ok] Updated database credentials file

[..] Checking database connection
MySQL database domjudge not found on host db; exiting
[..] Setting timezone

Current default time zone: 'Asia/Shanghai'
Local time is now:      Wed Feb 19 14:52:01 CST 2020.
Universal Time is now:  Wed Feb 19 06:52:01 UTC 2020.

[ok] Container timezone set to: Asia/Shanghai

[..] Changing nginx and PHP configuration settings
[ok] Done changing nginx and PHP configuration settings

[..] Updating database credentials file
sed: can't read webapp/.env.local.php: No such file or directory

Any other information that you want to share?

Image domjudge/domserver:7.1.1 works fine.

Build issues

Here I am again, since we're having a contest this weekend I was getting everything ready and trying to update to the new DOMJudge build 7.1.0.

Now I had some trouble with that.
The 7.1.0 build fails for me using the existing database from an earlier version (7.0.4 is the most recent working version).

The logs give me what I think is a database migration issue:

Exception trace:


  at /opt/domjudge/domserver/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:90


 Doctrine\DBAL\Driver\PDOConnection->query() at /opt/domjudge/domserver/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:908


 Doctrine\DBAL\Connection->executeQuery() at /opt/domjudge/domserver/lib/vendor/doctrine/migrations/lib/Doctrine/Migrations/Version/Executor.php:347


 Doctrine\Migrations\Version\Executor->executeVersionExecutionResult() at /opt/domjudge/domserver/lib/vendor/doctrine/migrations/lib/Doctrine/Migrations/Version/Executor.php:216


 Doctrine\Migrations\Version\Executor->executeMigration() at /opt/domjudge/domserver/lib/vendor/doctrine/migrations/lib/Doctrine/Migrations/Version/Executor.php:128


 Doctrine\Migrations\Version\Executor->execute() at /opt/domjudge/domserver/lib/vendor/doctrine/migrations/lib/Doctrine/Migrations/Version/Version.php:181


 Doctrine\Migrations\Version\Version->execute() at /opt/domjudge/domserver/lib/vendor/doctrine/migrations/lib/Doctrine/Migrations/Migrator.php:180


 Doctrine\Migrations\Migrator->executeMigration() at /opt/domjudge/domserver/lib/vendor/doctrine/migrations/lib/Doctrine/Migrations/Migrator.php:146


 Doctrine\Migrations\Migrator->migrate() at /opt/domjudge/domserver/lib/vendor/doctrine/migrations/lib/Doctrine/Migrations/Tools/Console/Command/MigrateCommand.php:162


 Doctrine\Migrations\Tools\Console\Command\MigrateCommand->execute() at /opt/domjudge/domserver/lib/vendor/doctrine/doctrine-migrations-bundle/Command/MigrationsMigrateDoctrineCommand.php:50


 Doctrine\Bundle\MigrationsBundle\Command\MigrationsMigrateDoctrineCommand->execute() at /opt/domjudge/domserver/lib/vendor/symfony/console/Command/Command.php:255


 Symfony\Component\Console\Command\Command->run() at /opt/domjudge/domserver/lib/vendor/symfony/console/Application.php:933


 Symfony\Component\Console\Application->doRunCommand() at /opt/domjudge/domserver/lib/vendor/symfony/framework-bundle/Console/Application.php:87


 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /opt/domjudge/domserver/lib/vendor/symfony/console/Application.php:272


 Symfony\Component\Console\Application->doRun() at /opt/domjudge/domserver/lib/vendor/symfony/framework-bundle/Console/Application.php:73


 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /opt/domjudge/domserver/lib/vendor/symfony/console/Application.php:148


 Symfony\Component\Console\Application->run() at /opt/domjudge/domserver/webapp/bin/console:42




In PDOConnection.php line 88:


                                                                               


  [PDOException (42000)]                                                       


  SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP INDEX `c  


  id`; check that it exists

Is there anything I'm missing?

MySQL database domjudge not found on host mariadb; exiting

Hi! The commands at the docker image page seems not working.

Steps

  1. Database container (using mysql image)

    docker run -it --name dj-mariadb -e MYSQL_ROOT_PASSWORD=rootpw -e MYSQL_USER=domjudge -e MYSQL_PASSWORD=djpw -e MYSQL_DATABASE=domjudge -p 13306:3306 mysql --max-connections=1000

    Starts successfully and healthy.

  2. DOMserver container

    docker run --link dj-mariadb:mariadb -it -e MYSQL_HOST=mariadb -e MYSQL_USER=domjudge -e MYSQL_DATABASE=domjudge -e MYSQL_PASSWORD=djpw -e MYSQL_ROOT_PASSWORD=rootpw -p 12345:80 --name domserver domjudge/domserver:latest

    Fails with log,

    [..] Setting timezone
    
    Current default time zone: 'Europe/Amsterdam'
    Local time is now:      Wed Oct 28 19:02:58 CET 2020.
    Universal Time is now:  Wed Oct 28 18:02:58 UTC 2020.
    
    [ok] Container timezone set to: Europe/Amsterdam
    
    [..] Changing nginx and PHP configuration settings
    [ok] Done changing nginx and PHP configuration settings
    
    [..] Generating credential files
    Password file 'dbpasswords.secret' already exists, leaving untouched.
    Running 'genrestapicredentials'... file 'restapi.secret' created.
    Running 'gensymfonysecret'... file 'symfony_app.secret' created.
    Running 'genadminpassword'... file 'initial_admin_password.secret' created.
    [ok] Generated credential files
    
    [..] Checking database connection
    MySQL database domjudge not found on host mariadb; exiting
    

Logrotate is incomplete

Today we found out that our server was full of domjudge-logs.

The problem is that the logs /var/log/domjudge/*.log are nicely rotated, but the logs in /var/log/domjudge/judgehosts/*.log (and /var/log/domjudge/domserver, which was not that full, and logrotate did not like it as we had it with owner root and group writeable by group www-data. I do not know what the correct permissions should be but this is irrelevant to the issue.) are ignored.

It would nicely be solved if debian/docker-common.logrotate is changed to something like this:

/var/log/domjudge/*.log /var/log/domjudge/*/*.log {
        weekly
        missingok
        rotate 6
        compress
        delaycompress
        notifempty
}

I am not sure about some things such as if we rather explicitly want domjudge/judgehosts/*.log or the generic domjudge/*/*.log, I think the latter is probably more future-proof.

I also do not know why our permissions of /var/log/domjudge/domserver were weird, but that has probably been a hotfix during one of our events.

Problem on supporting python3

I'm getting trouble trying to support python3 using dockerized domjudge.

I'm trying the following sequence in order to "force" install python3 on the judgehost:

gabriel@maratona-secomp:~$ docker exec -it secomp-judge-0 bash
root@judgedaemon-0:/# cd /opt/domjudge/judgehost/bin
root@judgedaemon-0:/opt/domjudge/judgehost/bin# ./dj_run_chroot 
Entering chroot in '/chroot/domjudge'.
# python3         
/bin/sh: 1: python3: not found
# apt-get install python3
Reading package lists... Done     
[apt-get output removed by me]
Processing triggers for libc-bin (2.24-11+deb9u4) ...
# python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
# exit
Exited chroot in '/chroot/domjudge'.
root@judgedaemon-0:/opt/domjudge/judgehost/bin# exit
exit

Even after this I can't judge a python script, I'm getting:

Compiling failed with exitcode 127, compiler output:
/opt/domjudge/judgehost/judgings/judgedaemon-0-0/endpoint-default/executable/py3/run: 20: /opt/domjudge/judgehost/judgings/judgedaemon-0-0/endpoint-default/executable/py3/run: python3: not found

Any clue about this case?

judgehost docker image: REST api file for DOMjudge v5.3.2

Not sure if I missed a step during installation of the docker image for judgehost, but with the rest API file as this:

echo "default	${DOMSERVER_BASEURL}api/v4	${JUDGEDAEMON_USERNAME}	${JUDGEDAEMON_PASSWORD}" > etc/restapi.secret

The judgehost will fail with the following error message:

[Feb 12 14:50:11.021] judgedaemon[29]: error: Error while executing curl POST to url http://domserver/api/v4/judgehosts: http status code: 400, response: {"error":"Function 'v4\/judgehosts#POST' does not exist."}

To fix it, I simply removed /v4 from the REST api url.

I built the containers with the build.sh script, like so:

./build.sh 5.3.2

Dockerised judgehost crashes on fork bomb submission

I start the judgehost with

docker run -it --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --name judgehost-0 --link domserver:domserver --hostname judgedaemon-0 -e DAEMON_ID=0 -e DOMSERVER_BASEURL="<redacted>" -e JUDGEDAEMON_PASSWORD=<redacted> domjudge/judgehost:latest

and run (in another shell)

docker exec -it judgehost-0 /opt/domjudge/judgehost/bin/create_cgroups

as in #11.
The executables are all as provided, no modifications. I then submit the C solution (to hello world in the demo contest):

#include <unistd.h>

int main( )
{
    while(1) {
        fork();
    }
    return 0;
}

and this happens:

[Mar 22 06:55:34.449] judgedaemon[29]: Judging submission s13 (endpoint default) (t5164706/p1/c), id j42...
[Mar 22 06:55:34.842] judgedaemon[29]: Working directory: /opt/domjudge/judgehost/judgings/judgedaemon-0-0/endpoint-default/c1-s13-j42
[Mar 22 06:55:35.166] judgedaemon[29]: executing chroot script: 'chroot-startstop.sh start'
[Mar 22 06:55:41.586] testcase_run.sh[803]: error: found processes still running as 'domjudge-run-0', check manually:
  863 program <defunct>
  864 program <defunct>
  865 program <defunct>
  866 program <defunct>
  867 program <defunct>
  868 program <defunct>
  869 program <defunct>
  870 program <defunct>
  871 program <defunct>
  872 program <defunct>
  873 program <defunct>
  874 program <defunct>
  875 program <defunct>
  876 program <defunct>
  877 program <defunct>
  878 program <defunct>
  879 program <defunct>
  880 program <defunct>
  881 program <defunct>
  882 program <defunct>
  883 program <defunct>
  884 program <defunct>
  885 program <defunct>
  886 program <defunct>
  887 program <defunct>
  888 program <defunct>
  889 program <defunct>
  890 program <defunct>
  891 program <defunct>
  892 program <defunct>
  893 program <defunct>
  894 program <defunct>
  895 program <defunct>
  896 program <defunct>
  897 program <defunct>
  898 program <defunct>
  899 program <defunct>
  900 program <defunct>
  901 program <defunct>
  902 program <defunct>
  903 program <defunct>
  904 program <defunct>
  905 program <defunct>
  906 program <defunct>
  907 program <defunct>
  908 program <defunct>
  909 program <defunct>
  910 program <defunct>
  911 program <defunct>
  912 program <defunct>
  913 program <defunct>
  914 program <defunct>
  915 program <defunct>
  916 program <defunct>
  917 program <defunct>
  918 program <defunct>
  919 program <defunct>
  920 program <defunct>
  921 program <defunct>
  922 program <defunct>
  923 program <defunct>
  924 program <defunct>
  925 program <defunct>
[Mar 22 06:55:41.596] judgedaemon[29]: error: Unknown exitcode from testcase_run.sh for s13, testcase 1: 127

the container exits and the judgehost is down. shouldn't runguard protect against stuff like this?

Fix resolv.conf in dockerized judgehost's chroot

To download stuff from a dockerized judgehost's chroot, e.g. to use apt-get, a proper /etc/resolv.conf file is needed.

I fixed this by running chroot '/chroot/domjudge' /bin/sh -c "echo '$(cat /etc/resolv.conf)' > /etc/resolv.conf" inside the container, I need to check if this can be automatically done when creating the image though.

DOMjudge Register not work

Hello
When i open this url http://ip/register i got the following error however http://ip works well
Oops! An Error Occurred
The server returned a "500 Internal Server Error".
Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.

Docker build using debian:latest

Sorry to bother you guys again.

Recently the docker debian:latest tag changed distro version to "buster" (10?). My previous issue with php-mcrypt being deprecated with the php version used in buster is not the only issue in debian buster.

The judgehost dockerfile includes installation of openjdk-8-jdk, which does not exist in the default sources of debian buster.

There's a few solutions for this, either adding a source for the openjdk 8, using default-jdk (java 11 in buster) or pinning the base image to debian:stretch.

Now java 11 is quite different from 8 and and I've run into issues quite often with running applications developed in 8 on a version 11 jre. So I have chosen the last option for now, knowing that I've had domjudge running stable with debian stretch.

I'd love to hear your opinion on this.

Dockerized judgehost failed on program run

Hi!
I see this message on judging every program:

/opt/domjudge/judgehost/bin/runguard: cannot start /testcase001/execdir/program': Resource temporarily unavailable Try /opt/domjudge/judgehost/bin/runguard --help' for more information.

Compilation is OK
Version is 6.0.3

Docker: JMS serializer cache dir not writable

Hi, I've been trying to deploy the DOMjudge docker images for a while now.

I always run the commands in the README.md file,
Change the password on the system for the judgehost.
Now the variants that I have are:

When I use the version 5.3.3 or below I manage to have access for the API using the normal link:
http://localhost:12345/api/

If I run any other version above it what I get is the known:
error 500 "Internal Server Error"

In any of the versions when I run the Judgehost Image what I get if I change the
DOMSERVER_BASEURL environment variable from http://domserver to http://localhost:12345/
is:
For the version 6.0.3:

Registering judgehost on endpoint http://localhost:12345/api/v4
[Mar 20 14:00:13.270] judgedaemon[41]: error: Error while executing curl POST to url http://localhost:12345/api/v4/judgehosts: Failed to connect to localhost port 12345: Connection refused

And the version 5.3.3:

[Mar 20 14:43:49.920] judgedaemon[41]: Judge started on judgedaemon-0-0 [DOMjudge/5.3.3]
[Mar 20 14:43:49.937] judgedaemon[41]: Registering judgehost on endpoint http://localhost:12345/api
[Mar 20 14:43:49.989] judgedaemon[41]: error: Error while executing curl POST to url http://localhost:12345/api/judgehosts: Failed to connect to localhost port 12345: Connection refused

And if I don't change the DOMSERVER_BASEURL, meaning trying to connect the Judgehost in the wrong URL of the DOMSERVER what I get is that actually the new instance of the Judgehost connects to the system and waits for the new submitions.
The terminal keeps in this position:

For the version 6.0.3

[Mar 20 14:01:09.212] judgedaemon[41]: Judge started on judgedaemon-0-0 [DOMjudge/6.0.3]
[Mar 20 14:01:09.221] judgedaemon[41]: Registering judgehost on endpoint http://domserver/api/v4
[Mar 20 14:01:09.703] judgedaemon[41]: No submissions in queue (for endpoint default), waiting...
[Mar 20 14:41:19.304] judgedaemon[41]: Judge started on judgedaemon-0-0 [DOMjudge/5.3.3]
[Mar 20 14:41:19.310] judgedaemon[41]: Registering judgehost on endpoint http://domserver/api
[Mar 20 14:41:19.589] judgedaemon[41]: No submissions in queue (for endpoint default), waiting...

Being the only difference the API version from v3 to v4.

And if I send a submission using the web application I actually receives in the console of the Judgehost at this second case when it is connected to the wrong URL of the server.

[Mar 20 14:56:18.196] judgedaemon[41]: Working directory: /opt/domjudge/judgehost/judgings/judgedaemon-0-0/endpoint-default/c2-s1-j1
[Mar 20 14:56:18.312] judgedaemon[41]: Fetching new executable 'c'
[Mar 20 14:56:19.432] judgedaemon[41]: executing chroot script: 'chroot-startstop.sh start'
[Mar 20 14:56:20.081] judgedaemon[41]: Fetched new input,output testcase 1 for problem p1
[Mar 20 14:56:20.089] judgedaemon[41]: Fetching new executable 'compare'
[Mar 20 14:56:21.207] judgedaemon[41]: Fetching new executable 'run'
[Mar 20 14:56:22.059] judgedaemon[41]: executing chroot script: 'chroot-startstop.sh stop'
[Mar 20 14:56:22.399] judgedaemon[41]: Judging s1/j1 finished

So I would like to know if my Judgehost is connected to the right Server and if it's possible for me to run a newer version with access to the API.

Currently I'm running all these docker images in a Linux VM inside the VMware Workstation software.

Would appreciate if someone could help me.
Thanks.

Dockerized DOMjudge can't read dbpasswords.secret

Running the following (where db is a healthy MySQL docker image, net is a Docker network, and the MYSQL_* parameters are all valid):

sudo docker run --name=server \
                --network=net \
                -it --detach \
                -p 80:80 \
                --restart=always \
                --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro \
                -e 'CONTAINER_TIMEZONE=Europe/Zurich' \
                -e 'MYSQL_HOST=db' \
                -e 'MYSQL_DATABASE=db' \
                -e 'MYSQL_USER=domjudge' \
                -e 'MYSQL_PASSWORD=domjudge' \
                -e 'MYSQL_ROOT_PASSWORD=root_password' \
                -e 'DJ_DB_INSTALL_BARE=1' \
                domjudge/domserver:5.3.2

results in a DOMjudge that always returns an HTTP 500; nginx's log indicates Cannot read database credentials file /opt/domjudge/domserver/etc/dbpasswords.secret in /opt/domjudge/domserver/lib/use_db.php on line 11.

chmod 644 /opt/domjudge/domserver/etc/dbpasswords.secret, i.e. make the file world-readable, fixes the issue.

Provide a way to name judgehosts

Is there a way to name the judgehost when creating the container?

It looks to me like the names are completely random, which is not great when e.g. one judgehost has an issue and you need to figure out which is which.

Docker Swarm incompatiblity

Using a privileged container (the judgehost) makes the docker-compose.yml incompatible with Docker Swarm, why does it exactly need to be privileged? Are there any alternatives to make it work without using privileged: true?

Thanks in advance

Update to latest domjudge

Hello

I was wondering if there's a way that one can upgrade to the latest domjudge. I'm currently using the 2018-01-09 image, which uses domjudge 5.3.2 but I'd like to update to 6.0.1

Thanks

Does the domserver image need cgroups?

The description of the Docker domserver image suggests giving it access to cgroups, but I don't remember domservers requiring that - am I missing something?

How to deploy with HTTPS/SSL?

I deploy domserver and judgehost seperately using docker, but when I try to put my ssl cert into container, it just doesn't work.
I use the following dockerfile

FROM domjudge/domserver:latest
COPY default /etc/nginx/sites-enabled/
COPY default /etc/nginx/sites-available/
COPY default /home
EXPOSE 80
EXPOSE 443

and the content of default is

# Generated from 'nginx-conf.in' on Sat Jun 27 08:38:51 UTC 2020.

# nginx configuration for DOMjudge

### upstream ###
#
# always include this and make sure it points to the socket of PHP-FPM
upstream domjudge {
	server unix:/var/run/php-fpm-domjudge.sock; # if using with etc/domjudge-fpm.conf
	#server unix:/run/php/php7.0-fpm.sock; # default on ubuntu servers
}

### http host config ###
#

# server {
# 	listen 80;
# 	listen [::]:80;
# 
# 	include /opt/domjudge/domserver/etc/nginx-conf-inner;
# }

# Alternatively, use HTTPS and redirect HTTP to HTTPS:

# server {
# 	listen   80;
# 	listen   [::]:80;
# 	server_name _default_;
# 	return 308 https://$host$request_uri;  # enforce https
# }

# Or block all cleartext HTTP requests
server {
	listen   80;
	listen   [::]:80;
	server_name _default_;
	return 426;  # do not allow plain HTTP
}

server {
	listen   443;
	listen   [::]:443;

	ssl on;
	ssl_certificate /cert/conf/live/my.domain/fullchain.pem;
	ssl_certificate_key /cert/conf/live/my.domain/privkey.pem;
	ssl_session_timeout 5m;
	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA;
	ssl_prefer_server_ciphers on;

      # Strict-Transport-Security is not set by default since it will break
      # instalations without a valid TLS certificate. Enable it if your
      # DOMjudge installation only runs with a valid TLS certificate.
	add_header Strict-Transport-Security max-age=31556952;

	include /opt/domjudge/domserver/etc/nginx-conf-inner;
}

Then i docker exec -it domserver /bin/bash in to container, i see the default in /home but the default in /etc/nginx/sites-enabled/ is the original config file. I overwrite the default and reload nginx using service nginx reload but the website i see is the default website of nginx.

What step did i miss?

domjudge/domserver:7.2.0 failed to startup

Description of the problem

The latest image domjudge/domserver:7.2.0 fails to run the /script/start.sh and logs:

[..] Updating database credentials file
sed: can't read webapp/app/config/parameters.yml: No such file or directory

Your environment

  • Ubuntu 18.04.3 LTS
  • Docker 19.03.5, build 633a0ea838
  • docker-compose 1.17.1
  • domjudge/domserver:7.2.0

Steps to reproduce

  • Pull the docker image mariadb:10.4 and domjudge/domserver:7.2.0.
  • Run docker-compose up -d with docker-compose.yml and domserver.env in below.
  • View the logs produced by the container of domjudge/domserver:7.2.0.

docker-compose.yml:

version: "3"
services:
    database:
        image: mariadb:10.4
        hostname: database
        networks:
            - domjudge_net
        env_file:
            - domserver.env
        volumes:
            - ../data/database:/var/lib/mysql
        command: --max-connections=1000
    domserver:
        image: domjudge/domserver:7.2.0
        hostname: domserver
        networks:
            - domjudge_net
        env_file:
            - domserver.env
        volumes:
            - /sys/fs/cgroup:/sys/fs/cgroup:ro
        ports:
            - 127.0.0.1:5283:80
        depends_on:
            - database
networks:
    domjudge_net:
        driver: bridge

domjudge.env:

CONTAINER_TIMEZONE=Asia/Shanghai
TZ=Asia/Shanghai
MYSQL_HOST=database
MYSQL_DATABASE=domjudge
MYSQL_USER=domjudge
MYSQL_PASSWORD=b9NIhdxuJAhqcVW8bg4RgUni
MYSQL_ROOT_PASSWORD=UmHDaoOMl1Nzoke1lyV5FZbSfYXmJvkO
DJ_DB_INSTALL_BARE=1

Expected behaviour

Success. Or it may fail due to some database or network problems.

Actual behaviour

It fails during the early run of /script/start.sh.

Here is the full log:

[..] Setting timezone

Current default time zone: 'Asia/Shanghai'
Local time is now:      Tue Jan  7 13:11:05 CST 2020.
Universal Time is now:  Tue Jan  7 05:11:05 UTC 2020.

[ok] Container timezone set to: Asia/Shanghai

[..] Changing nginx and PHP configuration settings
[ok] Done changing nginx and PHP configuration settings

[..] Updating database credentials file
sed: can't read webapp/app/config/parameters.yml: No such file or directory

Any other information that you want to share?

Image domjudge/domserver:7.1.2 works fine.

judgehosts returns Cgroup, requested group parameter does not exist on problem evaluation

Hi, I am running domServer and domjudgehosts. I am using the latest dockerhub images

  • domjudge/judgehost:6.0.3
  • domjudge/domserver:6.0.3

I was able to successfully create the contest, problems on the working setup but on the evaluation of submitted problem, I get the following error.

Compiling failed with exitcode 255, compiler output:
/opt/domjudge/judgehost/bin/runguard: creating cgroup: Unknown error 50029
Try `/opt/domjudge/judgehost/bin/runguard --help' for more information.
Error: failed to set /sys/fs/cgroup/memory/domjudge/dj_cgroup_1240_1551353391/memory.memsw.limit_in_bytes: Cgroup, requested group parameter does not exist

while tried to create Cgroup using the instruction here - #11 (comment)

I get the following output -

root@judgedaemon-0:/# /opt/domjudge/judgehost/bin/create_cgroups
mount: cpuset is already mounted or /sys/fs/cgroup/cpuset busy
mount: memory is already mounted or /sys/fs/cgroup/memory busy

"Raw" judgehost image?

Opinionated request: please provide a "raw" judgehost image without anything that's not strictly needed for the judgehost, i.e. no Java, C++, etc.

Right now it takes quite a while to create a judgehost, and it seems like part of it is installing software that won't be used or will be overwritten with different versions anyway. :-)

Docker build fials: mcrypt deprecation

Trying to build a docker image right now fails due to mcrypt being deprecated in php 7.2+. The current debian:latest has php 7.3.4.

I'm working on the dockerfiles to include the mcrypt extension from pecl.

But this made me think: Are there any other potential issues with php 7.3?

Problem running domjudge after installing from apt-get install domjudge

I've installed domjudge from debian package repository according to:
https://www.domjudge.org/download
but when I try to enter the webpage:
localhost/domjudge
I see blank webpage.

I thing that the problem is with database connection.
I see in domserver install documentation that I need to run:
dj_setup_database
but I don't have than script on my computer.
I don't have also file:
dbpasswords.secret
I see only file:
/etc/domjudge/initial_admin_password.secret
but it is rather not to database.

DOMjudge Docker missing LDAP extension

Hello everyone,

I'm trying to initiate DOMjudge from the 5.3 checkout using the following command:
(after running the MariaDB container)
docker run -v [path-to-domjudge-checkout]:/domjudge -v /sys/fs/cgroup:/sys/fs/cgroup:ro --link dj-mariadb:mariadb -it -e MYSQL_HOST=mariadb -e MYSQL_USER=domjudge -e MYSQL_DATABASE=domjudge -e MYSQL_PASSWORD=djpw -e MYSQL_ROOT_PASSWORD=rootpw -p 12345:80 --name domjudge --privileged domjudge/domjudge-contributor

I receive these following warnings:

Cannot create cache directory /root/.composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /root/.composer/cache/files/, or directory is not writable. Proceeding without cache

And at the end of the script start.sh, during the copy of the webserver config I receive this final error that interrupts the installation:

[..] Copying webserver config
sed: can't read /etc/php/7.2/fpm/pool.d/domjudge.conf: No such file or directory

Does anyone can help me?
Am I forgetting any step?

Thanks in advance.

Docker: use DOMjudge supplied FPM config and allow to overwrite limits using environment variables

Currently the Docker image uses the default FPM config shipped with Debian, but we have our own version in the repo. It would be better to use that one, as it has increased limits.

While we are at it, it would be great if we could have an environment variable that will increase pm.max_children in the Docker container.

DOMjudge/domjudge#421 is probably related to this issue, as it reaches the maximum number of children.

Team manual rst2pdf error: No such file or directory: 'fc-match'

The error occurs when the team manual is generated using sphinx-build/rst2pdf in the contributor and domserver Docker containers.

The rst2pdf package uses the fc-match command from the fontconfig package, but doesn't list it as a dependency for some reason so fontconfig isn't installed.

The build exit status is 0 (success), but the output includes a long error message and the generated file domjudge-team-manual.pdf is empty.

(The build happens to work in the gitlabci container because it installs packaging-dev, which pulls in fontconfig.)

Steps to reproduce

git clone https://github.com/DOMjudge/domjudge.git
cd domjudge
git checkout 656477610b41
docker run -v $PWD:/domjudge -it domjudge/domjudge-contributor@sha256:b4cc5d9069aac62497e39ee320b199cd31fe5bc72499fed96a5fd505990607a7

Expected behaviour

domjudge/doc/manual/build/team/domjudge-team-manual.pdf should contain the team manual.

Actual behaviour

domjudge-team-manual.pdf exists but is empty.

Build output

...
make html team
make[2]: Entering directory '/domjudge/doc/manual'
...
sphinx-build -b pdf . build/team
Running Sphinx v1.6.7
making output directory...
loading translations [en]... done
loading pickled environment... not yet created
building [mo]: targets for 0 po files that are out of date
building [pdf]: targets for 18 source files that are out of date
updating environment: 18 added, 0 changed, 0 removed
reading sources... [100%] upgrading
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
processing domjudge-team-manual... 
team 
resolving references...
done
writing domjudge-team-manual... 
[ERROR] pdfbuilder.py:149 [Errno 2] No such file or directory: 'fc-match': 'fc-match'
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/rst2pdf/pdfbuilder.py", line 146, in write
    docwriter.write(doctree, destination)
  File "/usr/lib/python3/dist-packages/docutils/writers/__init__.py", line 80, in write
    self.translate()
  File "/usr/local/lib/python3.6/dist-packages/rst2pdf/pdfbuilder.py", line 643, in translate
    section_header_depth=self.section_header_depth
  File "/usr/local/lib/python3.6/dist-packages/rst2pdf/createpdf.py", line 173, in __init__
    self.loadStyles(stylesheets)
  File "/usr/local/lib/python3.6/dist-packages/rst2pdf/createpdf.py", line 276, in loadStyles
    def_dpi=self.def_dpi)
  File "/usr/local/lib/python3.6/dist-packages/rst2pdf/styles.py", line 358, in __init__
    fontList = findfonts.autoEmbed(style[key])
  File "/usr/local/lib/python3.6/dist-packages/rst2pdf/findfonts.py", line 322, in autoEmbed
    variants = findTTFont(fname)
  File "/usr/local/lib/python3.6/dist-packages/rst2pdf/findfonts.py", line 214, in findTTFont
    family = get_family(fname)
  File "/usr/local/lib/python3.6/dist-packages/rst2pdf/findfonts.py", line 178, in get_family
    data = make_string(subprocess.check_output(["fc-match", query]))
  File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'fc-match': 'fc-match'
FAILED
build succeeded.
make[2]: Leaving directory '/domjudge/doc/manual'
...

Fix

The obvious fix is to install fontconfig. There may be other solutions though, I'm not familiar with rst2pdf.

Pull request

#57, DOMjudge/domjudge#797 (for install instructions)

Support Python3

I have not been able to make Python3 work inside the judgehost, steps taken:

  1. Access judgehost using docker run
  2. Install python3 using apt
  3. Test in domjudge, fails because python3 is not available inside the chroot.
  4. Try to install python3 inside chroot container with commands like:
    '/opt/domjudge/judgehost/bin/dj_run_chroot "apt update && apt install python3" '. Command timeouts as internet is not available.

In #38 it looks like apt worked inside the chroot, how can I replicate the behaviour? Is there any other way to start using Python3?

Thanks in advance

Username for Debain

I have created a .vdi file but when i login it is asking for username. i know that the password is domjudge. But what is the username ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.