2076 Commits

Author SHA1 Message Date
Sybren A. Stüvel
95dd4f7474 Webapp: restore 'Delete Worker' button
Restore the 'Delete Worker' button. It accidentally got removed in
86cf30e44eedde25a2429564724ac05c000afaff
2023-09-11 16:50:34 +02:00
Sybren A. Stüvel
ee8c349ad3 Cleanup: webapp, remove trailing space 2023-09-11 16:50:03 +02:00
Sybren A. Stüvel
f951981a4c Make: add targets for running devservers, and avoid installing Hugo
Add `make` targets `devserver-webapp` and `devserver-website` to run
respectively Yarn and Hugo.

This also slightly changes how Hugo is invoked, from using the `hugo` CLI
command to `go run github.com/gohugoio/hugo@v0.101.0`. This avoids the
need to actually install Hugo locally, and also will use the correct
version of Hugo if the locally-installed version happens to be different.
2023-09-08 15:39:20 +02:00
Sybren A. Stüvel
a229c0f75a Make: rename target project-website to deploy-website
This makes it clearer that this target actually deploys the website
to flamenco.blender.org.
2023-09-08 15:37:29 +02:00
Sybren A. Stüvel
89a323d079 Fix vulnerability GO-2022-0603, but on code path we don't touch
Fix a vulnerability in the YAML parser library. It's in a part of the
library that Flamenco doesn't touch, which is why this isn't mentioned
in the CHANGELOG.md file.

------------

Found 1 vulnerability in packages that you import, but there are no call
stacks leading to the use of this vulnerability. You may not need to
take any action. See https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck
for details.

Vulnerability #1: GO-2022-0603
    Panic in gopkg.in/yaml.v3
  More info: https://pkg.go.dev/vuln/GO-2022-0603
  Module: gopkg.in/yaml.v3
    Found in: gopkg.in/yaml.v3@v3.0.0-20210107192922-496545a6307b
    Fixed in: gopkg.in/yaml.v3@v3.0.0-20220521103104-8f96da9f5d5e
2023-09-07 12:13:07 +02:00
Sybren A. Stüvel
e0be4f2378 Run go mod tidy 2023-09-07 12:09:19 +02:00
Sybren A. Stüvel
6a9e1239b8 Security fixes
Vulnerability #1: GO-2023-1990
    Excessive CPU consumption when decoding 0-height images in
    golang.org/x/image/tiff
  More info: https://pkg.go.dev/vuln/GO-2023-1990
  Module: golang.org/x/image
    Found in: golang.org/x/image@v0.5.0
    Fixed in: golang.org/x/image@v0.10.0
    Example traces found:
      #1: internal/worker/output_uploader.go:144:36: worker.loadAsJPEG calls image.Decode, which calls tiff.Decode

Vulnerability #2: GO-2023-1989
    Excessive resource consumption in golang.org/x/image/tiff
  More info: https://pkg.go.dev/vuln/GO-2023-1989
  Module: golang.org/x/image
    Found in: golang.org/x/image@v0.5.0
    Fixed in: golang.org/x/image@v0.10.0
    Example traces found:
      #1: internal/worker/output_uploader.go:144:36: worker.loadAsJPEG calls image.Decode, which calls tiff.Decode
