257 Commits

Author SHA1 Message Date
Sybren A. Stüvel
441079aa06 OAPI: rename SocketIOxxx types to Eventxxx types
Events were previously only sent via SocketIO, but now they can also be
sent via MQTT. These are now renamed from `SocketIO…` to `Event…`.

There is still the SocketIO subscription mechanism, for which the types are
still prefixed with `SocketIO`. MQTT manages subscription on the broker,
not on Flamenco Manager itself, for now this will remain SocketIO-only
functionality.
2024-02-05 09:11:13 +01:00
Sybren A. Stüvel
f464aea137 Manager & website: provide more helpful info when Worker auth fails
Provide more useful info when a Worker tries to communicate but fails
the authentication check. The message about this is now more friendly
and links to a new FAQ entry at
https://flamenco.blender.org/faq/#what-does-unknown-worker-is-trying-to-communicate-mean
2024-01-25 14:19:24 +01:00
Sybren A. Stüvel
70faa4e225 Move URLs to the Flamenco website to constants in a dedicated package
Create a dedicated package `.../pkg/website` to contain constants for the
URLs of documentation, bug reporting, etc. That way it's easier to see
which parts of the website are being referred to from the Flamenco
binaries, and updates can happen in a central spot.

No functional changes.
2024-01-25 12:25:06 +01:00
Sybren A. Stüvel
b9e41065c1 OAPI: regenerate code 2023-12-16 23:03:53 +01:00
Sybren A. Stüvel
aff6d41a91 OAPI: Add endpoint for mass job deletion
This endpoint will not actually delete the jobs, but just mark them for
deletion. Flamenco Manager will process the deletions in the background.
2023-12-16 22:59:28 +01:00
Sybren A. Stüvel
ff2d8f649f OpenAPI: update job submission example
Update the job submission example YAML to reflect the current state of the
`simple-blender-render` job compiler script.

No functional changes.
2023-12-16 13:29:12 +01:00
Sybren A. Stüvel
aa4d3cff75 Windows: check user's system privileges when Shaman is enabled
Symbolic links on Windows require some special user privilege, and
Shaman can now check for this at startup. Hopefully this helps in guiding
people towards a working Shaman system.
2023-10-16 21:36:16 +02:00
Sybren A. Stüvel
40f76efec9 Shaman: log a warning on platforms that don't reliably support symlinks
Windows 10 Home does not support symlinks, and Shaman will cause errors
unless running as admin (which is not recommended for security reasons).
Now Flamenco Manager will log a warning when Shaman is enabled on this
platform.
2023-10-15 14:37:15 +02:00
Sybren A. Stüvel
d60af809be Shaman: skip certain tests if the platform cannot do symlinking reliably
Windows 10 Home ("Core") only allows symlinking when running as admin,
which is not recommended for Flamenco Manager. Instead of failing unit
tests on this system, simply skip them. This reduces noise when developing
on this platform (i.e. my personal laptop) a lot.
2023-10-15 14:26:32 +02:00
Sybren A. Stüvel
12bc182857 Log more OS info at startup
In addition to logging `GOOS` and `GOARCH`, also log more info about the
system:

- Windows: the Windows version and edition.
- Linux: distribution, distribution version, and kernel version.
- macOS: just "macOS", until we know more about getting info there too.
2023-10-15 14:16:56 +02:00
Sybren A. Stüvel
621f050a68 OAPI: regenerate code 2023-08-23 13:54:02 +00:00
Sybren A. Stüvel
56081e5572 OAPI: SocketIO broadcasting for worker tags CUD operations 2023-08-23 13:54:02 +00:00
Sybren A. Stüvel
1eb7764d00 OAPI: regenerate code 2023-08-14 16:00:06 +02:00
Sybren A. Stüvel
7cfc2aa9e7 OAPI: Restartable workers
Extend the data model so that Workers can mark themselves as 'restartable'
at sign-on.
2023-08-14 14:57:00 +02:00
Sybren A. Stüvel
02fac6a4df Change Go package name from git.blender.org to projects.blender.org
Change the package base name of the Go code, from
`git.blender.org/flamenco` to `projects.blender.org/studio/flamenco`.

The old location, `git.blender.org`, has no longer been use since the
[migration to Gitea][1]. The new package names now reflect the actual
location where Flamenco is hosted.

[1]: https://code.blender.org/2023/02/new-blender-development-infrastructure/
2023-08-01 12:42:31 +02:00
Sybren A. Stüvel
dae5b1a571 Fix #104237: fix issue with drive-only paths on Windows
Fix an issue where a shared storage path on Linux, that maps via two-way
variables to a drive root on Windows, caused problems with the path
translation system.

