Coder Social home page Coder Social logo

docker-blender-render-cluster's Introduction

blender-render-cluster

A docker based multi machine render setup

Build

Warning: This is only possible in Blender < 2.80. For newer Blender releases this plugin is no longer available so this project is deprecated as well.

Quick Start

Alt text

Option 1 - The easy way: Download basic blender image

$ docker pull d3v0x/blender-render-cluster

All Blender docker images are tagged since version 2.77a. To get a list of available versions, simply run

curl https://index.docker.io/v1/repositories/d3v0x/blender-render-cluster/tags

If you want to download a specific version, type

docker pull d3v0x/blender-render-cluster:2.77a

This will download a 2.77a Blender image.

Option 2 - The "hard" way: Build basic blender image

$ docker build -t blender-render-cluster .

This will build the latest Blender version from my Gentoo d3v0x-overlay

How to start as master

$ docker run --name blender_master -e "RENDER_MODE=MASTER" -p 8000:8000 -d d3v0x/blender-render-cluster

How to start and run as slave

RENDER_MODE will be set to SLAVE by default. You only have to connect/link to the master container.

$ docker run --name blender_slave --link blender_master:master -e "MASTER_PORT_8000_TCP_ADDR=master" -d d3v0x/blender-render-cluster

Connect new slave to master on other host

To connect to a master on another server/host you only have to override the environment variable MASTER_PORT_8000_TCP_ADDR and enter the master IP address

$ docker run -d -e "MASTER_PORT_8000_TCP_ADDR=192.168.178.21" blender_master

Tl;Dr Edition

Sometimes it takes hours or maybe days to render a final image or an animation. I've got several virtual machines, some idle servers and much unused CPU/GPU. This time I want to show how to set up your own render farm with Blenders Network Renderer and my new Blender Cluster Docker image.

Requirements:

  • Some servers or virtual machines
  • A running docker daemon on each machine

Before we start we have to set up our master. This machine will maintain all the jobs and is the first contact for the client - your local workstation.

So lets log in to your server and download my Gentoo based Blender-Render-Cluster image. Of couse you can build the image by yourself if you want. All the sources can be found here at this repo. In this example I want to show how to set up your master and client machines with the prebuild Blender-Render-Cluster image from Docker Hub. You can get some details here.

Set up your master

First of all write down the IP of your master. This is important when we create the slaves on the other machines. Get the IP with

rin@rusty ~ $ ip addr
[...]
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet 10.0.109.55/24 scope global enp2s0
    valid_lft forever preferred_lft forever
[...]

In this example my IP is 10.0.109.55.

Now we want to download the image and start up the master.

rin@rusty ~ $ docker pull d3v0x/blender-render-cluster

This will take some time and downloads the base image:

[...]
latest: Pulling from d3v0x/blender-render-cluster
137d1c317b8c: Downloading [==>                                                ] 10.25 MB/255.7 MB
c2418f02a306: Download complete 
67174dd10795: Download complete 
1c7a34115767: Downloading [========>                                          ] 17.28 MB/98.57 MB
7ddca3076d93: Download complete 
3ca40110a232: Downloading [===========================>                       ] 16.85 MB/30.91 MB
f95d0e53882a: Download complete 
[...]

After the download is completed you can see the new blender image in the list

rin@rusty ~ $ docker images
REPOSITORY                     TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
d3v0x/blender-render-cluster   latest              1bbb3cc7d57c        3 hours ago         1.95 GB

And that's it. Now we can start our master image with

$ docker run -e "RENDER_MODE=MASTER" -p 8000:8000 -d --name blender_master d3v0x/blender-render-cluster

The RENDER_MODE environment variable is required because the python script for Blender within the container will set all the configuration of the network render add-on for you. And with this single image you can create master or slave containers based on this environment variable. The default / fallback will set the render mode to slave.

