PoC Assembly - Use Docker for Code Compilation and Execution By NodeJS

Register
Submit a solution
The challenge is finished.

Challenge Overview

Project Overview

For current TopCoder Competition Engine for Single Round Matches (SRM) and Marathon Matches (MM), the system need to have the required system to be pre-setup, like language installation, data presetup etc, and used a customized sandbox to limit the resources, like time and memory, security checking etc.

Competition Task Overview

For this contest, we'd like to explore the way to use Docker as an isolated container for code compilation and execution.

We'd like to find solutions/answers for the following questions:

  • Find a proper image for C++ code compilation and execution using gcc 4.8.x from Index, it seems https://index.docker.io/u/syoyo/centos-gcc48/ is the right image, but please verify that, you can also get a list images used by drone.io from https://github.com/drone/drone#images
  • Find way to dynamically load the CPP solution into the Docker image.
  • Find out whether it is heavy to start/stop the Docker image, so we can have a decision to let docker image running all the time, or clean start/stop for every compilation and execution.
  • Find way to let the docker image can load the data from externally, a possible solution is http://docs.docker.io/en/latest/use/working_with_volumes/
  • Write up a Node.js application that can
    • spin up a docker image for code compilation and execcution
    • use g++ command to compile C++ Code, please use this option "g++ -W -Wall -Wno-sign-compare -O2  -s  -pipe  -c -o"
    • capture the status of compilation and running, like compiling succes/failture, output of the running code from outside of the docker image.
    • moinitor resource usage of that process inside the docker image, including time and memory, see the attached submission for reference, and you can suggest better idea.
    • pipe in data to the C++ solution, like test samples.
    • read data from outside the docker image.
    • clean up and stop the docker image after succesfully compilation and execution


Final Submission Guidelines

Submission Deliverables

Below is an overview of the deliverables:

  • Node.js Code
  • Sample C++ Code
  • Detail Deployment Guide describing your solution.

Final Submission

For each member, the final submission should be uploaded to the Online Review Tool.

ELIGIBLE EVENTS:

2014 TopCoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30040975