Git Product home page Git Product logo

tarus's Introduction

Tarus

Online Judge Engine Powered by runC, gVisor and other execution runtime.

Take a glance

The only prerequisite is downloading and run containerd, which works on distribution of any Linux or WSL.

$ containerd # run containerd service
INFO[2022-03-31T03:38:38.222472900+08:00] starting containerd                           revision=10f428dac7cec44c864e1b830a4623af27a9fc70 version=v1.6.1
...
INFO[2022-03-31T03:38:38.243084903+08:00] serving...                                    address=/run/containerd/containerd.sock.ttrpc
INFO[2022-03-31T03:38:38.243109172+08:00] Start recovering state
INFO[2022-03-31T03:38:38.243127039+08:00] serving...                                    address=/run/containerd/containerd.sock
INFO[2022-03-31T03:38:38.243172865+08:00] containerd successfully booted in 0.021098s
INFO[2022-03-31T03:38:38.253966164+08:00] Start event monitor
INFO[2022-03-31T03:38:38.254040667+08:00] Start snapshots syncer
INFO[2022-03-31T03:38:38.254070786+08:00] Start cni network conf syncer for default
INFO[2022-03-31T03:38:38.254096571+08:00] Start streaming server
$ git clone https://github.com/Myriad-Dreamin/tarus
$ cd tarus
$ go run ./cmd/tarus # run tarus service
$ go run ./cmd/tarus-cli submit \
    --driver domjudge,problem=fuzzers/corpora/domjudge/bapc2019-A \
    --submission fuzzers/corpora/domjudge/bapc2019-A/submissions/accepted/nicky.cpp
# run tarus client, served by tarus daemon
Response: []tarus_app.JudgeResult{
  tarus_app.JudgeResult{
    Index:  "0:AAA",
    Status: "Accepted/0s/16ms/5.270MB",
  },
  tarus_app.JudgeResult{
    Index:  "1:AQA",
    Status: "Accepted/0s/21ms/3.977MB",
  },
  tarus_app.JudgeResult{
    Index:  "2:AgA",
    Status: "Accepted/130ms/153ms/12.766MB",
  },
  ...
  tarus_app.JudgeResult{
    Index:  "31:HwA",
    Status: "Accepted/150ms/191ms/9.469MB",
  },
}
$ go run ./cmd/tarus-cli submit \
    --integrated-service oci:containerd \
    --driver domjudge,problem=fuzzers/corpora/domjudge/bapc2019-A \
    --submission fuzzers/corpora/domjudge/bapc2019-A/submissions/accepted/nicky.cpp
# embedded tarus service  
Response: []tarus_app.JudgeResult{
  tarus_app.JudgeResult{
    Index:  "0:AAA",
    Status: "Accepted/0s/10ms/6.205MB",
  },
  ...
}

Design

The Judge Service is defined in GRPC Service, hence both embedded service and remote service are supported. And, the OCI Standard has been implemented as a tarus judge service (runtime), so most oci-runtime are soon available in this framework, including runC, gVisor and Kata Containers.

Arch

Also, the judge proxy service such as Kafka Gateway is on the way, which can connect multiple judge runtime services and provides more functionality for users.

service JudgeService::Runtime { // minimum implementation
  rpc Handshake(HandshakeRequest) returns (HandshakeResponse);
  rpc CreateContainer(CreateContainerRequest) returns (google.protobuf.Empty);
  rpc RemoveContainer(RemoveContainerRequest) returns (google.protobuf.Empty);
  rpc CopyFile(CopyRequest) returns (google.protobuf.Empty);
  rpc MakeJudge(MakeJudgeRequest) returns (MakeJudgeResponse);
}

service JudgeService::Compiler { // compiler implementation
  rpc Handshake(HandshakeRequest) returns (HandshakeResponse);
  rpc CreateContainer(CreateContainerRequest) returns (google.protobuf.Empty);
  rpc RemoveContainer(RemoveContainerRequest) returns (google.protobuf.Empty);
  rpc CopyFile(CopyFileRequest) returns (google.protobuf.Empty);
  rpc CompileProgram(CompileProgramRequest) returns (google.protobuf.Empty);
}

service JudgeService::Async { // async service implementation
  JudgeService::Runtime

  rpc QueryJudge(QueryJudgeRequest) returns (QueryJudgeResponse);
}
service JudgeService::Gateway { // service aggregator
  JudgeService::Minimum
  JudgeService::Compiler
  JudgeService::Async
}

Service Flow

tarus's People

Contributors

myriad-dreamin avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.