Sybren A. Stüvel
1bcf4139bf
Worker: be a bit faster in requesting a new task
2022-03-17 13:07:48 +01:00
Sybren A. Stüvel
afc6b8e1c5
Worker: add -find-manager
CLI arg
...
With `-find-manager` the Worker will use UPnP/SSDP autodiscovery, report
which Manager it found, and quit.
2022-03-11 10:52:03 +01:00
Sybren A. Stüvel
842255a065
UPnP/SSDP: actually serve a description.xml
...
The `description.xml` file is part of the UPnP Service Discovery protocol,
see https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rxad/9225d145-6b2c-40d5-8ee8-7d837379fc25
2022-03-08 17:25:49 +01:00
Sybren A. Stüvel
353da58ee9
UPnP/SSDP: reduce log level for unreachable URLs
2022-03-08 16:46:14 +01:00
Sybren A. Stüvel
a61e3ca6f7
Worker tests: use in-memory SQLite database
2022-03-08 15:03:03 +01:00
Sybren A. Stüvel
fabb79e583
Worker: move autodiscovery code into the 'worker' package
...
Move the UPnP/SSDP Manager autodiscovery code into from `main.go` into the
`worker` package. This also means changing the error handling a bit, as
only the `main.go` file is allowed to do `log.Fatal()`.
2022-03-08 14:41:30 +01:00
Sybren A. Stüvel
d0b677ffe3
Add API endpoint /api/version
to get the Flamenco Manager version
...
This will be used in the auto-discovery, to check that a discovered URL can
actually be reached & points to a Flamenco Manager.
2022-03-08 13:56:43 +01:00
Sybren A. Stüvel
42407865eb
Worker: change how configuration & credentials are loaded/saved
...
The Worker config/credential management was a bit of a mess. It's now
better structured, and also allows runtime overrides of the Manager URL,
without writing that override to the config file.
2022-03-08 13:51:03 +01:00
Sybren A. Stüvel
9f5e4cc0cc
License: license all code under "GPL-3.0-or-later"
...
The add-on code was copy-pasted from other addons and used the GPL v2
license, whereas by accident the LICENSE text file had the GNU "Affero" GPL
license v3 (instead of regular GPL v3).
This is now all streamlined, and all code is licensed as "GPL v3 or later".
Furthermore, the code comments just show a SPDX License Identifier
instead of an entire license block.
2022-03-07 15:26:46 +01:00
Sybren A. Stüvel
183bb23d2a
Tests: sleep test using bigger time steps
...
Since every mocked clock time step also waits for 1ms to give other
goroutines a chance to run, it took too much wallclock time to mock-sleep
for 47 seconds with 100ms increments.
Stepping the mocked clock with 1s increments makes the test 10x faster.
2022-03-04 12:35:01 +01:00
Sybren A. Stüvel
cd2fe8170e
Errors: remove "error" prefix from message
...
Instead of returning an error "error doing X", just return "doing X". The
fact that it's returned as an error object says enough about that it's
an error.
This also makes it easier to chain error messages, without seeing the
word "error" in every part of the chain.
2022-03-04 11:30:31 +01:00
Sybren A. Stüvel
a7654394b4
Worker: update default task types to match what's currently in use
...
Flamenco v2 had a different classification of task types than Flamenco v3,
and the defaults still referenced the v2 classifications.
2022-03-03 11:51:53 +01:00
Sybren A. Stüvel
47e36c927c
Change package URL to the blender.org repository
2022-03-01 20:45:09 +01:00
Sybren A. Stüvel
b5b7b228ed
Worker: capture panics in 'active' state and cleanly sign off before dying
2022-02-28 12:07:10 +01:00
Sybren A. Stüvel
2a1f5a0df4
Worker: buffer task updates when Manager offline
...
Queue task updates in an SQLite database when the Manager is
unreachable, periodically checking whether they can be flushed.
2022-02-22 19:05:33 +01:00
Sybren A. Stüvel
e948c5d936
Worker: avoid prematurely exiting 'awake' state
2022-02-22 19:01:01 +01:00
Sybren A. Stüvel
5c3a5124f3
Cleanup: add missing comment
2022-02-22 19:00:44 +01:00
Sybren A. Stüvel
b462e8db1a
Worker: wrap api.ClientWithResponsesInterface in a local interface
...
This makes it possible to locally create a mock object for the API client.
2022-02-22 17:13:04 +01:00
Sybren A. Stüvel
a650aa4cbd
Worker: Blender command, don't put current time in log lines
...
The time has to be put in at a different abstraction level.
2022-02-22 15:36:20 +01:00
Sybren A. Stüvel
adf7113b34
Worker: log chunker, also flush log after certain time
...
This flushes the log when the previous `Append()` call was too long ago.
Note that this doesn't flush after X seconds of silence; a call to
`Append()` or `Flush()` still has to happen in order to do the flushing.
2022-02-22 15:34:37 +01:00
Sybren A. Stüvel
45a95ca4c2
Worker: use time service to log current time
2022-02-22 15:33:30 +01:00
Sybren A. Stüvel
66186e460e
Worker: upload logs in chunks to Manager
2022-02-22 15:17:35 +01:00
Sybren A. Stüvel
9a5047a94d
Worker: move command_exe.go interface definitions
2022-02-22 14:42:57 +01:00
Sybren A. Stüvel
0525bd726c
Worker: actually execute blender and log its output
2022-02-22 13:55:28 +01:00
Sybren A. Stüvel
32c7a1fd84
Worker: Blender command, parse CLI arguments from 'exe' parameter
2022-02-22 12:52:16 +01:00
Sybren A. Stüvel
db4505e5fd
Cleanup: move Blender command param parsing to its own function
2022-02-22 12:38:25 +01:00
Sybren A. Stüvel
20965691d0
Add test for Blender command and better command parameter parsing
2022-02-22 12:36:37 +01:00
Sybren A. Stüvel
e9a94eecae
Worker: add CLI runner interface and move test/mock code around a bit
2022-02-22 12:35:43 +01:00
Sybren A. Stüvel
77f1e02c75
Worker: add CommandLineRunner interface for executing CLIs
...
Not yet used, but interface is there + mocked for testing.
2022-02-22 11:48:29 +01:00
Sybren A. Stüvel
b986fa49d8
Worker: clean up some logging
2022-02-21 19:07:20 +01:00
Sybren A. Stüvel
e5e466931b
Worker: better way to get array command parameters
2022-02-21 18:04:17 +01:00
Sybren A. Stüvel
ef2bbd2845
Unified Command field names
...
Some parts of Flamenco had a Command consist of "name + settings", and
other parts used "type + parameters" (with the same semantics). This is
now unified to "name + parameters".
2022-02-21 18:03:51 +01:00
Sybren A. Stüvel
e03e111603
Cleanup: move license declaration comment
2022-02-21 15:42:15 +01:00
Sybren A. Stüvel
9eaae2451b
Rename command_exe_test.go to command_misc_test.go
2022-02-18 11:45:37 +01:00
Sybren A. Stüvel
00571ad480
Worker: allow float64 for sleep duration
...
The sleep will still be truncated to entire seconds.
2022-02-18 11:45:24 +01:00
Sybren A. Stüvel
f6437be844
Worker: implement fail/completed/log task updates
2022-02-18 11:41:46 +01:00
Sybren A. Stüvel
3057a009e7
Worker: better handling of task update errors
2022-02-17 14:02:45 +01:00
Sybren A. Stüvel
ff73f325c8
Worker: clearer errors when listener call fails
2022-02-17 13:58:10 +01:00
Sybren A. Stüvel
fef0a3cb17
Worker: Remove 3rd party code for adding Basic HTTP auth header
2022-02-17 13:58:10 +01:00
Sybren A. Stüvel
66c052d9fd
Move worker config, sign-on, and registration code into worker package
...
This makes the `main.go` file simpler, and not depend on any other files
in the `main` package. For some reason, the debugger really likes this.
2022-02-17 13:58:10 +01:00
Sybren A. Stüvel
71edb139dd
Start working on blender-render
command
...
The command doesn't actually execute anything yet.
2022-02-17 13:58:10 +01:00
Sybren A. Stüvel
3723e89f23
Extract commands into a file based on their "command type"
2022-02-17 10:54:34 +01:00
Sybren A. Stüvel
ecd658d50d
Cleanup: shorten filename from ..._executor.go
to ..._exe.go
2022-02-17 10:52:47 +01:00
Sybren A. Stüvel
e539d04320
Cleanup: remove unused code
2022-02-17 10:49:43 +01:00
Sybren A. Stüvel
4f184a546f
Use gomock to test command executor listener
...
This also requires that `TaskID` is no longer a custom type, because that
would cause import cycles. The alternative would be to put the generated
mocks directly into the `worker` package, but I didn't think that was
particularly nice. Maybe this'll be reconsidered later.
2022-02-17 10:47:52 +01:00
Sybren A. Stüvel
270c54fdb7
More status change acks & checks to get stable flow between worker states
2022-02-15 17:46:37 +01:00
Sybren A. Stüvel
d6df00db3e
Worker: Fix code flow in 'asleep' state
2022-02-15 15:56:15 +01:00
Sybren A. Stüvel
50088b4c94
Save worker info on sign-on (not just on registration)
2022-02-15 10:57:29 +01:00
Sybren A. Stüvel
aa41ae2ba2
Worker: remove fixed error returns from listener
2022-02-14 18:01:48 +01:00
Sybren A. Stüvel
f5254c1c65
Change sleep 'time_in_seconds' to 'duration_in_seconds'
2022-02-14 14:54:03 +01:00