161 Commits

Author SHA1 Message Date
Sybren A. Stüvel
801fa20f12 OAPI: regenerate code 2022-07-01 12:32:42 +02:00
Sybren A. Stüvel
60f3f5482d OAPI: add operation & SocketIO subscription for global last-rendered img
Add an operation to get the last-rendered image from whatever job received
such output from a Worker, and add a SocketIO subscription type to receive
updates about all jobs' last-rendered images.

These are necessary for a global last-rendered image display.
2022-07-01 12:31:18 +02:00
Sybren A. Stüvel
56463fa3ec OAPI: regenerate code 2022-06-30 19:19:38 +02:00
Sybren A. Stüvel
cca8155894 OAPI: add 204 as "nothing rendered" response to fetchJobLastRenderedInfo
Add a "204 No Content" response to the `fetchJobLastRenderedInfo` operation,
indicating that there is no rendered output yet.
2022-06-30 19:18:52 +02:00
Sybren A. Stüvel
123674cf57 OAPI: regenerate code 2022-06-30 18:33:36 +02:00
Sybren A. Stüvel
c9500b85c2 OAPI: add SocketIOLastRenderedUpdate for broadcasting last-rendered imgs
`SocketIOLastRenderedUpdate` objects are meant to be broadcast to SocketIO
clients (i.e. the web interface). They are sent to the job-specific room,
just like task updates.
2022-06-30 18:32:42 +02:00
Sybren A. Stüvel
668e25fe95 OAPI: regenerate code 2022-06-28 17:07:08 +02:00
Sybren A. Stüvel
5d30459359 OAPI: add endpoint to get URLs of last-rendered images of a job 2022-06-28 17:05:52 +02:00
Sybren A. Stüvel
fb89658530 Refactor: replace os.IsNotExist() with errors.Is(err, fs.ErrNotExist()
`os.IsNotExist()` is from before `errors.Is()` existed. The latter is the
recommended approach, as it also recognised wrapped errors.

No functional changes, except for recognising more cases of "does not
exist" errors as such.
2022-06-28 10:24:46 +02:00
Sybren A. Stüvel
1353d1df0f OAPI: regenerate code 2022-06-27 11:32:12 +02:00
Sybren A. Stüvel
a084f6e2a4 OAPI: add operations for fetching blocklist & removing individual items 2022-06-27 11:30:37 +02:00
Sybren A. Stüvel
3d20a89bf5 Add last-in-one-out queue
Add an abstract queue that outputs only the last-queued item.
Items that were queued before the last one will be dropped.

This will be used for handling the last-rendered images. Any images
that are rendered while an image is already uploading should be ignored,
except the last one.
2022-06-27 11:30:37 +02:00
Sybren A. Stüvel
167b2eaf45 OAPI: regenerate code 2022-06-24 16:39:50 +02:00
Sybren A. Stüvel
4e9950a143 OAPI: add endpoint for sending Last Rendered Output to Manager 2022-06-24 16:38:49 +02:00
Sybren A. Stüvel
fd730351b5 Crosspath: add IsRoot(path) bool function
Add a function that can determine whether the given path is considered
a "root path". Considers `/`, `X:`, `X:\` and `X:/` root paths, where `X`
is any upper or lower case Latin letters.
2022-06-23 16:40:46 +02:00
Sybren A. Stüvel
7f14dac62f OAPI: regenerate code 2022-06-17 11:37:54 +02:00
Sybren A. Stüvel
aaed1e0589 OAPI: include task failure list in Task schema
Include the list of workers who failed this task in the `Task` schema.
2022-06-17 11:37:28 +02:00
Sybren A. Stüvel
61aad21e99 OAPI: regenerate code 2022-06-16 11:02:04 +02:00
Sybren A. Stüvel
55676b000e OAPI: change worker 'nickname' to just 'name'
There was no need to have the extra four letters 'nick', and some parts
of the code were already using just 'name' for the workers. This simplifies
and unifies things.
2022-06-16 11:01:27 +02:00
Sybren A. Stüvel
1c9846bb8f OAPI: regenerate code 2022-06-09 11:59:32 +02:00
Sybren A. Stüvel
f020582bf7 OpenAPI: include last_touched in Task schema
Include the timestamp of when a Worker last touched the task in the OpenAPI
`Task` schema.
2022-06-09 11:59:01 +02:00
Sybren A. Stüvel
cf8b4e18b1 OAPI: regenerate code 2022-06-02 16:25:38 +02:00
Sybren A. Stüvel
31e128d7f5 OAPI: remove shutdown worker state
Remove the `shutdown` worker state. It was only used in Flamenco 2 to
signal to the worker that it should go offline. In other words, it didn't
use the target state in the request.

As of this change, just send `offline` as the requested state for the
worker if you want it to go offline.
2022-06-02 16:19:26 +02:00
Sybren A. Stüvel
9ca14cd471 OAPI: regenerate code 2022-06-02 12:16:51 +02:00
Sybren A. Stüvel
0d50a7eae5 OAPI: clean, remove unnecessary quotes 2022-06-02 12:16:14 +02:00
Sybren A. Stüvel
169aa3ddc3 OAPI: extract worker status request fields into their own struct
Instead of always passing `status_requested` and `lazy_status_request`
in tandem, and requiring one when the other is present, they are now
always passed as a struct `WorkerStatusChangeRequest`. This struct has
both fields required.

`WorkerStatusChangeRequest` already existed, and is now altered by changing
its field `status_requested` to simply `status` -- the fact that it's
requested is already clear from the context.
2022-06-02 12:16:03 +02:00
Sybren A. Stüvel
fdb0b82664 OAPI: regenerate code 2022-05-31 17:19:06 +02:00
Sybren A. Stüvel
cfb17b178d OAPI: allow worker status change requests
This also introduces the 'lazy' status change boolean, which indicates
whether the status change should interrupt the worker's current task
(lazy=false), or only take effect after the task is finished (lazy=true).
2022-05-31 17:17:37 +02:00
Sybren A. Stüvel
90707dceed OAPI: regenerate code 2022-05-31 15:30:26 +02:00
Sybren A. Stüvel
d82333635a OAPI: define Worker schema as extension of WorkerSummary
This makes their relation clearer. This also moves the `version` field
into the `WorkerSummary` schema.
2022-05-31 15:29:54 +02:00
Sybren A. Stüvel
1f49880b7f OAPI: regenerate code 2022-05-31 15:18:48 +02:00
Sybren A. Stüvel
3b2f58dd27 OAPI: add allWorkers SocketIO subscription type 2022-05-31 15:17:39 +02:00
Sybren A. Stüvel
0fc0d1d0e0 OAPI: regenerate code 2022-05-31 14:58:49 +02:00
Sybren A. Stüvel
221ed17fa2 OAPI: Allow explicit SocketIO subscription to "all jobs"
When the web interface is showing the Workers list, it should no longer
get updates about jobs. A new subscription type `allJobs` is added, and
the `uuid` field of the subscription is no longer mandatory.
2022-05-31 14:58:09 +02:00
Sybren A. Stüvel
885911a06e OAPI: regenerate code 2022-05-31 13:16:10 +02:00
Sybren A. Stüvel
8607827cfa OAPI: add SocketIOWorkerUpdate schema 2022-05-31 13:15:28 +02:00
Sybren A. Stüvel
f2f6726ec0 OAPI: regenerate code 2022-05-31 11:21:41 +02:00
Sybren A. Stüvel
ccea8869c2 OAPI: add operation for fetching worker info 2022-05-31 11:21:05 +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
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
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
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
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
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