Now you can switch to your webbrowser and go to http://master-ip:8000 and get the web interface of your master render server. Now your master is online.

Alt text

Connect slaves to your master

After the master is up and running we can start to connect some slaves. Log in to your next virtual machine and download the Docker image again.

rin@gentoo-vm ~ $ docker pull d3v0x/blender-render-cluster

But this time we want a slave which connects to the master. So we have to start the container with masters IP address:

rin@gentoo-vm ~ $ docker run --name blender_slave -d -e "MASTER_PORT_8000_TCP_ADDR=10.0.109.55" d3v0x/blender-render-cluster

Replace the IP 10.0.109.55 with your masters IP of course. And now you've got your first slave in your list. Check the web interface to get some details. If your master and the slave is on the same machine you can link both docker containers together instead of overwriting the IP.

rin@gentoo-vm ~ $ docker run --name blender_slave -d --link blender_master:master -e "MASTER_PORT_8000_TCP_ADDR=master" d3v0x/blender-render-cluster

Repeat this for all your other machines.

Alt text

Set up Blender to render within your new cluster

And now we want to render our animation within our new rendering network. Before we can send our jobs we have to enable the Blender Add-on "Render: Network Render" within the Blender User Preferences.

Alt text

Next, switch to the Network Render Engine. Be sure you saved you're scene before because the file will be sent to the master.

Alt text

Now you've got many new settings within your Render Section within the Properties Panel. Add your masters IP address and click on refresh at "Slaves Status". You should see all your slaves.

And that's it. Happy rendering!

docker-blender-render-cluster's People

Contributors

korigod avatar rndevfx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-blender-render-cluster's Issues

docker build error: use changes are necessary to proceed

Hi,

I'm not well versed in gentoo and emerge, so I'm not quite sure what to do about this error:

The following USE changes are necessary to proceed:
 (see "package.use" in the portage(5) man page for more details)
# required by dev-python/cryptography-2.6.1::gentoo
# required by dev-python/urllib3-1.24.2::gentoo
# required by dev-python/requests-2.21.0-r1::gentoo
# required by media-gfx/blender-2.79b-r1::gentoo
# required by media-gfx/blender (argument)
>=virtual/python-enum34-2 python_targets_python3_5

Use --autounmask-write to write changes to config files (honoring
CONFIG_PROTECT). Carefully examine the list of proposed changes,
paying special attention to mask or keyword changes that may expose
experimental or unstable packages.
The command '/bin/sh -c emerge media-gfx/blender' returned a non-zero code: 1

I tried adding those use changes in data/package.use/blender but then I got another error:

make[1]: *** [Makefile:2091: ks_tables.h] Error 134
make[1]: Leaving directory '/var/tmp/portage/x11-libs/libX11-1.6.8/work/libX11-1.6.8-abi_x86_64.amd64/src'
make: *** [Makefile:521: all-recursive] Error 1
 * ERROR: x11-libs/libX11-1.6.8::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=x11-libs/libX11-1.6.8::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-libs/libX11-1.6.8::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-libs/libX11-1.6.8/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-libs/libX11-1.6.8/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-libs/libX11-1.6.8/work/libX11-1.6.8-abi_x86_64.amd64'
 * S: '/var/tmp/portage/x11-libs/libX11-1.6.8/work/libX11-1.6.8'

>>> Failed to emerge x11-libs/libX11-1.6.8, Log file:

>>>  '/var/tmp/portage/x11-libs/libX11-1.6.8/temp/build.log'
 * Messages for package dev-python/mako-1.0.6:
 *   dev-python/beaker for Caching support
 * Messages for package x11-libs/libX11-1.6.8:
 * ERROR: x11-libs/libX11-1.6.8::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=x11-libs/libX11-1.6.8::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-libs/libX11-1.6.8::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-libs/libX11-1.6.8/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-libs/libX11-1.6.8/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-libs/libX11-1.6.8/work/libX11-1.6.8-abi_x86_64.amd64'
 * S: '/var/tmp/portage/x11-libs/libX11-1.6.8/work/libX11-1.6.8'





 * Regenerating GNU info directory index...
 * Processed 80 info files.

 * IMPORTANT: 7 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