2023-09-07 12:07:58 +02:00
Sybren A. Stüvel
900f3a7faa Add make vet target
This runs `go vet` as well as `govulncheck`. These may install
dependencies other than installed via `make with-deps`.
2023-09-07 12:07:27 +02:00
Sybren A. Stüvel
c12e4cae74 Webapp: add explanation to Tags view
Add a bit of info on how the tags work to the right-hand column of the
Tags view.
2023-09-04 14:11:26 +02:00
Sybren A. Stüvel
eb11f10b9d Cleanup: webapp, reformat with Prettier
No functional changes.
2023-09-04 14:10:29 +02:00
Sybren A. Stüvel
0821df8f3a Webapp: make Tags view respond to SocketIO messages
Make the Tags view/tab respond to changes in worker tags. This way the
'Refresh' button is no longer necessary, as the information is always
up to date.
2023-09-04 13:24:50 +02:00
Sybren A. Stüvel
d6ffb424eb Webapp: remove unused imports
No functional changes.
2023-09-04 13:23:33 +02:00
Sybren A. Stüvel
fb58f101ea Webapp: remove last reference to worker list
Just a remainder of copy-paste.
2023-09-04 13:23:10 +02:00
Sybren A. Stüvel
9029ab89eb Webapp: show placeholder when worker tag has no description
Show a 'click to set a description' placeholder, when a worker tag has
no description. That way it's clear where to click to edit it.
2023-09-04 13:16:08 +02:00
Sybren A. Stüvel
31a5a8dc23 Webapp: make the Manager responsible for setting a default tag description
When creating a new tag, don't set the description in the JS code, but
leave that for the Manager API to do.
2023-09-04 13:08:55 +02:00
Eveline Anderson
c68a72ca49 Web Interface for Tags (#104244)
Add a web interface for CRUD operations of worker tags.

A 'Tags' tab is added to the web interface, with a list of available
worker tags. New ones can be created, existing tags removed, and the
name & description of tags can be edited.

Reviewed-on: https://projects.blender.org/studio/flamenco/pulls/104244
2023-09-04 13:06:06 +02:00
Sybren A. Stüvel
60fb20c0ff Fix #104245: Incorrect frame range formatting when crafting blender's cmd
Fix a bug in the translation from 'human' frame ranges ('A-B,C-D') to
'Blender' frame ranges ('A..B,C..D'). It required calling
`string.replaceAll()` instead of `string.replace()` in the job compiler
script, which in turn required an upgrade of the JavaScript engine Goja.
2023-08-23 19:55:49 +02:00
Michael Cook
bc7b434121 Always use local time for job compiler timestamp variable
The 'Simple Blender Render' job compiler script uses a `{timestamp}`
variable to determine the render output path. This variable is now set
to the local time, rather than UTC.

This fixes #104219: Unit tests are timezone-dependent

The solution uses Go `time.Local` timezone to satisfy unit tests
assertions using a Mock clock. The timezone of the local workstation
running the tests.
2023-08-23 16:08:01 +02:00
Sybren A. Stüvel
eb9f46dc9b Manager: fix sleep scheduler time zone handling
The sleep scheduler now always works in the local time zone.

This fixes the sleep scheduler part of #104219.
2023-08-23 13:54:02 +00:00
Sybren A. Stüvel
ef726da17b SocketIO broadcasting for worker tags CUD operations
Broadcast create/update/delete operations on worker tags via SocketIO.

Ref: #104204
2023-08-23 13:54:02 +00: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
Michael Cook
86cf30e44e Webapp: Clarification of Worker Maintenance section (#104229)
- fix spelling of 'adviced' for 'advised'
- fixed readability of sentence in error state.

Reviewed-on: https://projects.blender.org/studio/flamenco/pulls/104229
2023-08-23 15:23:50 +02:00
Sebastian Parborg
5f3c8c259d Makefile: Add a standalone recipe for building only the addon .zip (#104239)
Add `make flamenco-addon.zip` build target , making it easier to only
build and distribute the addon. Before this change, the only way to
generate the addon .zip via `make` was to also build the manager.

Reviewed-on: https://projects.blender.org/studio/flamenco/pulls/104239
2023-08-23 15:21:14 +02:00
Michael Cook
b9582f0ebd Doc: FAQ for when worker cannot find Blender executable
Document how to deal with the warning Flamenco Worker can show during
startup, about not being able to find Blender.
2023-08-23 15:15:36 +02:00
Sybren A. Stüvel
089bae5bf9 Webapp: import notifications on job details component
Errors getting worker tags were logged in the notifications area, but the
notifications Piña store weren't actually imported, causing a JS error.
2023-08-17 16:29:08 +02:00
Sybren A. Stüvel
e231f6f221 Manager: better logging of tag create/update/delete
Emit an info-level log message when worker tags are created, updated, or
deleted.
2023-08-15 10:36:54 +02:00
Sybren A. Stüvel
c477992467 Manager: tag update without description now keeps the description
Updating a tag without `description` field in the request body will keep
the tag's description as-is. Previously this caused it to become empty,
which is now still possible by using an explicit `description: ""`.
2023-08-15 10:29:44 +02:00
Sybren A. Stüvel
72ec9501b9 Website: add restart_exit_code to the worker config documentation 2023-08-14 17:40:36 +02:00
Sybren A. Stüvel
9a406f2e33 Website: better documentation of worker actions
Instead of explaining all the menu items, just explain the basic actions
(shut down, restart, sleep, wake up), and explain the 'after task is
finished' vs. 'immediately' separately.
2023-08-14 16:14:44 +02:00
Sybren A. Stüvel
97a909791c Website: make table cells v-align to top
This makes tables a little easier on the eyes.
2023-08-14 16:13:53 +02:00
Sybren A. Stüvel
3760b06066 Update CHANGELOG
Add the 'restartable workers' feature to the changelog.
2023-08-14 16:03:11 +02:00
Sybren A. Stüvel
0364a7ad79 Merge pull request 'Restartable workers' (#104242) from restartable-workers into main 2023-08-14 16:01:33 +02:00
Sybren A. Stüvel
3e72391cbf Restartable workers
When the worker is started with `-restart-exit-code 47` or has
`restart_exit_code=47` in `flamenco-worker.yaml`, it's marked as
'restartable'. This will enable two worker actions 'Restart
(immediately)' and 'Restart (after task is finished)' in the Manager web
interface. When a worker is asked to restart, it will exit with exit
code `47`. Of course any positive exit code can be used here.
2023-08-14 16:00:09 +02: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
9009b60379 Website: add list of supported commands
Document the commands currently implemented in Flamenco Worker.
2023-08-09 10:55:58 -07:00
Sybren A. Stüvel
4e31ccb31c Add SIGGRAPH 2023 redirect
Add a HTTP redirect for the SIGGRAPH hands-on class. It redirects to
https://siggraph.stuvel.eu/ so that I can easily update the website while
at SIGGRAPH itself.
2023-08-01 17:35:21 +02:00
Sybren A. Stüvel
b2c49492f1 Makefile: get proper git hash when directly on tag + dirty
When the current `HEAD` is tagged, and the work directory is 'dirty', the
`GITHASH` variable now contains the actual Git hash. Before this change it
would only be the word "dirty".
2023-08-01 13:57:37 +02:00
Sybren A. Stüvel
100e8e404e Rename add-on to flamenco-addon.zip
Rename the add-on from `flamenco3-addon.zip` to `flamenco-addon.zip`.

It still contains the same files as before, and in Blender the name of
the add-on has not changed.
2023-08-01 13:05:02 +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
cac030e9d4 Bump version of FFmpeg to 5.1
The 5.0 binaries that were bundled could no longer be downloaded from the
original URLs, so I took the opportunity to upgrade a minor version.

Unfortunately there is a discrepancy between the last version of FFmpeg
(according to https://ffmpeg.org/download.html#release_5.1) and the
binaries that are offered for download. Because of this, Linux is at 5.1.1,
where Windows and macOS (darwin) are on 5.1.2.
2023-07-31 17:07:44 +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
7dc3def1d5 Manager: simplify variable expansion
Simplify the variable expansion code. Instead of using a separate goroutine
and two channels, use a struct + a simple function call.

No functional changes.
2023-07-31 15:15:20 +02:00
Sybren A. Stüvel
7d1ce8131a Manager: simplify value-to-variable replacement
Simplify the code for the two-way variables' value-to-variable replacement.

Instead of using a goroutine and two channels, use a separate struct and
call a function on that directly.

No functional changes.
2023-07-31 13:58:43 +02:00
Sybren A. Stüvel
7d72653c93 Extra tests for backslashed two-way variables 2023-07-31 12:32:42 +02:00
Sybren A. Stüvel
dc6d5d9b8e Makefile: explicitly specify Git hash length
Explicitly specify the Git hash length to use, to ensure consistent version
info regardless of version of Git or platform to build on.
2023-07-24 15:58:45 +02:00
Sybren A. Stüvel
e8ae0c3cf2 Website: Fix 'report a bug' link 2023-07-24 14:53:18 +02:00
Sybren A. Stüvel
1dd2e165c8 Webapp: show Manager name in the window title
Show the configured Manager name in the webapp browser window title. This
helps me to distinguish the production farm from my development install.
2023-07-22 13:44:02 +02:00
Sybren A. Stüvel
1ef9a81094 Cleanup: remove TODO
Remove a TODO (the work was done in cdf1cff4).
2023-07-22 13:40:38 +02:00