Bug #10007
closed[Workbench] Retrieve all log content directly from API instead of pre-rendering in Rails
0%
Description
Background¶
Currently "get arvados#log entries and format them in a PRE element" is implemented in both Ruby and JS.
Reasons to remove the Ruby version:
1. In #9679 the two implementations started to go out of sync: the JS code knows how to format "container state change" logs, but the Ruby code skips them. The result is that "state change" logs only show up if they arrive while Workbench is listening for them on websocket. Refreshing the "log" page makes them disappear.
2. Doing API requests directly from the browser (instead of using the Workbench Rails server as a proxy) is expected to reduce real & perceived latency from the user's perspective.
Implementation¶
The "terminal window" div should have a data attribute indicating the configured number of log records to fetch. When the div is displayed, client-side JS should make an API request to retrieve logs. They should be prepended to the div by sending an event to $('.arv-log-event-handler-append-logs')
with eventData.prepend==true
.
To avoid missing or duplicating any logs, use the page display time ("now") as a "created_at>=X" filter when subscribing to Websocket events to append, and use the same time as a "created_at<X" filter when retrieving previous logs to prepend. This should produce the correct results regardless of processing/response order, so "subscribe" and "retrieve previous" can be done concurrently.
Updated by Tom Morris over 7 years ago
- Target version set to Arvados Future Sprints
Updated by Peter Amstutz about 5 years ago
- Status changed from New to Closed
- Target version deleted (
Arvados Future Sprints)