The command '/bin/sh -c emerge media-gfx/blender' returned a non-zero code: 1

Unsure if the changes I did were correct or not, anyway it doesn't seem to work.
Do you have an idea how to fix or further debug this?

docker build error: media-libs/openimageio-1.8.7 ~amd64

When checking out the repo, and running docker build -t blender-render-cluster ., I'm getting the following at the end of the build process:

[ebuild  N    ~] media-gfx/blender-2.79-r1  USE="bullet cycles dds elbeem game-engine headless nls openexr openimageio openmp tiff -collada -colorio -cuda -debug -doc -ffmpeg -fftw -jack -jemalloc -jpeg2k -libav -llvm -man -ndof -openal -opencl -opensubdiv -openvdb -osl -player -sdl -sndfile {-test} -valgrind" PYTHON_SINGLE_TARGET="python3_5 -python3_6" PYTHON_TARGETS="python3_5 -python3_6" 

The following keyword changes are necessary to proceed:
 (see "package.accept_keywords" in the portage(5) man page for more details)
# required by media-gfx/blender-2.79-r1::gentoo[openimageio]
# required by media-gfx/blender (argument)
=media-libs/openimageio-1.8.7 ~amd64

Use --autounmask-write to write changes to config files (honoring
CONFIG_PROTECT). Carefully examine the list of proposed changes,
paying special attention to mask or keyword changes that may expose
experimental or unstable packages.
The command '/bin/sh -c emerge media-gfx/blender' returned a non-zero code: 1

The full output is here: https://gist.githubusercontent.com/moorage/452f1d0140956db134460fb3800c994b/raw/138158d9a3b3e057f0d8dbeb9d6501571e90e1aa/output.txt

No master server on network

Hi,

I'm using Blender 2.79 and I can't connect to my master server. The error is "No master server on network"

Blender 2.71 cannot connect to render master

Can you tell me if the blender version used for this docker image is compatible with Blender 2.71?

I can connect to the render master webapp, but Blender refuses to connect to the server.

images are not listed on docker hub

When trying to list the tags via curl https://index.docker.io/v1/repositories/d3v0x/blender-render-cluster/tags I always get "ressource not found" as response.

Also I cannot find your repository on docker hub. Did you remove/rename it?

If you need help setting the docker hub repo up again, I'm willing to contribute some time and support to get it back online.

Incorrect server version! error when connecting to master

on blender console, i get this error

Incorrect server version!
expected 1.8.1 received 1.8
Error: Incorrect master version

more info

โžœ  ~ blender --version
Blender 2.79 (sub 7)
        build date: 2019-03-27
        build time: 18:12:23
        build commit date: 2019-03-26
        build commit time: 13:42
        build hash: a29446da526d
        build platform: Linux
        build type: Release

server funning Image: d3v0x/blender-render-cluster:2.79

web ui is accessible on https://blender.braiven.io/ you can try it from your end and connection should happen on port 80 wuthout https

what could i be doing wrong? i just picked the latest of everything, running the setup on aws

regards,

Update to Blender 2.78

Currently there is an open pull request at gentoo/gentoo#2531 for Blender 2.78 which improves the package in several ways (thanks to @dracwyrm). I'll wait until the review process is done and will use the ebuild from the official Gentoo testing repo.

Incorrect server version

Hi thank you for your great job ;-),

I am close to have it working, but I have some issues, when I try to connect to the master, I get this error:

Incorrect server version!
expected 1.8.1 received 1.8
Incorrect master version
Incorrect server version!
expected 1.8.1 received 1.8
Error: Incorrect master version

Could you update the version of blender to have the last version of the master ?

Many thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.