Windows paths that consist only of a drive letter (`F:`) cannot just be
concatenated to a relative path, as that will result in `F:path\to\file`,
which is still a relative path of sorts. This is now handled correctly,
and should result in `F:\path\to\file`.

This fixes #104237.
2023-07-31 15:28:07 +02:00
Sybren A. Stüvel
4b53c06467 OAPI: regenerate code 2023-07-13 15:00:34 +02:00
Sybren A. Stüvel
6686ba3610 OAPI: yet another refactor of 'eval-on-submit' behavior for job settings
The data is still the same, but the names of the properties have changed
a bit so that they're more generic, declarative, instead of specific to
one bit of functionality.

The goal is to have the `evalInfo.description` field usable for the
'evaluate now' button in the add-on as well. That way it should be
clearer what that does.

This commit just updates the OpenAPI definition.
2023-07-13 14:59:22 +02:00
Sybren A. Stüvel
ab399594c7 OAPI: regenerate code 2023-07-13 14:42:07 +02:00
Sybren A. Stüvel
886f21e958 OAPI: refactor how 'eval-on-submit' settings are configured
Refactor the job settings. The `autoevalLockable` boolean is now
replaced with an `evalOnSubmit` nested object:

```
  evalOnSubmit: {
    showButton: true,
    placeholder: "Scene frame range",
  },
```

