691 Commits

Author SHA1 Message Date
Sybren A. Stüvel
2003db7a26 OAPI: return log tail as string, not array of strings
The JavaScript client cannot handle a plain array of strings.
2022-05-20 16:48:55 +02:00
Sybren A. Stüvel
9bb4dd49dd Manager: add endpoint to fetch task log tail
It returns 2048 bytes at most. It'll likely be less than that, as it will
ignore the first bytes until the very first newline (to avoid returning
cut-off lines). If the log file itself is 2048 bytes or smaller, return the
entire file.
2022-05-20 16:34:13 +02:00
Sybren A. Stüvel
bb7ac8319f OAPI: regenerate code 2022-05-20 16:30:42 +02:00
Sybren A. Stüvel
fc74195704 OAPI: add operation to fetch the tail end of a task log 2022-05-20 16:29:43 +02:00
Sybren A. Stüvel
23a5e9df4c Manager: cleanup, reorder some imports 2022-05-20 15:36:05 +02:00
Sybren A. Stüvel
f77b11d85e Manager: add a small wrapper around Google's UUID library
Add a small wrapper around github.com/google/uuid. That way it's clearer
which functionality is used by Flamenco, doesn't link most of the code to
any specific UUID library, and allows a bit of customisation.

The only customisation now is that Flamenco is a bit stricter in the
formats it accepts; only the `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` is
accepted. This makes things a little bit stricter, with the advantage
that we don't need to do any normalisation of received UUID strings.
2022-05-20 15:35:51 +02:00
Sybren A. Stüvel
4562e98df5 Web: store footer popover state in local storage
Keep the footer popover state in the local storage, restoring it on load:
- Visibility of the popover
- Current tab of the popover
2022-05-20 14:43:30 +02:00
Sybren A. Stüvel
6a8d959301 Web: show task log in footer popover
Styling of the "tab buttons" in the footer popover still needs work. The
currently selected task's log updates are shown, though.
2022-05-20 14:35:19 +02:00
Sybren A. Stüvel
792b4ab141 Manager: on worker signoff, add a note to any requeued task logs
When a worker signs off, its tasks get requeued. This is now also saved in
the task log, and broadcast via SocketIO as task log chunk.
2022-05-20 14:17:17 +02:00
Sybren A. Stüvel
64e9f7cbbe Manager: fix unit test
It was missing the task log broadcasting.
2022-05-20 13:57:42 +02:00
Sybren A. Stüvel
c06baab8ab Web: extract notification list into its own component
The footer popover is going to contain the task logs as well, so the
notifications are now their own component to be able to show/hide them.
2022-05-20 13:55:00 +02:00
Sybren A. Stüvel
7cdcaf443c Web: cleanup, remove unused imports 2022-05-20 13:41:39 +02:00
Sybren A. Stüvel
fa7bfaabee Web: cleanup, move footer components into a footer subdirectory
No functional changes.
2022-05-20 13:41:32 +02:00
Sybren A. Stüvel
c4cda79ec0 Worker: chunk logs at 10kB instead of 1kB
Send logs in bigger chunks, otherwise a Blender render can cause too many
individual requests.
2022-05-20 13:36:16 +02:00
Sybren A. Stüvel
3e5f681321 Task log broadcasting via SocketIO
Implement task log broadcasting via SocketIO. The logs aren't shown in the
web interface yet, but do arrive there in a Pinia store. That store is
capped at 1000 lines to keep memory requirements low-ish.
2022-05-20 13:03:41 +02:00
Sybren A. Stüvel
1bb4ada72b OAPI: regenerate code 2022-05-20 12:58:57 +02:00
Sybren A. Stüvel
a32261e196 OAPI: add task log update schema
Add `SocketIOTaskLogUpdate` schema and add `tasklog` as value for
`SocketIOSubscriptionType`.
2022-05-20 12:58:16 +02:00
Sybren A. Stüvel
d9a955beee Worker: only call may-I-keep-running endpoint every 10 seconds
For debugging it was nice to have this called every second, but for
production use that's a bit too frequent.
2022-05-20 12:57:27 +02:00
Sybren A. Stüvel
0a3009d6ed Web: fix race condition where job/task update comes in before table is init
Tabulator can't handle data changes before it's been initialised. If
there is a race condition and a job/task update comes in before that, just
ignore the update.

It might be better to use Vue's `nextTick()` function to defer the update
until Tabulator is ready to receive it, but doing so in a reliable way
might be tricky.
2022-05-20 12:18:40 +02:00
Sybren A. Stüvel
30a30f154b Web: always show active status filters
Fix a bug where the filter would only show available statuses and thus
make it impossible to disable a filter that's no longer available.

For example, when showing only `active` tasks, and no task is active any
more, it would remove the "filter circle" for `active` status, and thus
make it impossible to disable the filter. Now the filter will always
show all enabled statuses, even when there is no more job/task
with that status.
2022-05-20 12:17:06 +02:00
Sybren A. Stüvel
8730157c1c Manager: friendlier warning when unknown SocketIO subscription type is used
Replace "invalid subscription type" with "unknown subscription type", as
that's a bit friendlier.
2022-05-20 11:42:09 +02:00
Sybren A. Stüvel
4c18a19786 Cleanup, Manager: move some SocketIO room handling code and add docs
Add some clarifications and move the `roomXXX()` functions into
`sio_rooms.go`.
2022-05-20 11:41:06 +02:00
Sybren A. Stüvel
34bccd9277 Cleanup, web: rename subscribedJob to subscribedJobID
The prop contains the job ID, not the job itself, which is now reflected
in the name.

No functional changes.
2022-05-20 11:27:23 +02:00
Sybren A. Stüvel
adc8738e5b Web: log SocketIO connection status in notifications history 2022-05-20 11:22:59 +02:00
Sybren A. Stüvel
79c632bc9f README: expand documentation of code generation 2022-05-20 10:49:37 +02:00
Sybren A. Stüvel
a74ad07642 OAPI: Regenerate code 2022-05-20 10:49:25 +02:00
Sybren A. Stüvel
b535dfed3c OAPI: expand the description of the TaskUpdate schema
No functional changes.
2022-05-20 10:44:27 +02:00
Sybren A. Stüvel
247903444f FEATURES: two updates of work done 2022-05-19 17:26:02 +02:00
Sybren A. Stüvel
7b664475ca Rename job status requeued to requeueing 2022-05-19 17:25:53 +02:00
Sybren A. Stüvel
ce43eead9a OAPI: regenerate code 2022-05-19 17:24:59 +02:00
Sybren A. Stüvel
507985e258 OAPI: rename job status requeued to requeueing
Rename job status `requeued` to `requeueing`, because it indicates a
process that's (if things are working well) happening currently.
2022-05-19 17:22:35 +02:00
Sybren A. Stüvel
1aed4bf729 Web: nicer styling for notification history placeholder
The `user-select: none` mirrors the 'hint text' in the columns when
there is no active job/task.
2022-05-19 16:53:47 +02:00
Sybren A. Stüvel
dbd32e56cd Worker: fix FFmpeg issues on Windows
Fix the FFmpeg unit test on Windows, by:
- Having actual input files (otherwise the input-glob-creation-function
  errors out), and
- ensuring the cleanup function is always run, and
- testing for the right CLI arguments.
2022-05-19 16:42:40 +02:00
Sybren A. Stüvel
f4299018ef Web: expose the API interface as window.API
This makes developing/debugging things a bit easier.
2022-05-19 16:15:36 +02:00
Sybren A. Stüvel
fd0ff82352 Use new job setting visibility rules
Update the Blender add-on, web interface, and job compiler script to use
the new visibility settings of job settings.
2022-05-19 16:15:13 +02:00
Sybren A. Stüvel
1086fcbc28 OAPI: Regenerate code 2022-05-19 16:04:10 +02:00
Sybren A. Stüvel
476f584192 OAPI: job settings, allow more granular control over setting visibility
Instead of having a per-setting boolean to control whether it's visible
or hidden, there are now four values:

- `visible`: always show.
- `submission`: only show in the UI of a job submitter (like a Blender
  add-on).
- `web`: only show in the web interface for management, but not when
  submitting the job.
- `hidden`: never show; only available to the job compiler script as
  internal setting.
2022-05-19 16:01:53 +02:00
Sybren A. Stüvel
f7e028bcdc Document guidelines on how to commit OpenAPI changes 2022-05-19 16:01:53 +02:00
Sybren A. Stüvel
22ce5a3e13 Web: only show tasks table if there is job data to show
Without this, the tasks table would be shown (off-screen, so you'd have
to scroll to see it) when there is an active job ID, but no data loaded
due to the backend being unavailable.
2022-05-19 15:42:57 +02:00
Sybren A. Stüvel
d5be85daad Web: show SocketIO connection status in the notifications popover as well
Move the connection status indicator to its own component, and use that
in both the notification bar and the popover.
2022-05-19 15:42:07 +02:00
Sybren A. Stüvel
3274e2c551 Web: cleanup, move objectEmpty(o) function to main.js
No functional changes.
2022-05-19 15:41:23 +02:00
Sybren A. Stüvel
6a0e4c6e56 Web: cleanup, simplify plain(x) function a bit 2022-05-19 15:40:37 +02:00
Sybren A. Stüvel
744fabea78 OAPI: rename pkg/api/flamenco-manager.yaml to flamenco-openapi.yaml
Rename `pkg/api/flamenco-manager.yaml` to `flamenco-openapi.yaml`, to
distinguish the OpenAPI definition file from the Flamenco Manager
configuration file of the same name (but in a different directory).

No functional changes.
2022-05-19 15:22:37 +02:00
Sybren A. Stüvel
0242f2d217 Web: show job updates in the notifications popover 2022-05-19 15:18:19 +02:00
Sybren A. Stüvel
cc62cab1d6 Update code to handle the JobUpdate to SocketIOJobUpdate rename
No functional changes.
2022-05-19 15:18:06 +02:00
Sybren A. Stüvel
b928896066 OAPI: regenerate code 2022-05-19 15:17:19 +02:00
Sybren A. Stüvel
7753e65b03 OAPI: rename the JobUpdate schema to SocketIOJobUpdate
Rename `JobUpdate` to `SocketIOJobUpdate` to make it consistent with
`SocketIOTaskUpdate`.

Note that `TaskUpdate` exists as another schema, used by Workers to
update tasks they're performing.
2022-05-19 15:16:27 +02:00
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