cylc-uiserver
cylc-uiserver copied to clipboard
construct the n-window at the UIS
The running scheduler holds the n=0 window (possibly plus some minor extras as per fine implementation details).
At present the scheduler data store expands this out to the configured n-window (via increment_graph_window
), this involves graph walking (to construct the window) and database access (to fill in the details). This is work which was originally intended to be UIS work (the scheduler holds only the info it needs, the UIS holds the information the user wants), but it turned out more convenient to start the ball rolling from the cylc-flow end (especially as this can also power cylc tui
), however, this can put a heavy load on the scheduler, especially as the n-window is increased and it also requires the scheduler to be running.
The alternative is to expand the window at the UIS shifting DB operations onto the public database. This would make it easier to develop the n=cycle window which cannot be handled by the scheduler (due to the requirement to work offline).
To do this we would need to:
- Simplify the call interface for
increment_graph_window
so that it does not need any TaskPool objects. - Switch from the private to the public database (probably by configuring the workflow_db_mgr object we initialise the UIS store with).
- Internalise the
increment_graph_window
calls to the data store so that they are responsive to internal state changes (i.e. task added/removed) rather than being called directly from the TaskPool. This would cause the method to be activated automatically in the UIS. - To continue to support Tui@n=1, we would need to first send the
set-graph-window
mutation from Tui to the Scheduler to change the graph window from the 0 default to 1 (or whatever Tui wants), then reset it with another mutation on Tui session close.
This is low priority ATM, however, the urgency will increase with the addition of n-window controls in the GUI (https://github.com/cylc/cylc-ui/issues/1093) and the n-cycle window (https://github.com/cylc/cylc-uiserver/issues/378).