This makes it possible to add a placeholder text, and later maybe some
other parameters. The `showButton: true` part always has to be there, as
the entire feature is disabled with `showButton: false`, in which case
it's better to just remove the entire `evalOnSubmit` sub-object
altogether. Still, I think it's preferred to have that `showButton:
true` in there, as it makes it more explicit what this section of the
settings is for.

This commit just contains the OpenAPI definition.
2023-07-13 14:39:29 +02:00
Sybren A. Stüvel
168305f785 OAPI: regenerate code 2023-07-13 12:06:21 +02:00
Sybren A. Stüvel
553fffa21e OAPI: add option to make a job setting auto-evaluatable by the user
Add a new job setting option `autoevalLockable`. Setting this to `true` in
the job compiler's `JOB_TYPE` settings has the following effect:

- By default, the setting will not be editable in Blender's job submission
  interface. Instead, a toggle button with a 'car' icon will be shown.
- When the 'car' button is toggled off, the setting becomes editable again.

In its default, uneditable state, the setting will be auto-evaluated before
submission.

This makes it possible to 'lock in' auto-evaluation. The main use case is
for the frame range of the render job. By default this will be locked to
the scene frame range, but it can still be overridden if a different
range is wanted.

This commit just contains the necessary OpenAPI change.
2023-07-13 12:00:29 +02:00
Eveline Anderson
341dc6c8e2 OAPI: regenerate code 2023-07-10 11:08:44 +02:00
Eveline Anderson
df51561640 OAPI: rename worker 'cluster' to 'tag'
This implements the OpenAPI changes necessary for the rename.

See #104204

Reviewed-on: https://projects.blender.org/studio/flamenco/pulls/104223
2023-07-10 11:08:39 +02:00
Sybren A. Stüvel
82456424c9 OAPI: regenerate code 2023-07-06 12:19:48 +02:00
Sybren A. Stüvel
c6dcf6d7bd OAPI: better reporting of version info
Make it explicit that the `version` property is for human consumption.
Also add a new `git` property so that all info from `version` is also
included in separate fields for machine consumption.
2023-07-06 12:18:26 +02:00
Sybren A. Stüvel
87ff1187ef Fix #104218: Shaman unit test TestGarbageCollect is unstable
Copy files instead of hard-linking. The hard-links seemed to have some
weird behaviour, at least on Windows 10 where I tested this.
2023-05-31 13:57:48 +02:00
Sybren A. Stüvel
c1fe3fb740 Shaman GC: better logging for file deletion errors
When the Shaman GC process cannot remove files, log a message that explains
that this happens (and why).
2023-05-31 13:55:04 +02:00
Sybren A. Stüvel
caa2f9ccf1 Shaman: improve logging & checking of timestamps
Add more logging of timestamps in the actual code, and a few sanity
checks in unit tests.

These were useful while trying to find the root cause of #104218 and might
be useful in the future too. The solution to that issue will be committed
later.
2023-05-31 13:54:28 +02:00
Sybren A. Stüvel
16da14479b OAPI: regenerate code 2023-05-26 11:25:51 +02:00
Adi Sage
b56a610f8d OAPI: Remove obsolete job statuses
Remove the following statuses from `flamenco-openapi.yaml`:

- 'construction-failed'
- 'archiving'
- 'archived'

These were a leftover from Flamenco v2 and have never been used in
Flamenco v3.

Reviewed-on: https://projects.blender.org/studio/flamenco/pulls/104215
2023-05-26 11:25:35 +02:00
Sybren A. Stüvel
ebf4021da2 Fix #104191: Manager build error on ARM64
Reimplement the `touch()` function on Linux to avoid depending on the
`syscall` package, and use the `sys/unix` package instead. This is
slightly higher level, and seems to build on AMD64 and ARM64.
2023-05-15 10:51:01 +02:00
Sybren A. Stüvel
472b73eb5c Cleanup: run go fmt ./...
No functional changes.
2023-04-17 16:36:52 +02:00
Sybren A. Stüvel
f5ab2bb4c2 OAPI: regenerate code 2023-04-04 13:18:59 +02:00
Sybren A. Stüvel
0e6b6a6013 API: allow worker cluster creation without explicit UUID
Clusters can be created without UUID now. In that case, a random one will
be generated. The cluster will be returned by the creation call, so that
the caller can know that generated UUID.
2023-04-04 13:18:24 +02:00
Sybren A. Stüvel
675d966263 OAPI: regenerate code 2023-04-04 12:18:17 +02:00
Sybren A. Stüvel
cbbf7b01d6 API: add worker clusters to the API
Worker Clusters can be managed via the API, workers can be assigned to
any number of clusters (if not assigned to any, they'll pick up any task).

Jobs can be submitted with a cluster ID, in which case only workers that
are in that cluster or are clusterless will pick up its tasks.
2023-04-04 12:16:54 +02:00
Sybren A. Stüvel
c21cc7d316 OAPI: regenerate code 2023-02-03 16:44:55 +01:00
Sybren A. Stüvel
92ac1d99de OAPI: add job-deletion-related operation & schema extensions
Add a "what-would-delete-do" operation, to query the Manager about what
the deletion of a specific job would entail. For some jobs the job files
will also be deleted (if they were created with a new enough Flamenco),
otherwise they will remain untouched.

Also expand the `SocketIOJobUpdate` schema to include info about job
deletion.
2023-02-03 16:41:50 +01:00
Sybren A. Stüvel
067f2a439e OAPI: regenerate code 2023-01-08 13:47:38 +01:00
Sybren A. Stüvel
4b489dbde7 OAPI: add delete_requested_at in Job schema
If job deletion was requested, this field will contain the timestamp that
indicates when the request came in.
2023-01-08 13:45:57 +01:00
Sybren A. Stüvel
791d877ff1 Manager: implement API endpoint for deleting jobs
Implement the `deleteJob` API endpoint. Calling this endpoint will mark
the job as "deletion requested", after which it's queued for actual
deletion. This makes the API response fast, even when there is a lot of
work to do in the background.

A new background service "job deleter" keeps track of the queue of such
jobs, and performs the actual deletion. It removes:

- Shaman checkout for the job (but see below)
- Manager-local files of the job (task logs, last-rendered images)
- The job itself

The removal is done in the above order, so the job is only removed from the
database if the rest of the removal was succesful.

Shaman checkouts are only removed if the job was submitted with Flamenco
version 3.2. Earlier versions did not record enough information to reliably
do this.
2023-01-04 01:18:21 +01:00
Sybren A. Stüvel
2e5f5ffadd OAPI: regenerate code 2023-01-04 01:18:21 +01:00
Sybren A. Stüvel
23afbfbea2 OAPI: add operation deleteJob 2023-01-04 01:18:21 +01:00
Sybren A. Stüvel
f413a40f4e Store Shaman checkout ID when submitting a job
If Shaman is used to submit the job files, store the job's checkout ID
(i.e. the path relative to the checkout root) in the database. This will
make it possible in the future to remove the Shaman checkout along with
the job itself.
2023-01-04 01:18:21 +01:00
Sybren A. Stüvel
bb41889f1c OAPI: regenerate code 2023-01-04 01:18:21 +01:00
Sybren A. Stüvel
014c0d3b3d OAPI: add field to Job schemas to record storage info
Add fields to the job schemas (`SubmittedJob` and `Job`) to allow
storing the shaman checkout ID (so the Shaman checkout can be deleted
along with the job later).
2023-01-04 01:18:21 +01:00
Sybren A. Stüvel
9bda21648e Manager: add timeout when fetching job
Add a timeout when fetching a job from the persistence layers.

It's my intention to add more timeouts, so this also introduces some code
to make it easier to test that a context has a deadline set.
2022-12-14 13:02:59 +01:00
Sybren A. Stüvel
c439bc3a1e OAPI: regenerate code 2022-10-20 13:13:22 +02:00
Sybren A. Stüvel
cdd304ffdb OAPI: add endpoint for a pre-flight job check
Add an endpoint that mimicks the job submission endpoint, to see whether
the job survives the job compiler script. This can be used to fail early,
before actually sending files to the farm.
2022-10-20 13:13:03 +02:00