Summary

Release Note

It is now possible to see the output of a job as it runs.

Rationale

It's pretty basic and important functionality.

User stories

As a LAVA user, I want to be able to view the output of a running test job so that I know that it is making progress.

Assumptions

The log file is available to the web server process at the file system level (possibly NFS or something being involved, but we can ignore that).

The user's browser supports js.

Design

We will roughly speaking steal how Jenkins does this, which is to have an ajax call that returns the contents of the log file from a certain point and returns in response headers the new length of the file and whether the job has completed or not. Because of our assumption that the log file is accessible on the file system we don't have to get the log data into the database or anything like that, but we do need to make sure that the location of the log file is stored in the database, or at least somewhere predictable from the data that is in the database.

We will want to change how the scheduler runs the dispatcher to make sure the log file gets written to more frequently (i.e. after every line, rather than every ~4k of output). I forget the details of how to do this.

Implementation

I don't think there are any real surprises here. It feels like returning a json object with log_data, new_size, is_finished fields rather than stuffing some things in http headers might be a bit easier.

GET /lava-server/job/1/log-tail?start=xxxx
-->
{
    "is_finished": false,
    "new_size": yyy,
    "content": "...."
}

The receiving javascript will stuff the content into a <pre> block, append that to the "log viewer" area of the job view and schedule a call for some time later to poll again.

BoF agenda and discussion

Use this section to take notes during the BoF; if you keep it in the approved spec, use it for summarising what was discussed and note any options that were rejected.


CategorySpec CategoryTemplate

Platform/Validation/Specs/ViewingLiveJobOutput (last modified 2011-07-24 23:41:51)