923 Commits

Author SHA1 Message Date
Sybren A. Stüvel
6e3667225a Manager: fix bug in sendAPIError() formatting code
Formatting parameters weren't passed to `fmt.Sprintf()` correctly.
2022-05-31 11:10:49 +02:00
Sybren A. Stüvel
11a407d26c Gitignore flamenco-worker.yaml and flamenco-worker-credentials.yaml
Ignore those files regardless of the path. Previously they were only
ignored in the project root, but I want to create several worker
configurations in a subdirectory for testing.
2022-05-31 10:46:27 +02:00
Sybren A. Stüvel
19db947eb4 Manager: remove Worker.LastActivity
This removes the field both from the OpenAPI interface and the database.
2022-05-31 10:46:27 +02:00
Sybren A. Stüvel
431406a301 OAPI: regenerate code 2022-05-31 10:43:57 +02:00
Sybren A. Stüvel
4f8fd14d7f OAPI: remove last_activity field from RegisteredWorker
A task's "activity" field is a string that describes the last-performed
operation on the task. In Flamenco 2, a Worker's "last activity" is the
timestamp at which it was last seen. Using the same term for different
things is confusing, and thus gets removed until the Worker's "last seen"
functionality is reimplemented.
2022-05-31 10:36:47 +02:00
Sybren A. Stüvel
ce07a46455 Fix error fetching non-existing log tail
A task can exist in the database but not have any log stored on disk yet.
This is now returned as `204 No Content` instead of an internal server
error.

The web interface is also adjusted to cope with this.
2022-05-30 19:23:10 +02:00
Sybren A. Stüvel
a3d885e710 OAPI: regenerate code 2022-05-30 19:23:00 +02:00
Sybren A. Stüvel
3ae9d5f0fe OAPI: add 204 No Content response to task log tail operation 2022-05-30 19:21:22 +02:00
Sybren A. Stüvel
e492a31abb Web: cleanup, move job/task-related components into jobs subdir
Move job and task components into `components/jobs`.

No functional changes.
2022-05-30 19:18:01 +02:00
Sybren A. Stüvel
88346d8244 Web: first implementation of Workers overview
Show workers with their status, and allow clicking on a worker to activate
it and show its details (which currently is limited to just its ID). Does
include Vue Router handling of the active worker ID and CSS classes for
worker statuses.

This basically copies the `JobsTable` component to `workers/WorkersTable`.
The intention is that all the jobs-specific components will move into a
`jobs` subdirectory at some point.
2022-05-30 18:52:02 +02:00
Sybren A. Stüvel
08676f48f4 Manager: implement fetchWorkers OpenAPI operation 2022-05-30 18:52:02 +02:00
Sybren A. Stüvel
eab4fa2ca7 OAPI: regenerate code 2022-05-30 18:52:00 +02:00
Sybren A. Stüvel
311887bff7 OAPI: add operation to fetch all workers
This introduces a new tag `worker-mgt` for worker management operations.
These are used by the web interface to display & manage workers.
2022-05-30 18:45:22 +02:00
Sybren A. Stüvel
723855a9d5 Web: move styling of 'clickable' table rows to separate class
Instead of doing this styling per table, just add a class that indicates
it has clickable rows.
2022-05-30 18:43:23 +02:00
Sybren A. Stüvel
81501ea41b Web: fix scrollbar on "select a ... to see its details" content
The "fix" is just setting the height to 50% instead of 100%, as the latter
will make it as big as the entire column; that causes the scrollbar to
show, as the column title isn't taken into account.
2022-05-30 16:24:53 +02:00
Sybren A. Stüvel
131298f5e8 Update FEATURES.md 2022-05-30 16:01:55 +02:00
Sybren A. Stüvel
9e22cda793 Merge branch 'temp-fix-tabulator-height' into main 2022-05-30 15:48:27 +02:00
Pablo Vazquez
74f875957f Web: Move overflow and position properties to affect all columns 2022-05-30 15:44:38 +02:00
Sybren A. Stüvel
9d59ab0505 Merge remote-tracking branch 'origin/main' into temp-fix-tabulator-height 2022-05-30 15:10:15 +02:00
Sybren A. Stüvel
6864ca2e75 Manager: add CLI argument to add random delay to HTTP responses
add `-delay` CLI argument, which adds a random delay of around 250ms to
all HTTP responses.

