Skip to content

Setup

Assumptions: 1. This assumes you have Docker Desktop on your host workstation. 2. Using buildx you want to build amd64 and arm64 targets.

Note

The development container is not used to build Blender or the Flamenco + Blender Container for the Blender Render Cluster in this project. This development container is intended to run for development or debugging purposes. See Technical / Installation / Flamenco / Manager for more information on Flamenco + Blender Container for the render cluster.

Summary

There are several reasons why you may want to consider using a Dev Container to build and test Flamenco components.

The simplest being to maintain an isolated toolchain and development environment. There are additional benefits such as repeatability and parallel testing of different releases and toolchain versions. This is particularly useful in troubleshooting and reproducing bugs.

Creating a docker container based build environment also makes it easier to integrate to CICD pipelines as most of them support storing and running containers during the deployment workflow.

Host Build Differences

Deviations from Flamenco project Getting-Started toolchain installation:

  1. Nodejs can be installed using snapd as mentioned on the Flamenco project Getting-Started.
  2. Nodejs is installed using Debian setup_16.x script.
  3. In Ubuntu 22.04 LTS, the latest version of golang is 18. So a custom third party PPA is needed to get backports of the latest (1.20 at time of writing) to meet the Flamenco project requirements.

Example Dockerfile

The following Dockerfile examples assumes it is copying over the working-copy of the Flamenco repo and that you want to automatically make the executables while building the container.

This Docker Container will run various applications from building everything, to running the webapp to the flamenco-manager and creating Flamenco executables. Therefore, the dockerfile example includes all necessary components.

The Dockerfile also includes a copy of Blender as the Flamenco Manager setup workflow checks for a Blender executable.

Example: Flamenco Development Dockerfile

Place the above Dockerfile in the root directory of the Flamenco repository and build a docker container called flamenco_dev.

flamenco-working-copy/
 |- Dockerfile          <----- Place Dockerfile here
 |- internal/
 |- addon/
 |- cmd/
 |- web/
 |- README.md
 |- ...

This will install the toolchain and then build the Flamenco project using the working-copy source code. Details on the buildx Docker Container and build process

Once the Docker container is built, it will have also created the flamenco-manager and flamenco-worker executables. See how to extract these from the container.

You can also run the webapp and manager from the container and access their console from the host.

Running Flamenco Build Targets

There are a number of Flamenco project build targets.

Some are for debugging and testing. Some create executables or deploy them.

To run one of these targets you can modify the docker run command:

docker run --name flamenco_dev_manager -it flamenco_dev make version
Package     : git.blender.org/flamenco
Version     : 3.3-alpha0
Git Hash    : v3.2-39-g23e6e875
GOOS        : linux
GOARCH      : amd64

CGO_ENABLED=0
docker run flamenco_dev make flamenco-manager_race 
CGO_ENABLED=1 go build -race -o flamenco-manager_race -v -ldflags=" -X git.blender.org/flamenco/internal/appinfo.ApplicationVersion=3.3-alpha0 -X git.blender.org/flamenco/internal/appinfo.ApplicationGitHash=v3.2-39-g23e6e875 -X git.blender.org/flamenco/internal/appinfo.ReleaseCycle=alpha" git.blender.org/flamenco/cmd/flamenco-manager

internal/unsafeheader
internal/coverage/rtcov
internal/goarch
internal/goexperiment
internal/cpu
internal/abi
internal/goos
...
git.blender.org/flamenco/internal/manager/timeout_checker
git.blender.org/flamenco/internal/manager/api_impl
git.blender.org/flamenco/internal/manager/api_impl/dummy
git.blender.org/flamenco/cmd/flamenco-manager