Skip to main content

No project description provided

Project description

repo_logo

A modern, configuration-driven online judge microservice system built for competitive programming evaluation.

โœจ Features

  • ๐ŸŽฏ Configuration-Driven: Define test cases through JSON config files
  • ๐Ÿ”ง Microservice Architecture: Stateless, containerized evaluation engines
  • ๐Ÿณ Docker Native: Full containerization with remote Docker support
  • ๐Ÿ›ก๏ธ Resource Isolation: Secure sandboxed execution environment
  • โšก High Performance: Efficient container lifecycle management
  • ๐Ÿ”Œ Python SDK: Easy-to-use Python API for integration
  • ๐ŸŒ Remote Support: Execute on remote Docker hosts via SSH
  • ๐Ÿ“Š Detailed Reporting: Comprehensive performance metrics and error analysis

๐Ÿ—๏ธ System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        Judge Micro System                            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚  Client Code    โ”‚    โ”‚   Python SDK    โ”‚    โ”‚  Docker Manager   โ”‚ โ”‚
โ”‚  โ”‚  - Submit Code  โ”‚โ”€โ”€โ”€โ–ถโ”‚  - JudgeMicro   โ”‚โ”€โ”€โ”€โ–ถโ”‚  - Local/Remote   โ”‚ โ”‚
โ”‚  โ”‚  - Get Results  โ”‚    โ”‚  - Validation   โ”‚    โ”‚  - SSH Support    โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚                                   โ”‚                       โ”‚          โ”‚
โ”‚                                   โ–ผ                       โ–ผ          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚                    Execution Containers                         โ”‚ โ”‚
โ”‚  โ”‚                                                                 โ”‚ โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚ โ”‚
โ”‚  โ”‚  โ”‚   C Container   โ”‚              โ”‚  C++ Container  โ”‚           โ”‚ โ”‚
โ”‚  โ”‚  โ”‚  - GCC Compiler โ”‚              โ”‚ - G++ Compiler  โ”‚           โ”‚ โ”‚
โ”‚  โ”‚  โ”‚  - cJSON Libraryโ”‚              โ”‚ - JSON Library  โ”‚           โ”‚ โ”‚
โ”‚  โ”‚  โ”‚  - Test Harness โ”‚              โ”‚ - Test Harness  โ”‚           โ”‚ โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚ โ”‚
โ”‚  โ”‚           โ”‚                                 โ”‚                   โ”‚ โ”‚
โ”‚  โ”‚           โ–ผ                                 โ–ผ                   โ”‚ โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚ โ”‚
โ”‚  โ”‚  โ”‚  Config.json    โ”‚              โ”‚  Config.json    โ”‚           โ”‚ โ”‚
โ”‚  โ”‚  โ”‚  User Code      โ”‚              โ”‚  User Code      โ”‚           โ”‚ โ”‚
โ”‚  โ”‚  โ”‚  Test Cases     โ”‚              โ”‚  Test Cases     โ”‚           โ”‚ โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚ โ”‚
โ”‚  โ”‚           โ”‚                                 โ”‚                   โ”‚ โ”‚
โ”‚  โ”‚           โ–ผ                                 โ–ผ                   โ”‚ โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚ โ”‚
โ”‚  โ”‚  โ”‚  Result.json    โ”‚              โ”‚  Result.json    โ”‚           โ”‚ โ”‚
โ”‚  โ”‚  โ”‚  - Status       โ”‚              โ”‚  - Status       โ”‚           โ”‚ โ”‚
โ”‚  โ”‚  โ”‚  - Performance  โ”‚              โ”‚  - Performance  โ”‚           โ”‚ โ”‚
โ”‚  โ”‚  โ”‚  - Errors       โ”‚              โ”‚  - Errors       โ”‚           โ”‚ โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽฏ Core Design Principles

1. Configuration-Driven Evaluation ๐Ÿ“

  • Zero Code Modification: The evaluation harness never needs changes
  • Pure Function Interface: User functions operate on parameters without global state
  • JSON Configuration: Test cases defined through structured configuration files
  • Flexible Parameters: Support for arbitrary function signatures and types

2. Microservice Architecture ๐Ÿ”ง

  • Stateless Execution: Each evaluation runs in isolation
  • Container Lifecycle: Create โ†’ Execute โ†’ Destroy pattern
  • Resource Management: CPU, memory, and time limits enforced
  • Scalable Design: Horizontal scaling through container orchestration

3. Multi-Language Support ๐Ÿ’ป

  • C Language: GCC with cJSON library support
  • C++ Language: G++ with modern standards (C++11 to C++23)
  • Extensible Framework: Easy addition of new language containers

4. Comprehensive Error Detection ๐Ÿ›ก๏ธ

  • Compilation Errors: Automatic detection of syntax and type errors
  • Runtime Errors: Segmentation faults, exceptions, and crashes
  • Logic Errors: Output validation against expected results
  • Resource Monitoring: CPU time, memory usage, and execution metrics

๐Ÿ› ๏ธ System Requirements

  • Operating System: Linux (Ubuntu/Debian recommended)
  • Container Runtime: Docker Engine 20.10+
  • Python: 3.8+ for SDK usage
  • Network: Internet access for Docker image pulls

๐Ÿš€ Quick Start

Docker Compose

git clone https://github.com/TsukiSama9292/judge_micro.git
cd judge_micro
docker compose up -d

Installation

# Install from PyPI
pip install judge_micro

# Or install from source
git clone https://github.com/TsukiSama9292/judge_micro.git
cd judge_micro
pip install -e .

๐ŸŒ Use Cases

  • Online Judge Platforms: Competitive programming websites
  • Educational Systems: Automated assignment grading
  • Coding Interviews: Technical assessment platforms
  • Code Quality Tools: Automated testing and validation
  • Research Projects: Algorithm performance evaluation

๐Ÿ“š Documentation

๐Ÿ”ง Advanced Configuration

Remote Docker Support

# Configure remote Docker host via SSH
import os
os.environ['DOCKER_SSH_REMOTE'] = 'true'
os.environ['DOCKER_SSH_HOST'] = '192.168.1.100'
os.environ['DOCKER_SSH_USER'] = 'docker'
os.environ['DOCKER_SSH_KEY_PATH'] = '/path/to/ssh/key'

Resource Limits

# Set container resource limits
os.environ['CONTAINER_CPU'] = '1.0'      # CPU limit
os.environ['CONTAINER_MEM'] = '256m'     # Memory limit
os.environ['CONTAINER_COUNT'] = '5'      # Max containers

๐Ÿ“„ License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

judge_micro-0.0.2.dev1.tar.gz (3.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

judge_micro-0.0.2.dev1-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file judge_micro-0.0.2.dev1.tar.gz.

File metadata

  • Download URL: judge_micro-0.0.2.dev1.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for judge_micro-0.0.2.dev1.tar.gz
Algorithm Hash digest
SHA256 b5e55ad8beba436502e870e203d52f3c4003f4a8f8c04e594989bbc710c7a965
MD5 1e8b3cfcf434818de1cdba3a3ec8bbfa
BLAKE2b-256 046e23cd0705a0d860e94949933c6d1516ec61a0af1c396e93c74767b02013db

See more details on using hashes here.

File details

Details for the file judge_micro-0.0.2.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for judge_micro-0.0.2.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d901807a9e75926a1e68a9ba50ed5d162ba2e90501884bbe81d2c216a0112a2
MD5 b3842ad1b5c889d34e56de1b870c6e80
BLAKE2b-256 84b29ba24c1a3fd68e116ae25fa625cce80463256cada9e976caf3a188209073

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page