1548 Commits

Author SHA1 Message Date
Sybren A. Stüvel
372bb66e09 Bump version to 3.2-rc1 2023-02-21 11:35:55 +01:00
Sybren A. Stüvel
49d8c4e6fd Add "rc" as possible release cycle value
"rc" stands for "release candidate", which will trigger the same versioning
display as an actual release (i.e. just report the version, without the
Git hash info).
2023-02-21 11:35:55 +01:00
Sybren A. Stüvel
daaadbf2fd Webapp: give the Flamenco logo a bit of a black outline
A black outline around the white shape makes it visible in light themed
browser windows.
2023-02-21 11:35:55 +01:00
Sybren A. Stüvel
46c46455f0 Bump golang.org/x/image and golang.org/x/net for security fixes
Fix these vulnerabilities:

```
Vulnerability #1: GO-2023-1572
  An attacker can craft a malformed TIFF image which will consume
  a significant amount of memory when passed to DecodeConfig. This
  could lead to a denial of service.

  More info: https://pkg.go.dev/vuln/GO-2023-1572

  Module: golang.org/x/image
    Found in: golang.org/x/image@v0.0.0-20191009234506-e7c1f5e7dbb8
    Fixed in: golang.org/x/image@v0.5.0

Vulnerability #2: GO-2023-1571
  A maliciously crafted HTTP/2 stream could cause excessive CPU
  consumption in the HPACK decoder, sufficient to cause a denial
  of service from a small number of small requests.

  More info: https://pkg.go.dev/vuln/GO-2023-1571

  Module: golang.org/x/net
    Found in: golang.org/x/net@v0.5.0
    Fixed in: golang.org/x/net@v0.7.0
```
2023-02-21 11:18:33 +01:00
Sybren A. Stüvel
72a78cd929 Webapp: remove some console.log calls
No functional changes, except for a slightly less noisy JS debug console.
2023-02-21 11:10:20 +01:00
Sybren A. Stüvel
1add6bfc8a Webapp: avoid browser JS errors about forbidden 'User-Agent' header
Brave (and maybe other browseres) refuse to set the 'User-Agent' header
in XMLHTTPRequests, and are vocal about this in the debug log. Since the
OpenAPI code generator always outputs a custom 'User-Agent' header, I've
added some JS code to strip that off when constructing an API client.
2023-02-21 11:08:48 +01:00
Sybren A. Stüvel
a5cfa9959b Webapp: cleanup, braces around conditional return statement
No functional changes.
2023-02-21 10:39:13 +01:00
Sybren A. Stüvel
b22ea953d5 Webapp: catch error when job cannot be found
Fetching a non-existent job can happen due to the asynchronous nature
of the webapp, when a job was just deleted. It now no longer complains
about this in the JS debug console.
2023-02-21 10:38:58 +01:00
Sybren A. Stüvel
12f4d9b5ce Tabulator: avoid setting height if already at the correct height
Setting the height of a Tabulator can trigger all kinds of things,
including some buggy behaviour where all the jobs would disappear from
screen. Just don't do it unless it's necessary.
2023-02-21 10:38:07 +01:00
Sybren A. Stüvel
e6ff81fc3d Mark more files as generated code
Add `addon/flamenco/manager_README.md` to the list of generated files.
2023-02-20 11:52:35 +01:00
Sybren A. Stüvel
d8ace7b7ff Website: document Go 1.20 is needed 2023-02-20 11:52:35 +01:00
Nitin-Rawat-1
4efed64a77 Fix error submitting job when not using Shaman
Fix #104183: Error submitting job to flamenco manager.

The bug happened when a user, using filesystem as storage solution,
would try to submit the job to the flamenco manager. The user would be shown
an Error -> Error packing with BAT: 'Packer' object has no attribute 'actual_checkout_path'.

The fix was to account for multiple implementations of the Packer object.

Reviewed-on: https://projects.blender.org/studio/flamenco/pulls/104184
2023-02-17 11:06:07 +01:00
Sybren A. Stüvel
eca498c98a go.mod: declare Go 1.20 as minimum requirement
Also run `go mod tidy` for good measure.
2023-02-09 15:41:29 +01:00
Sybren A. Stüvel
e855d59c68 Website: update Git URLs to projects.blender.org 2023-02-09 15:23:53 +01:00
Sybren A. Stüvel
22f56890c1 Small fix for sleep schedule of soft-deleted workers
There were `ErrWorkerNotFound` errors in different packages, which got
mixed up. Now there's only one.
2023-02-09 11:46:29 +01:00
Sybren A. Stüvel
2aa2f5f75b Upgrade Echo from v4.6.1 to 4.9.1 to address security issue
Upgrade Echo from v4.6.1 to 4.9.1. The security issue was fixed in 4.9.0,
so this upgrade picks the latest 4.9.x to upgrade to.

For more info on the security issue, see
https://pkg.go.dev/vuln/GO-2022-1031
2023-02-09 11:30:06 +01:00
Sybren A. Stüvel
adfc2652b5 Add internal/tools/tools.go to mock-import code generator packages
`internal/tools/tools.go` is a bit of a hacky workaround a limitation of
`go mod tidy`. It will never be built, but `go mod tidy` will see the
packages imported here as dependencies of the Flamenco project, and not
remove them from `go.mod`.

