8000 GitHub - ysy-phoenix/mini-judge: A lightweight, high-concurrency code judge system.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ysy-phoenix/mini-judge

Repository files navigation

🌟 Mini-Judge

Ruff

📖 About📦 Installation🚀 Quick Start🛠 Development🛣 Roadmap

📖 About

Mini-Judge is a lightweight, high-performance online judge system for evaluating code solutions, supporting multiple programming languages and evaluation modes.

Warning

Simple and naive implementation, without security guarantees.

📦 Installation

option 1: conda

conda create -n judge python=3.11 -y
conda activate judge

pip install -r requirements.txt
pip install -e .

option 2: uv

uv venv --python 3.11
source .venv/bin/activate

uv pip install -r requirements.txt
uv pip install -e .

Note

uv is a fast Python package installer and resolver.

install redis

sudo apt update && sudo apt install redis-server -y
redis-server --daemonize yes

🚀 Quick Start

Start the server

uvicorn app.main:app --reload
# warm up
python scripts/warmup.py

# check health
curl http://localhost:8000/api/v1/health

# check detail status
curl http://localhost:8000/api/v1/health/detail

# check restart status
curl http://localhost:8000/api/v1/health/restart

Useful commands

# kill all judge processes
ps aux | grep -v grep | grep 'judge' | awk '{print $2}' | xargs kill -9

pytest

pytest tests/test_judge.py -v -s

Stress Test

# ACM Mode
python scripts/taco.py --source codeforces --samples 8192
# large samples for full dataset

# Full Mode
python scripts/leetcode.py --samples 8192

Stress test results are available here.

Warning

C/C++ is not supported yet.

Advanced Usage

Please refer to the Tutorial and scripts for more details.

For multi-node deployment add RL training, please refer to the multi-node.

Important

We recommend turn on the security check while RL training.

🛠 Development

Code Quality Tools

Note

We use Ruff as our Python linter and formatter.

# Auto-fix issues
ruff check --fix .

# Format code
ruff format .

Pre-commit Hooks

Note

Pre-commit hooks automatically check your code before committing.

# Installation
pre-commit install

# Run all checks manually
pre-commit run --all-files

🛣 Roadmap

  • high concurrency (maybe)
  • support ACM Mode
  • support LeetCode Mode (deprecated)
  • support FullCode Mode
  • organize the doc
  • reimplement LeetCode Mode

🙏 Acknowledgements

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A lightweight, high-concurrency code judge system.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0