Created
August 14, 2013 14:21
-
-
Save octplane/6231506 to your computer and use it in GitHub Desktop.
Script for the benchmark of the murder/lp solution. (cf https://docs.google.com/spreadsheet/ccc?key=0Aq7sV8dJ-ve1dFhwYTIzRXJRWnRmTEkwNVdkejM2dEE#gid=0 )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'murder' | |
set :remote_murder_path, '/etc/bundler.chef/vendor/bundle/ruby/1.9.1/gems/murder-0.1.2/dist/' # or some other directory | |
s = [] | |
pee = s[0..(ENV['COUNT'].to_i || -1)] | |
role :peer, *pee | |
role :seeder, master_fqdn | |
role :tracker, master_fqdn | |
namespace :murder do | |
desc <<-DESC | |
Will cause the seeder machine to connect to the tracker and start seeding. The ip address returned by the 'host' bash command will be ann | |
ounced to the tracker. The server will not stop seeding until the stop_seeding task is called. You must specify a valid 'tag' argument (whi | |
ch identifies the .torrent in /tmp to use) | |
DESC | |
task :start_seeding, :roles => :seeder do | |
require_tag | |
run "screen -dms 'seeder-#{tag}' python #{remote_murder_path}/murder_client.py seeder '#{filename}.torrent' '#{filename}' `LC_ALL=C hos | |
t $(hostname -f) | awk '/has address/ {print $4}' | head -n 1`" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cap -l /dev/null murder:stop_all_seeding 2> /dev/null | |
knife ssh -x root "hostname:*" "rm -rf /mnt/tmp/Deploy*; rm -rf /tmp/Deploy*" > /dev/null | |
path_is_file=1 do_not_download_torrent=1 cap -l /dev/null murder:create_torrent tag="Deploy5" files_path="/mnt/tmp/artifact-5db0cd2f471dfcf280 | |
ec718f0f117fab3b1cb86a-staging.tar" | |
cap -l /dev/null murder:start_seeding tag="Deploy5" | |
time cap -l /dev/null murder:peer tag="Deploy5" destination_path="/mnt/tmp/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment