Giter Club home page Giter Club logo

jalgoarena-judge's Introduction

JAlgoArena Judge Agent Build Status codecov GitHub release

JAlgoArena Judge Agent is heart of JAlgoArena platform. It is responsible for generation of skeleton code as well as judging submissions based on requirements specified in problem definition.

Introduction

  • JAlgoArena Judge Agent can be easily scalable - it's stateless and together with Consul and API using Ribbon load balancer gives unlimited way to scale judgement capability
  • It supports Java 8
  • JAlgoArena Judge Agent is generating skeleton code for particular problem - based on meta data received from Problems Service
  • It judges correctness of the solution based on the pre-specified test cases as well as time and memory limits
  • It's using simple heuristic to calculate time and memory results - running in couple iteration and looking for best results makes the judgement itself more predictable and repeatable

Component Diagram

REST API

Endpoint Description
GET /problems Get problems list
GET /problems/:id Get problem by id

API

Get all problems

Request definition of all problems

URL Method
/problems GET
  • Success Response:

    List of available problems

    • Code: 200
      Content: [{"id":"fib","title":"Fibonacci","description":"<description>","timeLimit":1,"skeletonCode":"<skeleton code>","level":1},{...},...]
  • Sample Call:

    curl --header "Accept: application/json" \
         http://localhost:5008/problems

Get specific problem

Request definition of requested problem

URL Method
/problems/:id GET
  • Success Response:

    Details of requested problem

    • Code: 200
      Content: {"id":"fib","title":"Fibonacci","description":"<description>","timeLimit":1,"skeletonCode":"<skeleton code>","level":1}
  • Sample Call:

    curl --header "Accept: application/json" \
         http://localhost:5008/problems/fib

Running locally

There are two ways to run it - from sources or from binaries.

  • Default port: 8080

Running from binaries

  • go to releases page and download last app package (JAlgoArena-Judge-[version_number].zip)
  • after unpacking it, go to folder and run ./run.sh
  • you can modify port in run.sh script, depending on your infrastructure settings. The script itself can be found in here: run.sh

Running from sources

  • run git clone https://github.com/spolnik/JAlgoArena-Judge to clone locally the sources
  • now, you can build project with command ./gradlew clean bootRepackage which will create runnable jar package with app sources. Next, run java -Dserver.port=8080 -classpath "lib/*" -jar build/libs/jalgoarena-auth-*.jar which will start application
  • there is second way to run app with gradle. Instead of running above, you can just run ./gradlew clean bootRun

Notes

Component Diagram

jalgoarena-judge's People

Contributors

dominikc avatar soulmachine avatar spolnik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jalgoarena-judge's Issues

Few problems clarifications

/count-paths --> say the answer is guaranteed to fit into an int (could easily overflow e.g. for n=m=100)

"Stock Market Oracle" --> could add one or two examples; should say that you can only buy one unit of the stock

"Bit Conversion" --> say it is assumed a,b are >0

"BST Validation" --> it is not clear at all if for "null" input the answer should be "true" or "false" (answer is "true"; but I'd argue "null" input is not a tree at all, hence is not binary tree in particular)

"Palindrome Permutations" --> please do specify if empty string is considered a palindrome or not; this is not obvious at all; (lost few tries on this one; now ACC)

"Subset Summation" --> usually for such problems we would have (a) the max count of elems in int[] numbers, whether they are necessarily positive, and the max value of target; else you write algo's blindly (some algos are valid, (and ACC here), even though they might cause ether overflows or memory-limit-exceeded errors in generic case)

            "whether an equation has a balanced number of left and right parentheses and brackets (including (,),[,],{,}) "

to plz napisz co to jest "equation", albo usuń testy zawierające inne znaki niż "(){}[]"...

90min mi na to poszło;

Propozycja: "to check whether a string containing various symbols has a balanced number of left and right brackets (of the types '(',')','[',']','{','}')"
niby podobnie, ale przynajmniej nie sugeruje, że to są wyłączne znaki w stringu.

High Availability for Judge Service

So far I was able to observer some failures of JVM doing judge - as it's doing compilation and low level operations - it's quite possible to go down by some reason (even whole JVM which already happen).

To solve that issue - ideally would be to replicate Judge Service - let's say to 4 instances. With those 4 instances and Gateway as interface + Eureka as registry - it will have much higher availability - and even monitoring of health of particular instances through Eureka should be fairly easy.

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.