### Example Usage of vm-host-problem-watch.sh Source: https://github.com/vnoi-admin/judge-server/blob/master/contrib/vm-host-problem-watch/README.md Demonstrates how to use the script to watch a problem directory and notify a list of judges about updates. It shows the setup, a sample problem directory listing, and the script's output during an update. ```bash cat /code/judge-hosts-list judge1.example.com:9998 judge2.example.com:9998 judge3.example.com:9998 ``` ```bash ls /export/problems | head -n 5 apio bbc bkoi broi btoi ``` ```bash ./vm-host-problem-watch.sh /export/problems /code/judge-host-list Tue Oct 6 22:17:37 UTC 2020: Start watching /export/problems, notifying /code/judge-host-list Tue Oct 6 22:17:46 UTC 2020: Update problems [/export/problems/rgss/17/rgpc17p5/ MOVED_FROM init.yml] Tue Oct 6 22:17:46 UTC 2020 [judge1.example.com:9998]: As you wish. Tue Oct 6 22:17:46 UTC 2020 [judge2.example.com:9998]: As you wish. Tue Oct 6 22:17:46 UTC 2020 [judge3.example.com:9998]: As you wish. ``` -------------------------------- ### Install DMOJ Judge (Stable Build) Source: https://github.com/vnoi-admin/judge-server/blob/master/README.md Use this command to install the latest stable version of the DMOJ judge from PyPI. This is the simplest way to get started. ```bash $ pip install dmoj ``` -------------------------------- ### Install DMOJ Judge (Bleeding-Edge Build) Source: https://github.com/vnoi-admin/judge-server/blob/master/README.md Clone the repository and install the judge from source for the latest features. This method is recommended for development or if you need the most up-to-date code. ```bash git clone --recursive https://github.com/DMOJ/judge-server.git cd judge-server pip install -e . ``` -------------------------------- ### DMOJ Judge Server Help Source: https://github.com/vnoi-admin/judge-server/blob/master/README.md Displays the help message for the dmoj command, showing available arguments for running a judge server. Use this to understand configuration and connection options. ```bash $ dmoj --help usage: dmoj [-h] [-p SERVER_PORT] -c CONFIG [-l LOG_FILE] [--no-watchdog] [-a API_PORT] [-A API_HOST] [-s] [-k] [-T TRUSTED_CERTIFICATES] [-e ONLY_EXECUTORS | -x EXCLUDE_EXECUTORS] [--no-ansi] server_host [judge_name] [judge_key] Spawns a judge for a submission server. positional arguments: server_host host to connect for the server judge_name judge name (overrides configuration) judge_key judge key (overrides configuration) optional arguments: -h, --help show this help message and exit -p SERVER_PORT, --server-port SERVER_PORT port to connect for the server -c CONFIG, --config CONFIG file to load judge configurations from -l LOG_FILE, --log-file LOG_FILE log file to use --no-watchdog disable use of watchdog on problem directories -a API_PORT, --api-port API_PORT port to listen for the judge API (do not expose to public, security is left as an exercise for the reverse proxy) -A API_HOST, --api-host API_HOST IPv4 address to listen for judge API -s, --secure connect to server via TLS -k, --no-certificate-check do not check TLS certificate -T TRUSTED_CERTIFICATES, --trusted-certificates TRUSTED_CERTIFICATES use trusted certificate file instead of system -e ONLY_EXECUTORS, --only-executors ONLY_EXECUTORS only listed executors will be loaded (comma-separated) -x EXCLUDE_EXECUTORS, --exclude-executors EXCLUDE_EXECUTORS prevent listed executors from loading (comma- separated) --no-ansi disable ANSI output --skip-self-test skip executor self-tests ``` -------------------------------- ### Build and Run DMOJ Judge with Docker (Tier 1) Source: https://github.com/vnoi-admin/judge-server/blob/master/README.md This command sequence clones the judge-server repository, navigates to the Docker directory, builds a tier 1 judge image, and then runs it as a detached container. It configures networking, volume mounts for problems and configuration, and necessary capabilities. Ensure environment variables like BRIDGE_ADDRESS, JUDGE_NAME, and JUDGE_KEY are set. ```bash git clone --recursive https://github.com/DMOJ/judge-server.git cd judge-server/.docker make judge-tier1 exec docker run \ --name judge \ -p "$(ip addr show dev enp1s0 | perl -ne 'm@inet (.*)/.*@ and print$1 and exit')":9998:9998 \ -v /mnt/problems:/problems \ --cap-add=SYS_PTRACE \ -d \ --restart=always \ dmoj/judge-tier1:latest \ run -p15001 -s -c /problems/judge.yml \ "$BRIDGE_ADDRESS" "$JUDGE_NAME" "$JUDGE_KEY" ``` -------------------------------- ### DMOJ CLI Judge Help Source: https://github.com/vnoi-admin/judge-server/blob/master/README.md Displays the help message for the dmoj-cli command, showing available arguments for running a CLI judge. Use this to configure executor loading and output. ```bash $ dmoj-cli --help usage: dmoj-cli [-h] -c CONFIG [-e ONLY_EXECUTORS | -x EXCLUDE_EXECUTORS] [--no-ansi] Spawns a judge for a submission server. optional arguments: -h, --help show this help message and exit -c CONFIG, --config CONFIG file to load judge configurations from -e ONLY_EXECUTORS, --only-executors ONLY_EXECUTORS only listed executors will be loaded (comma-separated) -x EXCLUDE_EXECUTORS, --exclude-executors EXCLUDE_EXECUTORS prevent listed executors from loading (comma- separated) --no-ansi disable ANSI output --skip-self-test skip executor self-tests ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.