EpistasisLab / Aliro

Aliro: AI-Driven Data Science
https://epistasislab.github.io/Aliro
GNU General Public License v3.0
223 stars 63 forks source link

Add full output (stderr, stdout) in install and code run endpoints #597

Closed jay-m-dev closed 12 months ago

jay-m-dev commented 1 year ago

The /execapi/v1/executions/install endpoint does not return the full output.

Example: calling the endpoint with this parameters:

{
  "command": "install",
  "packages": ["test"]
}

returns:

{
    "command": "install",
    "packages": [
        "test"
    ],
    "exec_results": {
        "stderr": "WARNING: You are using pip version 22.0.4; however, version 23.2.1 is available.\nYou should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.\n",
        "code": 1
    }
}

while the full stderr output actually is:

aliro-machine-1  | 0|machine  | stderr: ERROR: Could not find a version that satisfies the requirement test (from versions: none)
aliro-machine-1  | 0|machine  | stderr: ERROR: No matching distribution found for test
aliro-machine-1  | 0|machine  | stderr: WARNING: You are using pip version 22.0.4; however, version 23.2.1 is available.
aliro-machine-1  | 0|machine  | You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
aliro-machine-1  | 0|machine  | child process exited with code 

NOTE: the code run (/execapt/v1/executions) endpoint captures output in the same way as the /install endpoint. Make sure the fix is applied to the /executions endpoint as well.