The web interface is quite asynchronous in nature, and having more
randomness and more visible delays in there will help development.

This CLI argument should not be used in production.
2022-05-30 15:10:07 +02:00
Sybren A. Stüvel
81aec77059 Resize the Tasks table when necessary
The `JobDetails` component now emits a `reshuffled` event whenever its
contents have changed, so that other components can respond to any changes
in available space. This event now triggers a resize of the tasks table
on the next DOM tick (so that the new sizes of the HTML elements are
available).

The `TasksTable` component also recomputes the table size when the task
status filters change (because that might have triggered a show/hide of
the filter bar). It also computes the available height slightly differently
so that it's all done relative to the tabulator element.

There is just one TODO left, which is a hard-coded offset of 12 that
should be obtained dynamically from somewhere -- no idea where it comes
from or why it's necessary.
2022-05-30 15:08:34 +02:00
Sybren A. Stüvel
09dbcfe512 Remove the need to get elements by their ID
Referencing elements outside the current component by ID is not a good
approach; using `this.$el.parentElement` is a bit cleaner.
2022-05-27 16:44:51 +02:00
Sybren A. Stüvel
339aafc1e4 Cleanup: add missing trailing comma
This comma isn't strictly necessary, but makes the diff cleaner when adding
new functions.
2022-05-27 16:43:40 +02:00
Sybren A. Stüvel
60836c77e0 Remove need for global resizeTasksListTable function 2022-05-27 16:43:12 +02:00
Pablo Vazquez
1310e5c9e2 Web: Set height for Tasks List on load and window resize
Calculate the Tasks List height by subtracting its offsetTop from
the Jobs Details column height.

Known issues:
There is a glitch in which the height can be sometimes longer or shorter
than expected, due to asynchronous loading of other components in Job Details
(such as Job Settings or table filters).
2022-05-25 17:14:21 +02:00
Pablo Vazquez
6f4fc29145 Web: Adjust colors for Canceled and Paused status
Use gray to contrast with the other statuses that indicate activity/errors.
2022-05-25 16:56:31 +02:00
Pablo Vazquez
8969ecb262 Web: Adjust colors for Queued, Requeueing
Do not use pink for queued/requeueing. Pink in Blender is used to indicate
something going wrong (missing textures, broken shaders). Use a shade of
blue instead which is closer in hue to green which means completed.
2022-05-25 16:56:31 +02:00
Pablo Vazquez
11955e209a Web: Use Flamenco accent hue instead of pink for active/selected rows 2022-05-25 16:56:31 +02:00
Sybren A. Stüvel
72487e3fb4 Web: only load task log tail when task log viewer is visible
The code to fetch the task log tail is moved from `JobsView.vue` to
`TaskLog.vue`, as that knows exactly when it's shown & hidden.

The subscriptions to the task log updates will have to be managed in the
same way; that's for another commit.
2022-05-24 16:04:03 +02:00
Sybren A. Stüvel
1ac72bd3fc Web: no longer do filtering when clicking on the 'status' table cell
Clicking on a job/task in their respective lists will now always activate
it, regardless of where on the row was clicked.

Managing the filters by clicking on the status was a nice idea, but was
confusing in practice.
2022-05-20 16:54:30 +02:00
Sybren A. Stüvel
ae0f4a7ca4 Show task log tail in the web interface 2022-05-20 16:49:51 +02:00
Sybren A. Stüvel
2cf6e2e528 OAPI: regenerate code 2022-05-20 16:49:48 +02:00
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