Project

General

Profile

Actions

action #14690

closed

Live stream for serial terminal

Added by rpalethorpe over 7 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Feature requests
Target version:
-
Start date:
2016-11-08
Due date:
% Done:

80%

Estimated time:

Description

Replace the live SUT video feed in the OpenQA UI with a scrolling text display when a serial terminal is set as the active console.

Currently when the user selects a serial console a stale screen shot of the last used VNC console is shown. The live log below still updates, but the user experience is significantly degraded.


Files

serial terminal 1.png (207 KB) serial terminal 1.png rpalethorpe, 2016-11-18 10:36
serial terminal 2.png (139 KB) serial terminal 2.png rpalethorpe, 2016-11-18 10:37

Related issues 1 (0 open1 closed)

Related to openQA Project - action #14582: Add virtio serial console backend and APIResolvedrpalethorpe2016-10-31

Actions
Actions #1

Updated by rpalethorpe over 7 years ago

  • Related to action #14582: Add virtio serial console backend and API added
Actions #2

Updated by rpalethorpe over 7 years ago

My initial notes on implementing this feature:

* Actions
** Add terminal_snippet to ./lib/OpenQA/Worker/Jobs.pm
  Either reads data from serial log or from a pipe and send it over JSON to
  the UI.
** From logfile
   Just copy some data from the log file.
** From pipe
   A pipe has to be created between os-autoinst and the worker script, then the
   worker reads from it when it can.
** use terminal_snippet in upload_status (also in Jobs.pm<Worker>)
** Generalise append_log in ./lib/OpenQA/Schema/Result/Jobs.pm
  Modify append_log so that it can be used with serial terminal also
** Update update_status (also in Jobs.pm<Result>) to use new append_log
** Add liveterminal to ./lib/OpenQA/WebAPI/Controller/Running.pm
  Generalise livelog to work with a different file name
** Add liveterminal to ./templates/test/live.html.ep
   For now just add another text element and call Running::liveterminal.
** Tests
   There isn't much mention of livelog or streaming in the existing tests so
   it isn't immediately clear where to put them.

* Commentary
** livelog_start livelog_stop in ./lib/OpenQA/Worker/Commands.pm
   Probably not necessary to add to or modify this becuase it just makes
   increases the update frequency for everything.
** When and where to display the serial terminal output
   For prototype just display it under the live log or at the top. For the
   final feature it should at least remain hidden until output is available on
   it. It could also replace the video stream when the serial terminal is in use.

Updated by rpalethorpe over 7 years ago

I have got it working, but it still needs hiding when not in use and maybe the graphical view needs to be hidden when the serial terminal is in use.

The code can be seen here: https://github.com/os-autoinst/openQA/pull/1019

Actions #4

Updated by rpalethorpe over 7 years ago

  • % Done changed from 50 to 80
Actions #5

Updated by rpalethorpe over 7 years ago

After a comment from Coolo, I just merged the existing output from serial0 with the serial terminal so in most cases it will always have some meaningful content. That way I don't have to hide it and it becomes useful for most tests.

Actions #6

Updated by rpalethorpe over 7 years ago

Sometimes the serial-terminal-live.txt file does not appear inside the OpenQA worker script's temp directory which means no output is displayed. However autoinst-log-live.txt works fine which uses mostly the same code.

Actions #7

Updated by rpalethorpe about 7 years ago

  • Status changed from In Progress to Resolved
Actions #8

Updated by okurz about 7 years ago

  • Status changed from Resolved to Feedback

Hi Richi, sorry but I don't think the current feature state is quite complete. I am not saying you have to do it but what I see as points of improvement in the current implementation:

  • view is empty from the beginning and does not update automatically which can be quite confusing and was already reported by some people with "there is no output!"
  • view is not limited in size, i.e. can yield a super long page
  • no automatic update (if I am not mistaken)

do you agree with my comments?

Actions #9

Updated by rpalethorpe about 7 years ago

  • Assignee deleted (rpalethorpe)

okurz wrote:

Hi Richi, sorry but I don't think the current feature state is quite complete. I am not saying you have to do it but what I see as points of improvement in the current implementation:

Fair enough, I never actually use live view my self except just to check something is happening and I find it usually works on the kernel tests at least.

  • view is empty from the beginning and does not update automatically which can be quite confusing and was already reported by some people with "there is no output!"

It usually appears after a while, although sometimes it does not, but a page refresh fixes it. I am not sure why, os-autoinst definitely writes the data to the intermediate file and OpenQA definitely reads it. It should be populated for all tests. Perhaps some web API is being fetched too early before it can start streaming.

  • view is not limited in size, i.e. can yield a super long page

Personally I think that is fine, it is how Travis and OBS work as well, albeit with some extras for scrolling. I don't know what peoples' preferences are in general.

  • no automatic update (if I am not mistaken)

It should update, this is probably related to the first problem and also because on most tests as soon as the kernel log has finished printing there will only be minor output from wait_serial which people may not notice. If you watch one of the kernel tests you will see a constant stream of output most of the time.

do you agree with my comments?

I agree it is not really finished. Fixing it properly may require changing how all live logging works, although possibly just tweaking Mojo or the JS will fix it.

Actions #10

Updated by coolo over 6 years ago

  • Status changed from Feedback to Resolved

the live stream works - if there are bugs, handle them as is.

Actions

Also available in: Atom PDF