Project

General

Profile

Actions

Bug #10007

closed

[Workbench] Retrieve all log content directly from API instead of pre-rendering in Rails

Added by Tom Clegg almost 8 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assigned To:
-
Category:
Workbench
Target version:
-
Story points:
-

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.


Related issues

Copied from Arvados - Bug #9679: [Crunch2] Provide feedback when a container is submitted to slurm but does not runResolvedTom Clegg07/29/2016Actions
Copied from Arvados - Task #9946: Retrieve old logs with AJAX instead of pre-renderingClosedTom Clegg07/29/2016Actions
Actions

Also available in: Atom PDF