44 Commits

Author SHA1 Message Date
Sybren A. Stüvel
5f37bcb629 Build with Magefile (#104341)
Convert most of the code in `Makefile` to [Magefile](https://magefile.org/):

This makes it possible to build Flamenco without `make` (and the POSIX environment/commands it expect) by running:

```bash
$ go run mage.go webappInstallDeps  # Only on the first build.
$ go run mage.go build
```

More efficient builds are possible with other commands, and some release-related commands still require `make`. At least the barrier to entry should be considerably lower (compared to having to install Make + Cygwin/MSYS2 on Windows).

Fix: #102633

This does not port the building of release packages, so it doesn't address #102671.

### Main Targets

| Target   | Description                                                                     |
|----------|---------------------------------------------------------------------------------|
| build    | Build Flamenco Manager and Flamenco Worker, including the webapp and the add-on |
| check    | Run unit tests, check for vulnerabilities, and run the linter                   |
| clean    | Remove executables and other build output                                       |
| generate | Generate code (OpenAPI and test mocks)                                          |

### All Targets

Get these via `go run mage.go -l`:

```
Targets:
  build                           Flamenco Manager and Flamenco Worker, including the webapp and the add-on
  check                           Run unit tests, check for vulnerabilities, and run the linter
  clean                           Remove executables and other build output
  flamencoManager                 Build Flamenco Manager with the webapp and add-on ZIP embedded
  flamencoManagerWithoutWebapp    Only build the Flamenco Manager executable, do not rebuild the webapp
  flamencoWorker                  Build the Flamenco Worker executable
  generate                        code (OpenAPI and test mocks)
  generateGo                      Generate Go code for Flamenco Manager and Worker
  generateJS                      Generate JavaScript code for the webapp
  generatePy                      Generate Python code for the add-on
  govulncheck                     Check for known vulnerabilities.
  staticcheck                     Analyse the source code.
  test                            Run unit tests
  version                         Show which version information would be embedded in executables
  vet                             Run `go vet`
  webappInstallDeps               Use Yarn to install the webapp's NodeJS dependencies
  webappStatic                    Build the webapp as static files that can be served
```

Co-authored-by: Mateus Abelli <mateusabelli@gmail.com>
Reviewed-on: https://projects.blender.org/studio/flamenco/pulls/104341
2024-10-04 21:59:44 +02:00
Sybren A. Stüvel
6a74e49e3d Git-ignore vendor directory
Ignore the Go vendor directory. We don't track upstream sources.
2023-11-27 11:49:49 +07:00
Sybren A. Stüvel
effac1c159 Git-ignore .vscode/launch.json 2023-07-10 14:10:49 +02:00
Sybren A. Stüvel
b58f1e15f1 Add CLI utility to recreate tasks of jobs
Due to an issue (which has been fixed in the previous commit), all tasks
in the database were deleted when starting Flamenco. This tool attempts
to recompile the job and recreate its tasks.

The statuses of the tasks are set based on the job status. Basically:

- job active → tasks queued
- job completed → tasks completed
- job cancelled / failed → tasks cancelled
- otherwise → tasks queued

To ensure that the tool is only used to create tasks from scratch, it
refuses to work on a job that still has tasks in the database.
2023-07-10 14:10:15 +02:00
Sybren A. Stüvel
49aeccf37b Remove vscode settings
This prevents different user preferences fighting each other.

Other VSCode files are still there as I think they're generally useful:
- `extensions.json` for suggesting some VSCode extensions
- `launch.json` to launch Worker and Manager in the debugger
2023-06-02 22:56:20 +02:00
Francesco Siddi
9915951007 Deploy: Update deployment instructions
Move sensitive information into a dedicated .env file, which is
required only for deployment purposes.
2023-05-15 20:09:03 +02: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
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
Sybren A. Stüvel
cb2042db71 gitignore /scripts 2022-09-16 14:16:57 +02:00
Sybren A. Stüvel
46792ee164 Clarify "job etag mismatch" situation
When a submitted job is refused because of a mismatched etag, there is
now a more explanatory error logged on the Manager. The website also has
an entry in the FAQ for this, as I expect more people to run into this
issue when they upgrade Flamenco.
2022-09-01 14:46:30 +02:00
Sybren A. Stüvel
a0b4fc18e6 Makefile: quiet the generator for JS and Python code
The OpenAPI generator is very noisy, so it now logs to a file instead
of to stdout. The file is git-ignored. This was easier than redirecting
to `/dev/null`, as that's not available on Windows.
2022-07-25 16:08:07 +02:00
Francesco Siddi
05e82ea5e4 Website: Update deployment script
The flamenco.io website moves to flamenco.blender.org!
This commit updates the Makefile as follows:

- Rename 'site' to 'project-website', so the new command to deploy is
  'make project-website'
- Move the website directory from 'flamenco-io-site' to
  'project-website'
- Update the rsync command do reflect the new deployment destination
2022-07-25 14:42:30 +02:00
Sybren A. Stüvel
59cb21e3b6 Makefile: add tools targets to download FFmpeg
Four Makefile targets have been added:
- `tools`, which evokes the other three
- `tools-linux`, `tools-darwin`, `tools-windows`, download FFmpeg and put
  the `ffmpeg` executables into `./tools/ffmpeg-{OS}-{ARCH}`.

Downloaded tarball/ZIP files are stored in `tools/download`, and won't be
re-downloaded if they already exist.
2022-07-22 16:37:14 +02:00
Sybren A. Stüvel
26f07d85fd Gitignore stresser executable 2022-07-15 15:08:00 +02:00
Nate Rupsis
273e9504cf Gitignore .DS_Store files from macOS 2022-07-12 11:01:36 +02:00
Sybren A. Stüvel
39722bdd61 Gitignore the new default storage locations
The defaults changed from `task-logs` and `flamenco-storage` to
`flamenco-manager-storage` and `flamenco-shared-storage`.
2022-07-07 12:16:47 +02:00
Sybren A. Stüvel
9939e43b63 Add make site target to build & publish the website
This of course needs SSH access to the flamenco.io website.

Run `hugo --serve` from the `web/flamenco-io-site` directory to simply
run an in-memory copy of the site, and browse it locally at
http://localhost:1313/
2022-07-05 16:17:25 +02:00
Francesco Siddi
eb54d1ab41 Add flamenco-manager.yaml to .gitignore 2022-07-05 15:21:17 +02:00
Sybren A. Stüvel
bcde49ede0 Initial checkin of a static documentation website
Building this site requires Hugo (not yet included in the README or in the
installation of dependencies in the Makefile). Still very much work in
progress, this is basically the [Geekdocks theme][1] + one page.

[1]: https://geekdocs.de/
2022-07-04 18:00:43 +02:00
Sybren A. Stüvel
b021782ca0 Get the make package command to work
To create a single ZIP file that contains the Manager, Worker, and add-on,
just run `make package`.
2022-06-27 16:03:02 +02:00
Sybren A. Stüvel
1b40038e3d Add Go program that can create the addon ZIP file
Use Go to create the addon ZIP file, to be independent of any ZIP
executable being installed on the system.
2022-06-27 15:58:14 +02:00
Sybren A. Stüvel
7b028df8ac Manager: serve static files of the webapp at /app/
Vue Router generates URLs for which there are no static files on the
filesystem (like `/jobs/{job ID}`). To make this work, the webapp's
`index.html` has to be served for such requests. The client-side JavaScript
then figures out how things fit together, and can even render a nice 404
page if necessary.

This shouldn't happen for non-webapp URLs, though. Because of this, the
entire webapp (including the "serve `index.html` if file not found logic)
is moved to a `/app/` base URL.

`make flamenco-manager` now also builds the webapp and embeds the static
files into the binary.

`make flamenco-manager_race` does NOT rebuild the static web files, to
help speed up of debug cycles. Run `make webapp-static` to rebuild the
webapp itself, if necessary, or run a separate web development server with
`yarn --cwd web/app run dev --host`.
2022-06-27 14:53:42 +02:00
Sybren A. Stüvel
11a407d26c Gitignore flamenco-worker.yaml and flamenco-worker-credentials.yaml
Ignore those files regardless of the path. Previously they were only
ignored in the project root, but I want to create several worker
configurations in a subdirectory for testing.
2022-05-31 10:46:27 +02:00
Sybren A. Stüvel
5a5a9aec8b Makefile: add rules for builds with race condition checker enabled
New rules `flamenco-manager_race` and `flamenco-worker_race` will build
with the race condition checker enabled.
2022-04-21 19:06:18 +02:00
Sybren A. Stüvel
ac0127610c Gitignore .blend files that were submitted to Flamenco 2022-04-21 10:45:41 +02:00
Sybren A. Stüvel
0f2477370f Remove SocketIO PoC
Remove SocketIO proof of concept, as its code has been integrated into
Flamenco Manager.
2022-04-04 16:27:15 +02:00
Sybren A. Stüvel
e990603311 OAPI: Add generated JavaScript API client
This adds a JS client for the OAPI interface, and introduces the SocketIO
stuff into Flamenco Manager itself.

To build & run:
- in `web/manager-api` run `npm install`
- in `web/manager-api` run `npm link`
- in `web/app` run `npm install`
- in `web/app` run `npm link flamenco-manager`
- in `web/app` run `yarn serve`

This may not be a complete list, but at least some of those steps are
necessary.
2022-04-01 16:40:54 +02:00
Sybren A. Stüvel
979792d17f Git-ignore the new default Flamenco storage directory 2022-04-01 14:30:44 +02:00
Sybren A. Stüvel
8eedaff6a1 git-ignore shaman-file-storageflamenco/bat/interface.py:232 2022-03-25 14:10:26 +01:00
Sybren A. Stüvel
616784df0a Addon: start of framework for API communication 2022-03-01 17:28:24 +01:00
Sybren A. Stüvel
b678b90932 Proof of concept to test a generated Python OpenAPI client 2022-03-01 17:28:24 +01:00
Sybren A. Stüvel
194422d9fa Remove -poc suffix from Manager and Worker
The code is mature enough to no longer be a proof-of-concept.
2022-02-28 13:01:13 +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
19b86172b4 Ignore blend file backups 2022-02-22 16:02:30 +01:00
Sybren A. Stüvel
90a2140b8c Manager: store task logs to disk 2022-02-21 19:47:07 +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
d880f7e7f0 Worker authentication is working 2022-01-31 15:27:13 +01:00
Sybren A. Stüvel
2a4bf1c60f Toying around with GORM and PostgreSQL 2022-01-24 16:59:48 +01:00
Sybren A. Stüvel
0c9c99806b Start of database interface
Contains a dummy migration because the migrate package will error out if
it cannot find any migration files.
2022-01-11 18:07:34 +01:00
Sybren A. Stüvel
d6638ce114 Track generated files with Git
The OpenAPI-generated files can be used by 3rd parties as well. This
makes them available at `gitlab.com/blender/flamenco-goja-test/pkg/api`.
2022-01-10 17:45:13 +01:00
Sybren A. Stüvel
38a8943767 Add Flamenco Worker PoC 2022-01-10 17:45:13 +01:00
Sybren A. Stüvel
af4304565a Lots of changes to merge the Gin/OpenAPI PoC 2022-01-10 17:45:13 +01:00
Sybren A. Stüvel
eaa693e35e ignore executable on Linux 2022-01-03 19:51:22 +01:00
Sybren A. Stüvel
ae1ea0e2bc Initial checkin 2022-01-03 19:51:22 +01:00