794 Commits

Author SHA1 Message Date
Sybren A. Stüvel
6f6e73e068 Web: show placeholder when there are no notifications yet 2022-05-19 15:01:10 +02:00
Sybren A. Stüvel
916ea2015a Web: always show scrollbar in notification history
Force a visible scroll bar, so that the notification history table
always has the same available width. Without this, Tabulator won't
properly act on the reduction in width when the scrollbar appears, and
will show a horizontal scrollbar as well.
2022-05-19 15:00:37 +02:00
Sybren A. Stüvel
2c79a10650 Worker: don't log error if may-i-keep-running is shut down
Don't log an error if a worker shutdown (indicated by the context closing)
interrupts a may-i-keep-running call. Instead, log at debug level and just
return "yes, keep running"; we want the Worker to stop the task because it
is shutting down, and not because the Manager told us so.
2022-05-19 15:00:03 +02:00
Sybren A. Stüvel
03a021e14f Web: don't deactivate current task when clicking on current job 2022-05-19 14:28:54 +02:00
Sybren A. Stüvel
4602ef2523 Web: show task status changes in the notifications
This of course only shows notifications about tasks of the active job,
as otherwise things would get messy.
2022-05-19 14:28:37 +02:00
Sybren A. Stüvel
3c622264a4 Manager: include 'activity' in SocketIO task updates
This also changes the order in which the task is updated; the activity is
now saved first, so that it can be included in the task status change
notification sent to SocketIO clients.
2022-05-19 14:27:42 +02:00
Sybren A. Stüvel
797dea85ed Cleanup: manager, document two functions 2022-05-19 14:20:17 +02:00
Sybren A. Stüvel
43f244ecab Manager: move TaskUpdate API function from jobs.go to workers.go
The OpenAPI spec tags this operation as `workers`, so it should be in
`workers.go`.

No functional changes.
2022-05-19 14:20:02 +02:00
Sybren A. Stüvel
12d5b2a1fc OAPI: regenerate code 2022-05-19 14:11:33 +02:00
Sybren A. Stüvel
6afb1151cc OAPI: add task activity to SocketIO task updates 2022-05-19 14:07:42 +02:00
Sybren A. Stüvel
919e629bd7 Web: expose notifs as window-global variable for debugging 2022-05-19 14:07:07 +02:00
Sybren A. Stüvel
034d75a9b8 Web: prevent error when notification popover is empty 2022-05-19 14:06:50 +02:00
Sybren A. Stüvel
d5e5e7b566 Web: fix typo in CSS rule 2022-05-19 13:07:42 +02:00
Sybren A. Stüvel
50fc1a1bbc Web: hide table header in notification popover 2022-05-19 13:00:42 +02:00
Sybren A. Stüvel
40bed3db5e Web: add notification history pop-over
Add a notification pop-over, which can be opened by clicking the footer
bar.
2022-05-19 12:57:00 +02:00
Sybren A. Stüvel
bc355d68ab Web: cleanup JobsView, reorder imports of components
Order component imports alphabetically, so it's easier to add new ones.
2022-05-19 12:56:12 +02:00
Sybren A. Stüvel
a3524a03a2 Web: remove index view and just redirect to jobs view
The index view was there to have at least *something* at `/`, but wasn't
planned out well. It'll some day be replaced by a dashboard of sorts.
2022-05-19 11:12:25 +02:00
Sybren A. Stüvel
3faeff905e Add Vue.volar as recommended VSCode extension 2022-05-19 11:08:04 +02:00
Sybren A. Stüvel
618bc8c72f Add documentation for Shaman on Windows
List the steps to take, to allow creating symlinks by regular users.
2022-05-19 10:06:55 +02:00
Sybren A. Stüvel
ddc3acd652 Web: add status filtering to task table 2022-05-17 15:37:29 +02:00
Sybren A. Stüvel
56eedbaddb Web: remove unused code 2022-05-17 15:37:14 +02:00
Sybren A. Stüvel
d71aa0e5c3 FEATURES.md: various updates 2022-05-17 15:37:08 +02:00
Sybren A. Stüvel
dc7729cfed Web: cleanup, remove unused parameter 2022-05-17 15:09:47 +02:00
Sybren A. Stüvel
01a81bb3dd Web: move Task tabulator options into the mounted() function
This basically mirrors what 8f27ea97 did for the jobs table.

No functional changes.
2022-05-17 15:09:25 +02:00
Sybren A. Stüvel
84ba3ec8b2 Web: cleanup, explain why commented-out code is kept 2022-05-17 15:05:25 +02:00
Sybren A. Stüvel
908953c8d4 Web: cleanup, remove some unused code 2022-05-17 15:05:17 +02:00
Sybren A. Stüvel
42c81e9900 Web: remove some debug logging, and convert one log into warning 2022-05-17 14:52:27 +02:00
Sybren A. Stüvel
530520b1c7 Implement mass updating of tasks when JobUpdate.refresh_tasks = true
Send & handle `JobUpdate.refresh_tasks = true` when many tasks are
updated simultaneously. This applies to things like cancelling &
requeueing an entire job.

This partially rolls back 67bf77de13d99b1bc5d7344951068822c4fadd88, as
it was too slow when 1000+ tasks were being updated all at once.
2022-05-17 14:48:50 +02:00
Sybren A. Stüvel
cd8080fb44 OAPI: regenerate code 2022-05-17 14:48:25 +02:00
Sybren A. Stüvel
9d9ff77ee0 OAPI: add mass-task-refresh option to SocketIO job updates
Add `JobUpdate.refresh_tasks` property, to signal to SocketIO clients that
the job update is so big, all the job's tasks should be refreshed.