This is meant for build-time requirements that are otherwise never
imported as Go libraries, like our OpenAPI code generator.
2023-02-09 11:25:47 +01:00
Sybren A. Stüvel
426b2aab4d Gracefully handle sleep schedules of deleted workers
Workers can be soft-deleted, which means that they stay in the database.
As such, foreign key constraints `ON DELETE CASCADE` do not trigger, and
thus their sleep schedule can still be active. This is now detected and
handled gracefully.
2023-02-09 11:18:38 +01:00
Sybren A. Stüvel
55bfc8db88 Website: update URLs to point to projects.blender.org 2023-02-07 17:41:26 +01:00
Sybren A. Stüvel
ff41db802f Slight tweak to the bug template 2023-02-07 17:41:12 +01:00
Sybren A. Stüvel
4a2d1d47a6 Simple Gitea issue templates
Just to get something better than a blank form.
2023-02-07 17:35:16 +01:00
Sybren A. Stüvel
6b60a5e828 Web app: upgrade Tabulator 5.1.8 → 5.4.3
Upgrade Tabulator, hopefully this fixes some issues where the job list
would show black (no items shown, but the scrollbar is still there as if
all the items still exist; scrolling up & down would fix it).
2023-02-07 16:41:00 +01:00
Sybren A. Stüvel
5b9393e78c shaman-checkout-id-setter: reduce log levels
Reduce the log levels of normal operations so that warnings do not scroll
off screen.
2023-02-07 16:27:01 +01:00
Sybren A. Stüvel
fe0899fd55 shaman-checkout-id-setter: Don't update job's "updated at" timestamp
The Shaman Checkout ID setter shouldn't update a job's "updated at"
timestamp. Its goal is to fake that the job was submitted with a new
enough Flamenco version, and thus should not touch the timestamps.
2023-02-07 16:24:23 +01:00
Sybren A. Stüvel
652f73c073 Add Makefile target for shaman-checkout-id-setter
It's not meant to be widely used, but this at least gives an easier way
to build the static library with embedded version info intact.
2023-02-07 15:47:11 +01:00
Sybren A. Stüvel
80e0d0fc18 Bumped version to 3.2-beta 2023-02-07 15:38:14 +01:00
Sybren A. Stüvel
c1070b838e Web app: better notifications for job deletion 2023-02-07 15:23:13 +01:00
Sybren A. Stüvel
bf464055e0 Avoid double logging of job storage directory removal 2023-02-07 15:22:52 +01:00
Sybren A. Stüvel
01a85d86cb Add "Shaman Checkout ID setter" command
This is a command that can be run to retroactively set the Shaman
Checkout ID of jobs, allowing the job deletion to also remove the job's
Shaman checkout directory.

This is highly experimental, and not built by default or shipped with
Flamenco releases. It's only been used once at Blender Animation Studio
to help cleaning up. Run at your own risk. Make backups first.
2023-02-07 15:07:41 +01:00
Sybren A. Stüvel
aa1c6b8ff3 Close the database when Flamenco shuts down
This prevents SQLite journal files from lingering around.
2023-02-07 15:05:49 +01:00
Sybren A. Stüvel
34f0a6e676 Add .gitattributes to mark generated files as such 2023-02-07 11:43:25 +01:00
Sybren A. Stüvel
ef3cab9745 Webapp: handle job deletions properly
- Add a little confirmation overlay before deleting a job. This overlay
  also shows information about whether the Shaman checkout directory
  will be deleted or not.
- Send job updates to the web frontend when jobs are marked for
  deletion, and when they are actually deleted.
- Respond to those updates, and handle some corner cases where job info
  is missing (because it just got deleted).

This closes T99401.
2023-02-03 16:59:15 +01: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
bf0906eb95 Manager: avoid logging an error when requesting a non-existent job
This is expected to happen every once in a while, especially now that
Flamenco supports job deletion. It's not something to log at error level.
2023-02-03 16:37:55 +01:00
Sybren A. Stüvel
2927e82802 Swagger UI: remove the "try it out" buttons
Remove the "try it out" buttons, and have the "Execute" buttons visible
immediately.
2023-02-03 13:40:26 +01:00
Sybren A. Stüvel
3bedc2c87a Swagger UI: add "Back to Flamenco" link
Add a link from the API section to the main Flamenco web interface.
2023-02-03 13:40:22 +01:00
Sybren A. Stüvel
3a16456d5b Web app: add job deletion button to job action bar
WARNING: There is no confirmation popup yet, it'll immediately schedule
the job for deletion.
2023-01-08 13:53:55 +01:00
Sybren A. Stüvel
a97a4e6e67 Manager: show delete-requested jobs in the web interface
Show jobs that have been marked for deletion with a red strike-through
line in the jobs table, and show the deletion-request timestamp in the
job details.
2023-01-08 13:52:27 +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
416138fd70 Manager: add test for QueryJobs() API function
No functional changes.
2023-01-08 13:15:30 +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
7f268f2177 Add-on: abort submission when job preparation fails
Job preparation (that is, constructing the data to be sent to the Flamenco
API) shouldn't fail, but in case it does, it should stop the rest of the
submission process.
2023-01-04 01:18:21 +01:00
Sybren A. Stüvel
a5e8ae81e9 gitignore SQLite files
Ignore `*.sqlite-shm` and `*.sqlite-wal` files. These are used by SQLite
for shared memory and write-ahead logging.
2023-01-04 00:44:43 +01:00