R

ReLab

A secure code execution platform, which improves upon SRMIST's eLab.

7
R

ReLab

A secure code execution platform, which improves upon SRMIST's eLab.


The problem ReLab solves

SRMIST has an online platform called eLab, which is used by thousands of students every day to complete their coding assignments. eLab suffers from frequent downtime, flaky output, UI glitches, bad performance and just an unpleasant user experience overall.

ReLab attempts to address some of the most frequently complained-about things that eLab has. ReLab uses the Monaco editor, which provides a very rich code editing environment. It lets the user download a combined report in PDF format of the questions they have solved, something which they have to do manually and painstakingly in eLab.

ReLab uses Docker to securely run untrusted code in a sandboxed environment. It spins up a new container running Alpine Linux every time it needs to execute some code.

Challenges I ran into

I had some trouble getting data in and out of the container using streams. I couldn't use the helper function

container.run()

because that would pipe

process.stdin

into the container, and the container wouldn't exit until

STDIN

emitted the

end

event. I had to manually start and attach the container, then emit a 'finish' event and get the data back.

Discussion