This is much faster than sending individual task updates one by one.
2022-05-17 14:47:33 +02:00
Sybren A. Stüvel
163611ff19 Web: add filter bar for job status 2022-05-16 18:15:51 +02:00
Sybren A. Stüvel
9fd4d55fdb Web: move status indicator code into its own function
Status indicators are used in Tabulator cells, and it's unknown whether
we can use Vue components there. Moving the code to a central place makes
it a bit easier to reuse the function in various places.
2022-05-16 17:31:30 +02:00
Sybren A. Stüvel
32737ef17b Web: cleanup, add some trailing commas and remove unused code
No functional changes.
2022-05-16 15:36:39 +02:00
Sybren A. Stüvel
8f27ea9714 Web: move Tabulator options into mounted() function
Move the Tabulator options from the `data()` function to the `mounted()`
function. This allows upcoming changes to refer to the Vue component.
2022-05-16 15:36:20 +02:00
Sybren A. Stüvel
eb0bfe820b Web: allow filtering jobs by their status
This is a very simple approach, where clicking on a job's status dot
toggles filtering by that status. There is no visual indication that this
filtering is active.

The Tabulator support for filtering from the headers is a bit buggy, see
https://github.com/olifolkerd/tabulator/issues/3745 -- I'm getting this
error even without `multiselect: true`.
2022-05-16 15:02:38 +02:00
Sybren A. Stüvel
edce178c34 Web: upgrade Tabulator 5.1.8 → 5.2.4 2022-05-16 14:34:56 +02:00
Sybren A. Stüvel
e72ea6b310 make clean: no longer regenerate source
Regenerating code with `make clean` was somewhat useful when only Go code
was generated, because that didn't include the version number / git hash.
The Python and JS code do have that version/hash, so `make clean` became
a source-altering operation, which wasn't nice.
2022-05-16 10:10:48 +02:00
Sybren A. Stüvel
88929db582 make clean: also remove race files
Also remove `flamenco-manager_race` and `flamenco-worker_race` when running
`make clean`.
2022-05-16 10:08:37 +02:00
Pablo Vazquez
fd38ad2aea Web: Use row background color for Tabulator tables 2022-05-12 15:53:57 +02:00
Pablo Vazquez
ae13ff6410 Web: Remove custom styling for tasks-list-container
Style comes from Tabulator, no need to set properties again.
2022-05-12 15:53:57 +02:00
Pablo Vazquez
d0d40c8e46 Web: Set a fixed height for Tabulator tables.
It's ugly but couldn't find a way to make it responsive and not break
the Virtual DOM.
2022-05-12 15:53:57 +02:00
Sybren A. Stüvel
abed318500 Web: remove Vue logo 2022-05-12 15:11:20 +02:00
Sybren A. Stüvel
ecbd0acb30 FEATURES.md: update for current state of the project 2022-05-12 15:11:14 +02:00
Sybren A. Stüvel
0b39f229a1 Implement may-I-keep-running protocol
Worker and Manager implementation of the "may-I-kee-running" protocol.

While running tasks, the Worker will ask the Manager periodically
whether it's still allowed to keep running that task. This allows the
Manager to abort commands on Workers when:

- the Worker should go to another state (typically 'asleep' or
  'shutdown'),
- the task changed status from 'active' to something non-runnable
  (typically 'canceled' when the job as a whole is canceled).
- the task has been assigned to a different Worker. This can happen when
  a Worker loses its connection to its Manager, resulting in a task
  timeout (not yet implemented) after which the task can be assigned to
  another Worker. If then the connectivity is restored, the first Worker
  should abort (last-assigned Worker wins).
2022-05-12 15:06:05 +02:00
Sybren A. Stüvel
fd16f7939e OAPI: regenerate code 2022-05-12 15:06:05 +02:00
Sybren A. Stüvel
52e9db6ef4 OAPI: add may-worker-run endpoint
Add an endpoint for Workers to poll while they're running a task, to see
if they're allowed to keep running it.
2022-05-12 15:05:59 +02:00
Sybren A. Stüvel
bedf10e435 Worker: clarify message when sleep command is aborted
Instead of logging "sleep aborted", the message is now "sleep command
aborted", to make it clear that it's about the sleep command, and not the
"asleep" worker state.
2022-05-12 14:59:10 +02:00
Sybren A. Stüvel
d35ca9d98f Manager: limit database connections
Limit the database connection pool to only a single connection. I hope that
this will solve the intermittent `SQLITE_BUSY` errors I've been seeing.
2022-05-12 13:58:15 +02:00
Sybren A. Stüvel
4bdaeb73a6 Web: set fixed height for the task table
It looks rather ugly, and this should be addressed, but without the
`height` option of Tabulator it won't be using the Virtual DOM and result
in very slow browser performance.
2022-05-12 13:53:17 +02:00
Sybren A. Stüvel
3d606a3fa0 Manager: task scheduler, fix handling of worker assignment of tasks
Improve how the task scheduler deals with tasks that already have a
worker assigned to them:

- When a Worker asks for a task, and there is already an active task
  assigned to it, always return that task.
- Otherwise, never allow scheduling of active tasks, as those are
  already being run by another worker. If this is not the case, their
  status should change to queued/failed, instead of handling the
  situation in the task scheduler.
- Apart from the assigned-and-active case above, ignore task's worker ID
  when scheduling tasks. If the status is 'queued' or 'soft-failed', the
  task's worker ID just indicates who ran the task last.
2022-05-12 13:52:16 +02:00