309 Commits

Author SHA1 Message Date
Sybren A. Stüvel
399c8af750 Correctly handle workers assigned to tasks + simple task updates 2022-02-17 17:30:52 +01:00
Sybren A. Stüvel
31e39e2137 Cleanup: remove fmt.Sprintf from sendAPIError calls 2022-02-17 17:30:27 +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
0ab8151a92 Move code out of main.go and add better check for OpenAPI paths 2022-02-17 13:58:10 +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
f1ad0a66a8 Makefile: separate build rule for each app
These do not run `go generate`, so they're faster but take a bit more care.
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
c4df62d5d4 Start of sending task updates to Manager
This includes a mocking framework for unittests.
2022-02-15 15:58:24 +01:00
Sybren A. Stüvel
9543d6221b Wrap error with %w 2022-02-15 15:56:54 +01:00
Sybren A. Stüvel
93517549b0 Manager: actually return worker state in /api/worker/state endpoint 2022-02-15 15:56:38 +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
dfd55914b2 Worker: keep trying to sign on until we have an answer from the Manager 2022-02-15 11:46:00 +01:00
Sybren A. Stüvel
beda64d7c0 Clean up authentication routine 2022-02-15 11:29:48 +01:00
Sybren A. Stüvel
58619ea6db Cleanup: go mod tidy 2022-02-15 11:20:54 +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
7586be010b API changes for sending task updates to the Manager 2022-02-14 18:01:32 +01:00
Sybren A. Stüvel
0457809641 Scheduler: filter on supported task types & assigned worker ID 2022-02-14 18:00:43 +01:00
Sybren A. Stüvel
4aafb782ac Scheduler: Assign task to worker 2022-02-14 17:47:26 +01:00
Sybren A. Stüvel
3ffef34690 Allow sendAPIError() to be used like fmt.Sprintf 2022-02-14 16:53:40 +01:00
Sybren A. Stüvel
eea219c3e2 Move task scheduler into persistence layer 2022-02-14 16:53:21 +01:00
Sybren A. Stüvel
edfcbb1e40 Add a TODO to the features list 2022-02-14 16:31:23 +01:00
Sybren A. Stüvel
d0be631bca New job compiler: echo-sleep-test 2022-02-14 15:07:20 +01:00
Sybren A. Stüvel
8e01c069d1 DB: task dependencies should be cascade-deleted with their tasks 2022-02-14 15:07:14 +01:00
Sybren A. Stüvel
a9790ec579 API: return job from DB instead of authored job
The authored job has tasks & commands in there, which shouldn't be sent
as-is as an API response. Marshalling the task pointers for the
inter-task dependencies would potentially produce quite large responses.
2022-02-14 15:03:17 +01:00
Sybren A. Stüvel
f5254c1c65 Change sleep 'time_in_seconds' to 'duration_in_seconds' 2022-02-14 14:54:03 +01:00
Sybren A. Stüvel
8af041fe44 Cleanup: remove some unused code & add some comments 2022-02-14 14:47:54 +01:00
Sybren A. Stüvel
22f2084e89 Unit tests for 'echo' and 'sleep' commands 2022-02-14 14:47:41 +01:00
Sybren A. Stüvel
ad4313b93f Untested command runner with 'sleep' and 'echo' commands 2022-02-11 17:09:58 +01:00
Sybren A. Stüvel
61164252da Cleanup: remove unused code 2022-02-11 16:51:55 +01:00
Sybren A. Stüvel
cf8ba835aa Added framework for task & command execution 2022-02-11 16:51:28 +01:00
Sybren A. Stüvel
96023932da SocketIO based chat client as PoC for backend/frontend communication
The chat client itself is just a throwaway project. The SocketIO system
will be used to send realtime updates about jobs, tasks, and workers to
the web frontend.
2022-02-11 14:47:26 +01:00
Sybren A. Stüvel
2964f37dce List of to-be-implemented features 2022-02-01 18:09:47 +01:00
Sybren A. Stüvel
feaf924cec Task Scheduler: also include job priority in the scheduling 2022-02-01 18:09:35 +01:00
Sybren A. Stüvel
97ab93d996 Initial task scheduler implementation 2022-02-01 17:17:19 +01:00
Sybren A. Stüvel
2ee66af6d4 Prevent tests running in parallel
Each test tries to reset the database, which shouldn't happen in parallel.
2022-02-01 17:17:19 +01:00
Sybren A. Stüvel
fad2dc3042 Job authoring: handling of task dependencies + some bugfixes 2022-02-01 17:17:19 +01:00
Sybren A. Stüvel
8063a3e169 Cleanup: remove unused code 2022-02-01 16:22:21 +01:00
Sybren A. Stüvel
e598397ba4 Persistence: move some DB to API struct conversion to API implementation 2022-02-01 16:22:10 +01:00
Sybren A. Stüvel
862ed96af7 Make persistence.CreateTestDB public so it can be used from other packages 2022-02-01 10:57:33 +01:00
Sybren A. Stüvel
2ca8858c28 Only update status field in DB when worker changes status 2022-02-01 10:16:10 +01:00
Sybren A. Stüvel
be89349632 Very basic non-functional framework for a task runner
Also has some login/logout functionality for storing stuff in the DB.
2022-01-31 16:05:27 +01:00
Sybren A. Stüvel
d3071146da Better logging of worker info 2022-01-31 15:35:57 +01:00