-
Notifications
You must be signed in to change notification settings - Fork 4
How to Create an Amazon Machine Image (AMI)
Blender has a fast moving development cycle, with a new version about every two months, so Brenda render node AMIs (Amazon Machine Image) become obsolete quickly. Instead, use the following steps to build a Brenda AMI from scratch. It will be in a known state, with the latest software updates and you can add new Blender releases to it at your discretion.
The Brenda installation steps come from James with corrections for Ubuntu Server 14.04, steps for installing supporting libraries that are not on James's site, and *nix OS updating steps for those of us less familiar with that platform. Instructions assume Brenda client software installation has been done previously which has created the "brenda" SSH Access Key Pair and Security Group.
These steps include installing the latest Blender alongside the PPA version for Brenda use.
From the AWS Management Console, on the EC2 Dashboard home screen click "Launch Instance"
- Choose an Amazon Machine Image (AMI): Find the latest Ubuntu Server AMI (e.g. Ubuntu Server 14.04 LTS
ami-9eaa1cf6
) and click the Select button. - Choose an Instance Type: Select an Instance type and click Next. Recommend starting with a "Free tier eligible" type until get familiar with the software, this can be changed later.
- Configure Instance Details: Settings can be left at defaults and simply click Next.
- Add Storage: Settings can be left at defaults and simply click Next.
- Tag Instance: Give your Instance a name (e.g.
DRLINUXUBUI01
) and click Next - Configure Security Group: Under Assign a security group:, choose Select an existing security group, choose the
brenda
Security group, and click Review and Launch - Review Instance Launch: Click the Launch button and choose to Select an existing key pair then select the "brenda" key pair and check the box acknowledging access to the private key.
SSH into the server and update the OS
ssh -i ~/.ssh/id_rsa.brenda ubuntu@<ServerIPAddress>
sudo apt-get update && time sudo apt-get dist-upgrade
Respond “Yes” to downloads and to replace the GRUB menu.lst with the package maintainers version (but it shouldn't matter either way)
Enable root logon for correct Brenda operation (NOTE: The following line was modified from 0/1 values to true/false for modern Ubuntu cloud.cfg format)
sudo perl -i -pe 's/disable_root: true/disable_root: false/' /etc/cloud/cloud.cfg
sudo perl -i -pe 's/.*(ssh-rsa .*)/\1/' /root/.ssh/authorized_keys
sudo service ssh restart
Install Blender and supporting software for Brenda/Blender
sudo add-apt-repository -y ppa:irie/blender
sudo apt-get update
sudo apt-get install -y blender python-pip gcc python-dev libcurl4-openssl-dev git unzip
Install Boto and S3CMD for E3 interaction
sudo pip install -U boto
sudo pip install -U s3cmd
Install Brenda
sudo git clone http://github.com/jamesyonan/brenda.git
cd brenda
sudo python setup.py install
Download and extract a version of Blender later than the PPA
cd /usr/local
sudo wget http://download.blender.org/release/Ble ... 64.tar.bz2
sudo tar -xvjpf blender-2.73-linux-glibc211-x86_64.tar.bz2
sudo rm blender-2.73-linux-glibc211-x86_64.tar.bz2
Rename the Blender file in /usr/bin
and add a link to your current release.
cd /usr/bin
sudo mv blender blender.old
sudo ln -s /usr/local/(your blender version)/blender /usr/bin/blender
Check that the version is correct
blender -v
cd /usr/bin
ls -l blender
Shutdown the instance and make an AMI image
sudo shutdown -h -P now
Create the AMI image via the AWS Management Console in the EC2 Management Console by right clicking on the now stopped Instance and selecting Image -> Make Image.
Enter an image name and description and select Create Image
As your image is being created in the AMI area of the EC2 Management Console, you'll note the AMI ID. Put that into your local Brenda client ~/.brenda.conf
file (e.g. AMI_ID=ami-0e93ee66
)
Edit the Brenda work queue template (e.g. /usr/local/brenda/task-scripts/frame
) from blender
to /usr/local/blender-2.73-linux-glibc211-x86_64/blender
before using brenda-work
. The Blender directory name will obviously change with each release.
If you are not using a us_US
operating system, you may have the following error message when you set up root access using perl.
perl: warning: Setting locale failed.
To resolve the problem: Where xx_XX
is your country code OS.
sudo locale-gen en_US en_US.UTF-8 xx_XX xx_XX.UTF-8
sudo dpkg-reconfigure locales
You can render different projects with different versions of Blender by adding a symlink. You can then add this path to your Brenda frame file.
Set your different link in /usr/bin/
.
blender273a
sudo ln -s /usr/local/blender-2.73a-linux-glibc211-x86_64/blender /usr/bin/blender273a
blender274rc
sudo ln -s /usr/local/blender-2.74-testbuild1-linux-glibc211-x86_64/blender /usr/bin/blender274rc
blender-last-gooseberry
sudo ln -s /usr/local/gooseberry-blender-2.73-1a0e633-linux-glibc211-x86_64/blender /usr/bin/blender-last-gooseberry
Thanks to futurehack on the BrendaPro forum for most of this information. See the original post.