rubber 2.0.0.pre2 → 2.0.0.pre3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -408,7 +408,7 @@ namespace :rubber do
408
408
  # graphite web app)
409
409
  if instance_item.role_names.include?('web_tools')
410
410
  Array(rubber_env.web_tools_proxies).each do |name, settings|
411
- provider.update("#{name}.#{ic.name}", instance_item.external_ip)
411
+ provider.update("#{name}.#{instance_item.full_name}", instance_item.external_ip)
412
412
  end
413
413
  end
414
414
  end
@@ -426,7 +426,7 @@ namespace :rubber do
426
426
  # graphite web app)
427
427
  if instance_item.role_names.include?('web_tools')
428
428
  Array(rubber_env.web_tools_proxies).each do |name, settings|
429
- provider.destroy("#{name}.#{ic.name}")
429
+ provider.destroy("#{name}.#{instance_item.full_name}")
430
430
  end
431
431
  end
432
432
  end
@@ -25,11 +25,12 @@ namespace :rubber do
25
25
 
26
26
  created_vols = created_vols.compact.uniq
27
27
  raid_specs = env.raid_volumes || []
28
+ raid_volume_list = raid_specs.collect {|vol| vol["source_devices"]}.join(" ")
28
29
  raid_specs.each do |raid_spec|
29
30
  # we want to format if we created the ec2 volumes, or if we don't have any
30
31
  # ec2 volumes and are just creating raid array from ephemeral stores
31
- format = raid_spec['source_devices'].all? {|dev| created_vols.include?(dev)}
32
- setup_raid_volume(ic, raid_spec, format)
32
+ format = raid_spec['source_devices'].all? {|dev| created_vols.include?(dev.gsub("xv","s"))}
33
+ setup_raid_volume(ic, raid_spec, format, raid_volume_list)
33
34
  end
34
35
 
35
36
  lvm_volume_group_specs = env.lvm_volume_groups || []
@@ -109,11 +110,7 @@ namespace :rubber do
109
110
  print "."
110
111
  sleep 2
111
112
  volume = cloud.describe_volumes(vol_id).first
112
- if volume[:attachment_status] == "attached"
113
- print "."
114
- sleep 2
115
- break
116
- end
113
+ break if volume[:attachment_status] == "attached"
117
114
  end
118
115
  print "\n"
119
116
 
@@ -128,7 +125,7 @@ namespace :rubber do
128
125
  fi
129
126
  mv /etc/fstab /etc/fstab.bak
130
127
  cat /etc/fstab.bak | grep -v '#{vol_spec['mount']}' > /etc/fstab
131
- if grep '11\.04' /etc/lsb-release; then
128
+ if [ `lsb_release -r -s | sed 's/[.].*//'` -gt "10" ]; then
132
129
  device=`echo #{vol_spec['device']} | sed 's/sd/xvd/'`
133
130
  else
134
131
  device='#{vol_spec['device']}'
@@ -216,26 +213,34 @@ namespace :rubber do
216
213
  end
217
214
  end
218
215
 
219
- def setup_raid_volume(ic, raid_spec, create=false)
216
+ def setup_raid_volume(ic, raid_spec, create=false, raid_volume_list=nil)
220
217
  if create
221
218
  mdadm_init = "yes | mdadm --create #{raid_spec['device']} --metadata=1.1 --level #{raid_spec['raid_level']} --raid-devices #{raid_spec['source_devices'].size} #{raid_spec['source_devices'].sort.join(' ')}"
222
219
  else
223
220
  mdadm_init = "yes | mdadm --assemble #{raid_spec['device']} #{raid_spec['source_devices'].sort.join(' ')}"
224
221
  end
225
-
222
+
226
223
  task :_setup_raid_volume, :hosts => ic.external_ip do
227
224
  rubber.sudo_script 'setup_raid_volume', <<-ENDSCRIPT
228
225
  if ! grep -qE '#{raid_spec['device']}|#{raid_spec['mount']}' /etc/fstab; then
229
226
  if mount | grep -q '#{raid_spec['mount']}'; then
230
227
  umount '#{raid_spec['mount']}'
231
228
  fi
232
- mv /etc/fstab /etc/fstab.bak
233
- cat /etc/fstab.bak | grep -vE '#{raid_spec['device']}|#{raid_spec['mount']}' > /etc/fstab
234
- echo '#{raid_spec['device']} #{raid_spec['mount']} #{raid_spec['filesystem']} #{raid_spec['mount_opts'] ? raid_spec['mount_opts'] : 'noatime'} 0 0 # rubber raid volume' >> /etc/fstab
235
-
236
- # seems to help devices initialize, otherwise mdadm fails because
229
+
230
+ # wait for devices to initialize, otherwise mdadm fails because
237
231
  # device not ready even though ec2 says the volume is attached
238
- fdisk -l &> /dev/null
232
+ echo 'Waiting for devices'
233
+ cnt=0
234
+ while ! [[ -b #{raid_spec['source_devices'] * " && -b "} ]]; do
235
+ if [[ "$cnt" -eq "15" ]]; then
236
+ echo 'Timed out waiting for EBS volumes to initialize.'
237
+ exit 1
238
+ fi
239
+ echo '.'
240
+ sleep 2
241
+ let "cnt = $cnt + 1"
242
+ done
243
+ echo 'Devices ready'
239
244
 
240
245
  #{mdadm_init}
241
246
 
@@ -243,16 +248,23 @@ namespace :rubber do
243
248
  echo $((30*1024)) > /proc/sys/dev/raid/speed_limit_min
244
249
 
245
250
  echo 'MAILADDR #{rubber_env.admin_email}' > /etc/mdadm/mdadm.conf
246
- echo 'DEVICE /dev/hd*[0-9] /dev/sd*[0-9]' >> /etc/mdadm/mdadm.conf
247
- mdadm --detail --scan >> /etc/mdadm/mdadm.conf
251
+ echo 'DEVICE #{raid_volume_list}' >> /etc/mdadm/mdadm.conf
252
+ mdadm --detail --scan | sed s/name=.*\\ // >> /etc/mdadm/mdadm.conf
253
+
254
+ update-initramfs -u
248
255
 
249
256
  mv /etc/rc.local /etc/rc.local.bak
250
257
  echo "mdadm --assemble --scan" > /etc/rc.local
251
258
  chmod +x /etc/rc.local
259
+
260
+ mv /etc/fstab /etc/fstab.bak
261
+ cat /etc/fstab.bak | grep -vE '#{raid_spec['device']}|#{raid_spec['mount']}' > /etc/fstab
262
+ echo '#{raid_spec['device']} #{raid_spec['mount']} #{raid_spec['filesystem']} #{raid_spec['mount_opts'] ? raid_spec['mount_opts'] : 'noatime'} 0 0 # rubber raid volume' >> /etc/fstab
252
263
 
253
264
  #{('yes | mkfs -t ' + raid_spec['filesystem'] + ' ' + raid_spec['filesystem_opts'] + ' ' + raid_spec['device']) if create}
254
265
  mkdir -p '#{raid_spec['mount']}'
255
266
  mount '#{raid_spec['mount']}'
267
+
256
268
  fi
257
269
  ENDSCRIPT
258
270
  end
@@ -1,4 +1,4 @@
1
1
  module Rubber
2
- VERSION = "2.0.0.pre2"
2
+ VERSION = "2.0.0.pre3"
3
3
  end
4
4
 
@@ -8,7 +8,7 @@
8
8
  # For IronRuby (if you wish to use it) you will need:
9
9
  # aptitude install curl mono-2.0-devel
10
10
 
11
- packages: [build-essential, git-core, subversion, curl, autoconf, bison, ruby, zlib1g-dev, libssl-dev, libreadline5-dev, libxml2-dev, libyaml-dev]
11
+ packages: [build-essential, git-core, subversion, curl, autoconf, bison, ruby, zlib1g-dev, libssl-dev, libreadline6-dev, libxml2-dev, libyaml-dev]
12
12
 
13
13
  # REQUIRED: the version of rvm itself
14
14
  rvm_version: 1.10.2
@@ -250,14 +250,23 @@ stop_on_error_cmd: "function error_exit { exit 99; }; trap error_exit ERR"
250
250
  #
251
251
  # # for raid array, you'll need to add mdadm to packages. Likewise,
252
252
  # # xfsprogs is needed for xfs filesystem support
253
+ # #
253
254
  # packages: [xfsprogs, mdadm]
254
255
  # raid_volumes:
255
256
  # - device: /dev/md0 # OS device to to create raid array on
256
257
  # mount: /mnt/fast # The directory to mount this array to
258
+ # mount_opts: 'nobootwait' # Recent Ubuntu versions require this flag or SSH will not start on reboot
257
259
  # filesystem: xfs # the filesystem to create on array
258
260
  # filesystem_opts: -f # the filesystem opts in mkfs
259
261
  # raid_level: 0 # the raid level to use for the array
260
- # source_devices: [/dev/sdx, /dev/sdy] # the source EBS devices we are creating raid array from
262
+ # # if you're using Ubuntu 11.x or later (Natty, Oneiric, Precise, etc)
263
+ # # you will want to specify the source devices in their /dev/xvd format
264
+ # # see https://bugs.launchpad.net/ubuntu/+source/linux/+bug/684875 for
265
+ # # more information.
266
+ # # NOTE: Only make this change for raid source_devices, NOT generic
267
+ # # volume commands above.
268
+ # source_devices: [/dev/sdx, /dev/sdy] # the source EBS devices we are creating raid array from (Ubuntu Lucid or older)
269
+ # source_devices: [/dev/xvdx, /dev/xvdy] # the source EBS devices we are creating raid array from (Ubuntu Natty or newer)
261
270
  #
262
271
  # # for LVM volumes, you'll need to add lvm2 to packages. Likewise,
263
272
  # # xfsprogs is needed for xfs filesystem support
@@ -35,8 +35,8 @@
35
35
  /var/lib/mysql/** rwk,
36
36
  /var/log/mysql/ r,
37
37
  /var/log/mysql/* rw,
38
- /var/run/mysqld/mysqld.pid w,
39
- /var/run/mysqld/mysqld.sock w,
38
+ /{,var/}run/mysqld/mysqld.pid w,
39
+ /{,var/}run/mysqld/mysqld.sock w,
40
40
 
41
41
  /sys/devices/system/cpu/ r,
42
42
  /sys/devices/system/cpu/** r,
@@ -71,7 +71,7 @@ class FogStorageTest < Test::Unit::TestCase
71
71
 
72
72
  should "multipart files over 5 mb" do
73
73
  @storage.expects(:singlepart_store).never
74
- data = 'a' * (5 * 10**6 + 1)
74
+ data = 'a' * (5 * 2**20 + 1)
75
75
 
76
76
  #FIXME: Fog mock for initiate_multipart_upload isn't implemented. Remove mocks when it is
77
77
  @provider.expects(:initiate_multipart_upload).returns(OpenStruct.new(:body => {'UploadId' => 'fake-upload-id'}))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubber
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre2
4
+ version: 2.0.0.pre3
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-02-09 00:00:00.000000000 Z
13
+ date: 2012-02-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: capistrano
17
- requirement: &11447820 !ruby/object:Gem::Requirement
17
+ requirement: &22303940 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 2.8.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *11447820
25
+ version_requirements: *22303940
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: thor
28
- requirement: &11451580 !ruby/object:Gem::Requirement
28
+ requirement: &22301780 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *11451580
36
+ version_requirements: *22301780
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: clamp
39
- requirement: &11450820 !ruby/object:Gem::Requirement
39
+ requirement: &22300360 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *11450820
47
+ version_requirements: *22300360
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: open4
50
- requirement: &11449680 !ruby/object:Gem::Requirement
50
+ requirement: &22299500 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *11449680
58
+ version_requirements: *22299500
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: fog
61
- requirement: &11447780 !ruby/object:Gem::Requirement
61
+ requirement: &26492660 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: 1.0.0
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *11447780
69
+ version_requirements: *26492660
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rake
72
- requirement: &11446860 !ruby/object:Gem::Requirement
72
+ requirement: &26492240 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *11446860
80
+ version_requirements: *26492240
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: test-unit
83
- requirement: &11446300 !ruby/object:Gem::Requirement
83
+ requirement: &26491780 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ! '>='
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: '0'
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *11446300
91
+ version_requirements: *26491780
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: shoulda-context
94
- requirement: &11444960 !ruby/object:Gem::Requirement
94
+ requirement: &26491360 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ! '>='
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: '0'
100
100
  type: :development
101
101
  prerelease: false
102
- version_requirements: *11444960
102
+ version_requirements: *26491360
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: mocha
105
- requirement: &15335180 !ruby/object:Gem::Requirement
105
+ requirement: &26490940 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - ! '>='
@@ -110,10 +110,10 @@ dependencies:
110
110
  version: '0'
111
111
  type: :development
112
112
  prerelease: false
113
- version_requirements: *15335180
113
+ version_requirements: *26490940
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: ruby-debug19
116
- requirement: &15334760 !ruby/object:Gem::Requirement
116
+ requirement: &26490520 !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
119
119
  - - ! '>='
@@ -121,7 +121,7 @@ dependencies:
121
121
  version: '0'
122
122
  type: :development
123
123
  prerelease: false
124
- version_requirements: *15334760
124
+ version_requirements: *26490520
125
125
  description: ! " The rubber plugin enables relatively complex multi-instance deployments
126
126
  of RubyOnRails applications to\n Amazon's Elastic Compute Cloud (EC2). Like
127
127
  capistrano, rubber is role based, so you can define a set\n of configuration
@@ -506,7 +506,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
506
506
  version: '0'
507
507
  segments:
508
508
  - 0
509
- hash: -3761224985838668413
509
+ hash: 4048110118862946601
510
510
  required_rubygems_version: !ruby/object:Gem::Requirement
511
511
  none: false
512
512
  requirements: