action #14690
closedLive stream for serial terminal
80%
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
Updated by rpalethorpe almost 8 years ago
- Related to action #14582: Add virtio serial console backend and API added
Updated by rpalethorpe almost 8 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 almost 8 years ago
- File serial terminal 1.png serial terminal 1.png added
- File serial terminal 2.png serial terminal 2.png added
- % Done changed from 0 to 50
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
Updated by rpalethorpe almost 8 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.
Updated by rpalethorpe almost 8 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.
Updated by rpalethorpe over 7 years ago
- Status changed from In Progress to Resolved
Updated by okurz over 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?
Updated by rpalethorpe over 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.
Updated by coolo almost 7 years ago
- Status changed from Feedback to Resolved
the live stream works - if there are bugs, handle them as is.