illinois-cs241 / broadway-api

This is the old repo for Broadway API. Please see the new repo for newest version of Broadway https://github.com/illinois-cs241/broadway

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Log API Endpoint

bhuvy2 opened this issue · comments

We should have an api endpoint to get logs for a grading run id with authentication, something like (idk if this follows the format)

/log/<id>

Each job has logs of its own and in the logs db, each entry has a job-id field which can be used to find the logs for a job given the job id.

So we should expose a new endpoint GET /api/v1/grading_job_log/<course-id>/<job-id> which would return

{
     "stderr": <stderr output from job>,
     "stdout": <stdout output from job>
} 

However, currently, clients do not have a way to get the job id for the jobs that were run under a grading run. So the following change is required.

Currently GET /api/v1/grading_run/<course-id>/<assignment>/<run-id> returns:

{
      "pre_processing_job_state": <state>,
      "student_jobs_state": [<state of job 1>, ...],
      "post_processing_job_state": <state>,
}

This should change to something like GET /api/v1/grading_run_status/<course-id>/<run-id>

{
     "pre_processing_job": {<pre-processing-job-id>: <state>},
     "post_processing_job": {<post-processing-job-id>: <state>},
     "student_jobs": {
              <job-id>: <state>, ...
     }
}