{"id":15007472,"url":"https://github.com/dmoj/judge-server","last_synced_at":"2025-05-14T05:10:31.302Z","repository":{"id":15024526,"uuid":"17750275","full_name":"DMOJ/judge-server","owner":"DMOJ","description":"Judging backend server for the DMOJ online judge.","archived":false,"fork":false,"pushed_at":"2025-03-31T22:37:37.000Z","size":7221,"stargazers_count":929,"open_issues_count":78,"forks_count":271,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-05-12T18:02:26.579Z","etag":null,"topics":["competitive-programming","computer-science","contest-platform","freebsd","linux","online-judge","python","sandbox"],"latest_commit_sha":null,"homepage":"https://dmoj.ca","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DMOJ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-03-14T15:14:10.000Z","updated_at":"2025-05-11T12:30:39.000Z","dependencies_parsed_at":"2023-02-15T19:30:29.528Z","dependency_job_id":"c01f5c45-7a0b-45b9-8811-09b90cdf4eda","html_url":"https://github.com/DMOJ/judge-server","commit_stats":{"total_commits":3800,"total_committers":46,"mean_commits":82.6086956521739,"dds":0.6152631578947368,"last_synced_commit":"582f444a0e1035cc2e3d332d462b2fbe0cab19c1"},"previous_names":["dmoj/judge"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DMOJ%2Fjudge-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DMOJ%2Fjudge-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DMOJ%2Fjudge-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DMOJ%2Fjudge-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DMOJ","download_url":"https://codeload.github.com/DMOJ/judge-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076850,"owners_count":22010611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["competitive-programming","computer-science","contest-platform","freebsd","linux","online-judge","python","sandbox"],"created_at":"2024-09-24T19:10:12.905Z","updated_at":"2025-05-14T05:10:31.249Z","avatar_url":"https://github.com/DMOJ.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/DMOJ/online-judge/blob/master/logo.png?raw=true\" width=\"120px\"\u003e\n  \u003cbr\u003e\n  DMOJ Judge\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/DMOJ/judge-server/actions?query=workflow%3Abuild\"\u003e\n    \u003cimg alt=\"Linux Build Status\" src=\"https://img.shields.io/github/actions/workflow/status/DMOJ/judge-server/build.yml?branch=master\u0026logo=linux\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://ci.dmoj.ca/view/DMOJ/job/dmoj-judge-freebsd-py3/\"\u003e\n    \u003cimg alt=\"FreeBSD Build Status\" src=\"https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.dmoj.ca%2Fview%2FDMOJ%2Fjob%2Fdmoj-judge-freebsd-py3%2F\u0026logo=freebsd\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/DMOJ/judge-server\"\u003e\n    \u003cimg alt=\"Coverage\" src=\"https://img.shields.io/codecov/c/github/DMOJ/judge-server.svg\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"LICENSE.md\"\u003e\n    \u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/DMOJ/judge-server\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://dmoj.ca/about/discord/\"\u003e\n    \u003cimg src=\"https://img.shields.io/discord/677340492651954177?color=%237289DA\u0026label=Discord\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nContest judge backend for the [DMOJ site](https://github.com/DMOJ/online-judge) interface, supporting \u003cb\u003eIO-based\u003c/b\u003e, \u003cb\u003einteractive\u003c/b\u003e, and \u003cb\u003esignature-graded\u003c/b\u003e tasks, with \u003cb\u003eruntime data generators\u003c/b\u003e and \u003cb\u003ecustom output validators\u003c/b\u003e.\n\nSee it in action at [dmoj.ca](https://dmoj.ca/)!\n\n## Supported platforms and runtimes\n\nThe judge implements secure grading on Linux and FreeBSD machines.\n\n|     | Linux | FreeBSD |\n| --: | :---: | :-----: |\n| x64 | [✔](https://github.com/DMOJ/judge-server/actions/workflows/build.yml) | [✔](https://ci.dmoj.ca/job/dmoj-judge-freebsd/) |\n| x86 | ✔ | ¯\\\\\\_(ツ)\\_/¯ |\n| x32 | ✔ | \u0026mdash; |\n| ARM | [✔](https://github.com/DMOJ/judge-server/actions/workflows/build.yml) | ❌ |\n\nVersions up to and including [v1.4.0](https://github.com/DMOJ/judge-server/releases/tag/v1.4.0) also supported grading on Windows machines.\n\nVersions up to and including [v3.0.2](https://github.com/DMOJ/judge-server/releases/tag/v3.0.2) also supported grading\nwith pure ptrace without seccomp, which is useful on Linux kernel versions before 4.8.\n\nThe DMOJ judge does **not** need a root user to run on Linux machines: it will run just fine under a normal user.\n\nSupported languages include:\n\n* C++ 11/14/17/20 (GCC and Clang)\n* C 99/11\n* Java 8-19\n* Python 2/3\n* PyPy 2/3\n* Pascal\n* Mono C#/F#/VB\n\nThe judge can also grade in the languages listed below:\n\n* Ada\n* Algol 68\n* AWK\n* Brain\\*\\*\\*\\*\n* COBOL\n* D\n* Dart\n* Forth\n* Fortran\n* Go\n* Groovy\n* Haskell\n* INTERCAL\n* JavaScript (Node.js and V8)\n* Kotlin\n* Lean 4\n* LLVM IR\n* Lua\n* NASM\n* Objective-C\n* OCaml\n* Perl\n* PHP\n* Pike\n* Prolog\n* Racket\n* Ruby\n* Rust\n* Scala\n* Chicken Scheme\n* sed\n* Steel Bank Common Lisp\n* Swift\n* Tcl\n* Turing\n* V8 JavaScript\n* Zig\n\n## Installation\n\nInstalling the DMOJ judge creates two executables in your Python's script directory: `dmoj` and `dmoj-cli`.\n`dmoj` is used to connect a judge to a DMOJ site instance, while `dmoj-cli` provides a command-line interface to a\nlocal judge, useful for testing problems.\n\nFor more detailed steps, read the [installation instructions](https://docs.dmoj.ca/#/judge/setting_up_a_judge).\n\nNote that **the only Linux distribution with first-class support is the latest Debian**, with the default `apt` versions of all runtimes. This is [what we run on dmoj.ca](https://dmoj.ca/runtimes/matrix/), and it should \"just work\". While the judge will likely still work with other distributions and runtime versions, some runtimes might fail to initialize. In these cases, please [file an issue](https://github.com/DMOJ/judge-server/issues).\n\n### Stable build\n\n[![PyPI version](https://badge.fury.io/py/dmoj.svg)](https://pypi.org/project/dmoj/)\n[![PyPI](https://img.shields.io/pypi/pyversions/dmoj.svg)](https://pypi.org/project/dmoj/)\n\nWe periodically publish builds [on PyPI](https://pypi.org/project/dmoj/). This is the easiest way to get started,\nbut may not contain all the latest features and improvements.\n\n```\n$ pip install dmoj\n```\n\n### Bleeding-edge build\n\nThis is the version of the codebase we run live on [dmoj.ca](https://dmoj.ca/).\n\n```\n$ git clone --recursive https://github.com/DMOJ/judge-server.git\n$ cd judge-server\n$ pip install -e .\n```\n\nSeveral environment variables can be specified to control the compilation of the sandbox:\n\n* `DMOJ_TARGET_ARCH`; use it to override the default architecture specified for compiling the sandbox (via `-march`).\n   Usually this is `native`, but will not be specified on ARM unless `DMOJ_TARGET_ARCH` is set (a generic, slow build will be compiled instead).\n\n### With Docker\n\nWe maintain Docker images with all runtimes we support in the [runtimes-docker](https://github.com/DMOJ/runtimes-docker) project.\n\nRuntimes are split into three tiers of decreasing support. Tier 1 includes\nPython 2/3, C/C++ (GCC only), Java 8, and Pascal. Tier 3 contains all the\nruntimes we run on [dmoj.ca](https://dmoj.ca/). Tier 2 contains some in-between\nmix; read the `Dockerfile` for each tier for details. These images are rebuilt\nand tested every week to contain the latest runtime versions.\n\nThe script below spawns a tier 1 judge image. It expects the relevant\nenvironment variables to be set, the network device to be `enp1s0`, problems\nto be placed under `/mnt/problems`, and judge-specific configuration to be in\n`/mnt/problems/judge.yml`. Note that runtime configuration is already done for you,\nand will be merged automatically into the `judge.yml` provided.\n\n```\n$ git clone --recursive https://github.com/DMOJ/judge-server.git\n$ cd judge-server/.docker\n$ make judge-tier1\n$ exec docker run \\\n    --name judge \\\n    -p \"$(ip addr show dev enp1s0 | perl -ne 'm@inet (.*)/.*@ and print$1 and exit')\":9998:9998 \\\n    -v /mnt/problems:/problems \\\n    --cap-add=SYS_PTRACE \\\n    -d \\\n    --restart=always \\\n    dmoj/judge-tier1:latest \\\n    run -p15001 -s -c /problems/judge.yml \\\n    \"$BRIDGE_ADDRESS\" \"$JUDGE_NAME\" \"$JUDGE_KEY\"\n```\n\n## Usage\n\n### Running a judge server\n\n```\n$ dmoj --help\nusage: dmoj [-h] [-p SERVER_PORT] -c CONFIG [-l LOG_FILE] [--no-watchdog]\n            [-a API_PORT] [-A API_HOST] [-s] [-k] [-T TRUSTED_CERTIFICATES]\n            [-e ONLY_EXECUTORS | -x EXCLUDE_EXECUTORS] [--no-ansi]\n            server_host [judge_name] [judge_key]\n\nSpawns a judge for a submission server.\n\npositional arguments:\n  server_host           host to connect for the server\n  judge_name            judge name (overrides configuration)\n  judge_key             judge key (overrides configuration)\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -p SERVER_PORT, --server-port SERVER_PORT\n                        port to connect for the server\n  -c CONFIG, --config CONFIG\n                        file to load judge configurations from\n  -l LOG_FILE, --log-file LOG_FILE\n                        log file to use\n  --no-watchdog         disable use of watchdog on problem directories\n  -a API_PORT, --api-port API_PORT\n                        port to listen for the judge API (do not expose to\n                        public, security is left as an exercise for the\n                        reverse proxy)\n  -A API_HOST, --api-host API_HOST\n                        IPv4 address to listen for judge API\n  -s, --secure          connect to server via TLS\n  -k, --no-certificate-check\n                        do not check TLS certificate\n  -T TRUSTED_CERTIFICATES, --trusted-certificates TRUSTED_CERTIFICATES\n                        use trusted certificate file instead of system\n  -e ONLY_EXECUTORS, --only-executors ONLY_EXECUTORS\n                        only listed executors will be loaded (comma-separated)\n  -x EXCLUDE_EXECUTORS, --exclude-executors EXCLUDE_EXECUTORS\n                        prevent listed executors from loading (comma-\n                        separated)\n  --no-ansi             disable ANSI output\n  --skip-self-test      skip executor self-tests\n```\n\n### Running a CLI judge\n\n```\n$ dmoj-cli --help\nusage: dmoj-cli [-h] -c CONFIG\n                [-e ONLY_EXECUTORS | -x EXCLUDE_EXECUTORS]\n                [--no-ansi]\n\nSpawns a judge for a submission server.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -c CONFIG, --config CONFIG\n                        file to load judge configurations from\n  -e ONLY_EXECUTORS, --only-executors ONLY_EXECUTORS\n                        only listed executors will be loaded (comma-separated)\n  -x EXCLUDE_EXECUTORS, --exclude-executors EXCLUDE_EXECUTORS\n                        prevent listed executors from loading (comma-\n                        separated)\n  --no-ansi             disable ANSI output\n  --skip-self-test      skip executor self-tests\n```\n\n## Documentation\n\nFor info on the problem file format and more, [read the documentation](https://docs.dmoj.ca).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmoj%2Fjudge-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmoj%2Fjudge-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmoj%2Fjudge-server/lists"}