C++ Backend - Remote Script Execution
For some context im working on this leetcode type application im trying to write where people can post their own questions, submit solutions, leaderboards etc. The user will be presented with a question, some examples and a function prototype they need to implement for the solution. I've come pretty far along but now I just need to handle running the scripts securely, without too much overhead. Having some sort of test case generation (I'll implement the whole TLE and Space Limit stuff later)
Now what I'm thinking for the "secure" part is to have a pool of docker containers or something, I use when available.
For running the Python scripts I'm thinking of having some sort of Python wrapper that takes in the script's path imports the function and runs it against our generated test cases. Now for our test case generation, I was thinking of having like a config file type thing the user fills out to determine what kind of inputs and outputs to expect. But this all still feels like a lot of work for a person to do to post a question. (question body, correct answer script and a config defining function prototype, return types etc).
Idk, what I'm getting at is this just feels like a bit of a shitty way to approach this problem and was looking for alternate POVs to how I can implement something like this.
https://github.com/mush1e/RCE
P.S (Don't ask me why it's in C++, I'm a bit special in the head)
Now what I'm thinking for the "secure" part is to have a pool of docker containers or something, I use when available.
For running the Python scripts I'm thinking of having some sort of Python wrapper that takes in the script's path imports the function and runs it against our generated test cases. Now for our test case generation, I was thinking of having like a config file type thing the user fills out to determine what kind of inputs and outputs to expect. But this all still feels like a lot of work for a person to do to post a question. (question body, correct answer script and a config defining function prototype, return types etc).
Idk, what I'm getting at is this just feels like a bit of a shitty way to approach this problem and was looking for alternate POVs to how I can implement something like this.
https://github.com/mush1e/RCE
P.S (Don't ask me why it's in C++, I'm a bit special in the head)
GitHub
Remote Code Execution Platform. Contribute to mush1e/RCE development by creating an account on GitHub.
