0

In teaching CS, students submit their code to our server and we compile and run with unit tests. Similar to Codeforces, Codewars, and HackerRank.

How should we be configuring servers for this? Launch a new minimal VM for each code submission? Is there a VM system and linux distribution ideal for this?

Or is there another mechanism for this purpose that is more efficient? Can a user account be configured to handle this safely? We're happy to recycle servers periodically.

We're not tied to any datacenter or service. So happy to use something like AWS Lambda if that's a viable option.

apptree
  • 345
  • 1
  • 3
  • 10
  • You could even do this with a VM on your laptop. Just make a snapshot of it freshly installed, and revert to the snapshot after processing each submission. The snapshot bit is going to be the key whether you do this locally, with a private cloud provided by the university, or on a public cloud. – Michael Hampton Jul 16 '20 at 16:38
  • @MichaelHampton yes this is what I had in mind for launching a new minimal VM. By new I meant from a snapshot rather than reusing a running VM. Any suggestions on the best VM system and linux distribution for this? – apptree Jul 16 '20 at 18:55
  • 1
    I don't think the hypervisor matters very much. You can use whatever you have access to, or use something free. Maybe there's some custom Linux distribution built specifically for this purpose, but I've never heard of it. You could just run anything that has a compiler/runtime for the language(s) you're using. – Michael Hampton Jul 16 '20 at 19:01

1 Answers1

0

AWS Lambda recently launched a code signing feature to confirm that the code is unaltered and from a trusted publisher: https://aws.amazon.com/blogs/aws/new-code-signing-a-trust-and-integrity-control-for-aws-lambda/

You could add a layer on top of Lambda to take a student's signed code, create a Lambda function using it and then invoke the function to run the tests.

EDIT: Lambda would run the code in sandboxed containers and the Lambda function's configurations itself could be enforced by an admin.

Paradigm
  • 101
  • 1