Skip to content

BuggleInc/PLM-judge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Sep 24, 2017
19208f9 · Sep 24, 2017
Feb 10, 2016
Sep 23, 2017
Feb 10, 2016
Sep 15, 2017
Sep 24, 2017
Mar 16, 2016
Jul 26, 2016
Jan 21, 2016
Sep 24, 2017
Oct 6, 2016
Sep 1, 2015
Sep 2, 2015
Oct 6, 2016

Repository files navigation

PLM-judge -- sandboxing server for the PLM

THIS REPOSITORY IS DEPRECATED

The PLM judge (the sandboxing grading server) was integrated back into the main PLM project (https://github.com/BuggleInc/PLM). This repository now only contains the documentation (the current file), and some old scripts and deprecated code chunks.

Quick Start

Get the dependency:

sudo apt-get install rabbitmq-server

Get the precompiled docker image: https://github.com/BuggleInc/plm-dockers/

Testing the judge manually:

# Make sure that rabbitMQ is running locally
$ sudo rabbitmqctl list_queues
# This should report this line (at least): worker_in     0

# Start enough judges for a sbt test in webPLM (there is 306 tests right now)
webPLM/deps/PLM$ ant dist
webPLM/deps/PLM$ for i in `seq 306` ; do java -cp dist/plm-2.6-20151010.jar:.:bin:lib/rabbitmq-client.jar plm.judge.Main ; done

# Start the server using the judge (in another terminal, but on the same host)
webPLM$ PLM_EXECUTION_MODE=TRIBUNAL sbt start

# Start the tests (in a third terminal) once the judge and the server are waiting
webPLM$ sbt test

# Kill all remaining judges (if any). Ctrl-C this command once it start complaining that no judge remain to be killed.
$ while true ; do kill `ps aux|grep java|grep judge|cut -f2 -d' '`; done

# Kill all leaked queues
$ sudo rabbitmqctl stop_app
$ sudo rabbitmqctl reset
$ sudo rabbitmqctl start_app

TODO

  • Update the docker files now that the code was moved to PLM.jar
  • Update to rabbitMQ-client 5. I'm not even sure of the version currently used.
    • The API changed slightly but I didn't checked in all details
  • Move that documentation to a better location (PLM wiki?)
  • Unit test the judge.
    • We don't want to rerun all the exercises here, but simply to test:
      • The judge can compile a working code in all languages
      • A code not compiling is correctly handled
      • A code raising an exception is correctly handled
      • A code timeouting is correctly handled
      • Running the tests in parallel should be possible
    • There is some code for that in test/ but it's completely deprecated: it's using a server API that does not exist anymore. Plus, it was not using jUnit
  • Reduce the amount of queues for improved performance.
    • Currently, we have:
      • UI.js -> server.play: websocket Contains: code+exoID+lang
      • server -> judge: rabbitMQ on queue worker_in Contains: code+exoID+lang+replyQueueID See TribunalActor.scala variable replyQueue
      • judge -> server: rabbitMQ on replyQueueID Contains: exec outcome (passed/compileError/execError/mismatch)
      • judge -> UI.js: rabbitMQ on replyQueueID-client Contains: the stream of operations
    • But the rabbitMQ tutorials say that short-lived queues are inefficient, so we should change that. See http://www.rabbitmq.com/tutorials/tutorial-six-java.html