Giter Site home page Giter Site logo

mdcpp / mdoj Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 1.89 MB

Mingdao OnlineJudge, A performant contest management system base on cutting edge stack.

Rust 94.27% TypeScript 0.54% Dockerfile 0.55% Just 0.37% Shell 0.14% SCSS 3.97% CSS 0.01% JavaScript 0.15%
docker grading-system grpc grpc-web nsjail programming-competitions programming-contests rust leptos

mdoj's Introduction

MDOJ

wakatime master staging

Performance-oriented contest management system for IOI like contest

🚧 work in progress, please wait until first release

Highlights

  • 🪶Lightweight: Only 50MB for the binary(plugin is very large)
  • ⚡Lighting fast: Using Rust+Grpc-Web and correct implementation/algorithm
  • 🚀Easy to use: By using docker compose, you can setup the system in minutes
  • ⏱️Accurate: Directly use cgroupv2(no docker in judger), Report time deviation to frontend
  • 🔒Secure: Using nsjail to sandbox user submitted code

Features

  • 🐳Scalable: When deployed in cluster, you can scale the system to satisfy reasonable request.
  • 🗄️Extensible: You can add any programing language by placing a *.lang file in plugins folder
  • 🔭 Powerful metrics/tracing using Open-Telemetry

Quick Start

Copy docker/quickstart file to your server and run docker compose up -d, then open https://localhost in your browser.

Because we use grpc-web(server-side stream), HTTP2 is required, you can ignore it or place cert and key in ./cert folder.

login as admin@admin and start play arounds.

See wiki for more details.

Full Setup(Docker)

Please download source code from release

  1. Copy docker/production from source code to your folder
  2. generate config for judger by starting the judger once, and edit config
  3. generate config for backend by starting the backend once
  4. download and extract plugin(language support) of your choice to ./plugins

If you prefer to use default config, you can skip step 2 and 3.

Setup for development

  1. install following package:
  • From system package manager: protobuf-devel, gcc
  • From rustup: rustup, cargo, just
  • From their website: docker, docker-compose

Then start reading documents in subfolder of your interest.

you may need to run just prepare in judger, backend subfolder.

Environment

Set CONFIG_PATH to change the path to config file, default value is config.toml

mdoj's People

Contributors

eason0729 avatar kaiyohugo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

mdoj's Issues

Fix comment in `WithToken`

pub trait WithToken: Sized {
/// this will try to add token to request.
///
/// Will return error if token is not exist
fn with_optional_token(self, token: Option<String>) -> Request<Self>;
/// this will try to add token to request.
///
/// If token is not exist, it will just ignore error and return request without token
fn with_token(self, token: String) -> Request<Self>;
}

change backend api for better readability

  • change pagination to use optional instead of oneof. (ref)
  • split SortBy, example: ProblemSortBy, ContestSortBy.
  • decouple SortBy from proto
  • rename link to addToContest
  • replace bit flag with enum

Provide a chat area for each problem

Add new feature: Provide a chat area for each problem.

To do list:

backend

  • update migration
  • add new database entity
  • compare manual database entity with codegen by migration
  • add new controller(if we want to cache)

proto

  • change database proto

Provide sorting guarantee for list_by_*

Problem

We haven't yet provide any kind of sort for list_by_* rpc, providing such guarantee is useful in many situation.

For example, you have 100 problem in a contest(so you want to use paginator), by guarantee secquence of all problem are sorted in ascending, we can partially render problem without actually retrieve 100 problem from the server.

TODO

  • add new paginator-session type (use related_filter() and PaginateCol)
  • update comment in backend.proto
  • update migration and entity declaration
  • implement in backend

use PartialModel to improve performance

Before working on PartialModel, we should rewrite Pager first.

  • decouple pagination logic from Select<E> recreation
  • Rewite paginator struct and serialize method to reduce overhead(also eliminate the need of signing session)
  • Writer an adopter for Pager

The actual work:

  • write PartialModel
  • write session update logic
  • replace existing Pager

Basic Frontend

TODO

  • Navbar
  • Footer
  • Login page
  • web-grpc api config
  • fix ssr error
  • Use cookie for token to complete fix ssr error
  • Error handling
  • #35
  • #36
  • Contests page
  • Rank page
  • Submission page
  • #39
  • #37
  • Problem Page
  • #38

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.