piston-cli icon indicating copy to clipboard operation
piston-cli copied to clipboard

Shift to piston v2 endpoint

Open Shivansh-007 opened this issue 4 years ago • 0 comments

All that has change from v2 (16c585d41d649af8a1be4cd35559d60970f27339) -> v3

  • Runtimes can now have their versions selected
  • Configuring run time and compile timeouts
  • Configuring compile_memory_limit and run_memory_limit
  • Multi-file support (Running folders)
  • Addition of signal and code

An example request now would look like:

{
    "language": "js",
    "version": "15.10.0",
    "files": [
        {
            "name": "my_cool_code.js",
            "content": "console.log(process.argv)"
        }
    ],
    "stdin": "",
    "args": [
        "1",
        "2",
        "3"
    ],
    "compile_timeout": 10000,
    "run_timeout": 3000,
    "compile_memory_limit": -1,
    "run_memory_limit": -1
}

Changes to be done

  • Add flags to configure compile_timeout, run_timeout, compile_memory_limit, run_memory_limit, this would be optional flags and can be used on shell, file, link and the default ask_input. Remember this would be taken as flags.
  • Add support for passing folders, on passing folders, the user would be asked to input the name of their main file which is to be run.
  • Add -v/--version flag which would take the runtime version and we can remove the current --version flag which is used for getting the piston-cli version to probably --info (?).
  • Change the message output i,e. Here is your python output: according to the return code and signal returned by piston v2 api.
  • Any more ideas are appreciated, This is a basic idea, the flag names and implementation can be discussed on this issue or the discord server

If you are interested in doing some parts of the issue, let me know :D

Shivansh-007 avatar May 21 '21 06:05 Shivansh-007