Version 46, last updated by sgolu6 at September 27, 2011 09:45 UTC
Setup control center
The Control Center software runs on Subversion, Git, and Trac tool servers. It accepts Remote Procedure Calls from the Rails application server, and performs actions on the Trac, subversion, or git instances. To serve these requests, we use a Ruby implementation of the Erlang-based Bertrpc protocol called "ernie". The control center has methods to control each type of tool.
- The Ernie control center is used by breakout to add, delete, and copy remote tools (such as svn repository, git repository, Trac repository). The Control Center also syncs ssh keys, performs backups to Amazon S3, and returns the size of a repository.
- The Ernie Control Center also handles requests from the code browser and returns code browser information: for example: directory listing, getting a file, changesets, revision logs.
- On the production Assembla.com, we run two instances of Ernie Control Center, with the second process dedicated to handling streaming requests, like file downloads, repository copy, and ftp.
Install Software
Get Control Center scripts
Checkout the Control Center software from within an arbitrary directory (for example, /tmp or ~/projects).
- cd into the directory of your choice
- Get the Ernie control center
# Get the ernie Control Center code
git clone ssh://<your_login>@rgit.assembla.com:29418/breakout-control.git
Setup Configuration Files
Go to your breakout-control folder and copy:
- etc/control.yml.example to etc/control.yml
- etc/fuse-ssh-authd.yml.example to fuse-ssh-authd.yml
You will need to create folders to hold each repositories and configure it in those files
Install gems
We need some additional software to install gems, on debian we need the below packages:
sudo apt-get install libfuse-dev libfuse2
Go to breakout-control and run
bundle install
Try it
Once you are ready run it to make sure it's ok. Some commands:
To run specs (might not work well until svn/git/hg is setuped):
rake
To run daemon as your original user:
rake start
To run daemon as www-data (requires to setup permissions for www-data to all folders and code breakout-control needs to access):
rake ernie
To stop daemon:
ctrl + g (will open user promt)
Troubleshooting
- "`require': no such file to load -- svn/core" and using Ubuntu with RVM:
sudo apt-get install subversion-tools libsvn-ruby
cd /usr.lib/ruby/1.8
cp -R svn ~/.rvm/rubies/default/lib/ruby/1.8
cp -R i686-linux ~/.rvm/rubies/default/lib/ruby/1.8 - issues with loading/finding ernie: add it to the PATH in ~/.bashrc
export PATH=$PATH:~/.bundler/ruby/1.8/ernie-d5289bc3f6d3/bin
-
Issues with erlang (app is confirmed to work under other erlang versions fine)
-
We need to install erlang version 1:13.b.4-dfsg-3 (or higher) from the testing branch. Temporarily add this line to /etc/apt/sources.list:
deb http://http.us.debian.org/debian testing main contrib non-free
-
Install and confirm using these commands:
sudo apt-get update
sudo apt-get install erlang-nox
aptitude show erlang-nox | grep Version - Confirm the erlang version:
# erl Eshell V5.6.3 (abort with ^G) 1> init:script_id(). {"OTP APN 181 01", "R13B02"} 2>^G User switch command --> q - Cleanup by removing the line you added above from /etc/apt/sources.list, and issuing:
sudo apt-get update
-
We need to install erlang version 1:13.b.4-dfsg-3 (or higher) from the testing branch. Temporarily add this line to /etc/apt/sources.list: