评测机
Go to file
2020-02-27 02:11:43 -05:00
client update documentation 2020-02-21 03:24:33 -05:00
cmd/judge only diff if run successed 2020-02-20 04:58:30 -05:00
data update documentation 2019-08-28 23:51:07 -07:00
file update documentations 2019-12-30 19:32:17 +08:00
judger update with go-sandbox 2020-02-19 22:11:39 -05:00
language update with go-sandbox 2020-02-19 22:11:39 -05:00
pkg fix compile information overrite 2020-02-21 02:35:39 -05:00
problem fixed typo 2019-09-07 18:03:19 -07:00
runner only diff if run successed 2020-02-20 04:58:30 -05:00
taskqueue add judge-v3 progress type 2019-12-31 12:46:03 +08:00
types update with go-sandbox 2020-02-19 22:11:39 -05:00
.gitignore save compiled message 2020-01-10 00:57:33 -05:00
go.mod Upgrade to GO 1.14 2020-02-27 02:11:43 -05:00
go.sum Upgrade to GO 1.14 2020-02-27 02:11:43 -05:00
LICENSE Initial commit 2019-08-24 15:32:38 -07:00
README.md update documentation 2020-02-21 03:24:33 -05:00

go-judge

Under designing.

The goal to to reimplement syzoj/judge-v3 in GO language using go-sandbox.

Planned Design

Workflow

    ^
    |
    v
+------+
|Client|
+------+
    ^
    |
    v
+------+    +----+
|      |<-->|Data|
|Judger|    +----+--+
|      |<-->|Problem|
+------+    +-------+
    ^
    |
    v
+---------+   +--------+
|TaskQueue|<->|Language|
+---------+   +--------+
    ^
    |
    v
+--------------------+
|ContainerEnvironment|
+--------------------+

Container Root Filesystem

  • necessary lib / exec / compiler / header readonly bind mounted from current file system: /lib /lib64 /bin /usr
  • work directory tmpfs mount: /w (work dir), /tmp (compiler temp files)
  • additional compiler scripts / exec readonly bind mounted: /c
  • additional header readonly bind mounted: /i

Interfaces

  • client: receive judge tasks (websocket / socket.io / RabbitMQ / REST API)
  • data: interface to download, cache, lock and access test data files from website (by dataId)
  • taskqueue: message queue to send run task and receive run task result (In memory / (RabbitMQ, Redis))
  • file: general file interface (disk / memory)
  • language: programming language compile & execute configurations
  • problem: parse problem definition from configuration files

Judge Logic

  • judger: execute judge logics (compile / standard / interactive / answer submit) and distribute as run task to queue, the collect and calculate results
  • runner: receive run task and execute in sandbox environment

Models

  • JudgeTask: judge task pushed from website (type, source, data)
  • JudgeResult: judge task result send back to website
  • JudgeSetting: problem setting (from yaml) and JudgeCase
  • RunTask: run task parameters send to run_queue
  • RunResult: run task result sent back from queue

Utilities

  • Config: read client config from TOML / YAML / JSON file
  • pkg/runner: run a group of programs in parallel

Planned API

Progress

Client is able to report progress to the web front-end. Task should maintain its states

Planned events are:

  • Parsed: problem data have been downloaded and problem configuration have been parsed (pass problem config to task)
  • Compiled: user code have been compiled (success / fail)
  • Progressed: single test case finished (success / fail - detail message)
  • Finished: all test cases finished / compile failed

TODO

  • socket.io client with namespace
  • judge_v3 protocol
  • syzoj problem YAML config parser
  • syzoj data downloader
  • syzoj compile configuration
  • file io
  • special judger
  • interact problem
  • answer submit
  • demo site