rubber 2.5.0 → 2.5.1

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.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +24 -0
  3. data/lib/rubber/cloud/fog.rb +3 -3
  4. data/lib/rubber/cloud/generic.rb +5 -8
  5. data/lib/rubber/cloud/vagrant.rb +2 -0
  6. data/lib/rubber/recipes/rubber/utils.rb +2 -0
  7. data/lib/rubber/vagrant/command.rb +17 -0
  8. data/lib/rubber/vagrant/config.rb +7 -1
  9. data/lib/rubber/vagrant/plugin.rb +5 -0
  10. data/lib/rubber/vagrant/provisioner.rb +48 -16
  11. data/lib/rubber/version.rb +1 -1
  12. data/templates/browsermob_proxy/config/rubber/deploy-browsermob_proxy.rb +63 -0
  13. data/templates/browsermob_proxy/config/rubber/role/browsermob_proxy/crontab +8 -0
  14. data/templates/browsermob_proxy/config/rubber/role/browsermob_proxy/monit-browsermob_proxy.conf +15 -0
  15. data/templates/browsermob_proxy/config/rubber/role/browsermob_proxy/startup.sh +21 -0
  16. data/templates/browsermob_proxy/config/rubber/rubber-browsermob_proxy.yml +10 -0
  17. data/templates/browsermob_proxy/templates.yml +1 -0
  18. data/templates/graylog/config/rubber/role/graylog_web/graylog_web-upstart.conf +1 -1
  19. data/templates/graylog/config/rubber/rubber-graylog.yml +1 -1
  20. data/templates/graylog/templates.yml +0 -1
  21. data/templates/jetty/config/rubber/rubber-jetty.yml +1 -1
  22. data/templates/redis/config/rubber/deploy-redis.rb +1 -1
  23. data/templates/selenium_grid_hub/config/rubber/deploy-selenium-grid-hub.rb +66 -0
  24. data/templates/selenium_grid_hub/config/rubber/role/selenium_grid_hub/crontab +8 -0
  25. data/templates/selenium_grid_hub/config/rubber/role/selenium_grid_hub/logging.properties.conf +15 -0
  26. data/templates/selenium_grid_hub/config/rubber/role/selenium_grid_hub/monit-selenium_grid_hub.conf +15 -0
  27. data/templates/selenium_grid_hub/config/rubber/role/selenium_grid_hub/startup.sh +23 -0
  28. data/templates/selenium_grid_hub/config/rubber/rubber-selenium-grid-hub.yml +15 -0
  29. data/templates/selenium_grid_hub/templates.yml +1 -0
  30. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eea69e220cb373705e078eaa52e02f5e90a170d6
4
- data.tar.gz: ff4b8c6ed5e32ce6bbbcc40987e11cf675d83af8
3
+ metadata.gz: 874530599c3fb40c2fdc87aa3d34e0d1ecbad4f1
4
+ data.tar.gz: 8d8db84373a553fbf15318dda960aef4a9c45dae
5
5
  SHA512:
6
- metadata.gz: 0402e07cef45eb6e2d109161e7fee64fd1cf81375b4be06a804462855b15828a5236b26aabf8f35863a7bfd69f828f40067c134f902e476327a0c3f36213de3a
7
- data.tar.gz: 57b6878e9a38472c947019b9d8283a773b59bf082ea3529ffa80dfb13fd5cda5a2a3b85dc83fb3c35dc71af93bd81f321099be9431f84085cc11babd835083af
6
+ metadata.gz: cb872b9bb7e8a899c6f442db47a723d93e079155f63757a948e9cc8ab5060ff9fe853145f9970470a312f9da11b3263f1df16a094701d9f5d7d059f20fcbb0a8
7
+ data.tar.gz: b055e094a5e7077a16ce5626c5433ff70e16cea9cb16426c94f96cbcd17e7312e8bbc5fb4ad515d8888bce2cb71e9a2d834e72f46b4ad5bf624334d1e0474e8a
data/CHANGELOG CHANGED
@@ -1,3 +1,26 @@
1
+ 2.5.1 (06/09/2013)
2
+ -----------------
3
+
4
+ New Features:
5
+ ============
6
+
7
+ [browsermob_proxy] Added a BrowserMob Proxy template.
8
+ [selenium_grid_hub] Added a Selenium Grid hub template.
9
+
10
+ Improvements:
11
+ ============
12
+
13
+ [graylog] Use JDK 7 instead of JDK 6.
14
+ [jetty] Use JDK 7 instead of JDK 6.
15
+
16
+ Bug Fixes:
17
+ =========
18
+
19
+ [core] Refresh already created instances in Vagrant so firewall rules are adjusted for any modified roles.
20
+ [core] Better handling of serial_tasks when no instances have a defined role.
21
+ [graylog] Fixed loading graylog-web in any environment other than "production."
22
+
23
+
1
24
  2.5.0 (06/03/2013)
2
25
  -----------------
3
26
 
@@ -5,6 +28,7 @@ New Features:
5
28
  ============
6
29
 
7
30
  [core] Added support for using Rubber as a Vagrant provisioner. Now you can run Rubber easily against local VMs.
31
+ [core] Don't pass nil SSH key file entries to Capistrano because it hides the error message and makes things really hard to track down.
8
32
 
9
33
 
10
34
  2.4.2 (06/01/2013)
@@ -11,13 +11,13 @@ module Rubber
11
11
  def initialize(env, capistrano)
12
12
  super(env, capistrano)
13
13
 
14
- compute_credentials = Rubber::Util.symbolize_keys(env.compute_credentials)
14
+ compute_credentials = Rubber::Util.symbolize_keys(env.compute_credentials) if env.compute_credentials
15
15
  storage_credentials = Rubber::Util.symbolize_keys(env.storage_credentials) if env.storage_credentials
16
16
 
17
- @compute_provider = ::Fog::Compute.new(compute_credentials)
17
+ @compute_provider = compute_credentials ? ::Fog::Compute.new(compute_credentials) : nil
18
18
  @storage_provider = storage_credentials ? ::Fog::Storage.new(storage_credentials) : nil
19
19
  end
20
-
20
+
21
21
  def storage(bucket)
22
22
  return Rubber::Cloud::FogStorage.new(@storage_provider, bucket)
23
23
  end
@@ -1,23 +1,20 @@
1
- require 'fog'
1
+ require 'rubber/cloud/fog'
2
2
 
3
3
  module Rubber
4
4
  module Cloud
5
- class Generic < Base
5
+ class Generic < Fog
6
6
  MUTEX = Mutex.new
7
7
 
8
- attr_reader :storage_provider
9
-
10
8
  def initialize(env, capistrano)
11
9
  # TODO (nirvdrum 05/23/13): This is here until the storage provider stuff is cleaned up. That's why this class inherits from Base rather than Fog.
12
10
  if env.cloud_providers && env.cloud_providers.aws
13
11
  storage_credentials = {
14
- :provider => 'AWS',
15
- :aws_access_key_id => env.cloud_providers.aws.access_key,
16
- :aws_secret_access_key => env.cloud_providers.aws.secret_access_key
12
+ :provider => 'AWS',
13
+ :aws_access_key_id => env.cloud_providers.aws.access_key,
14
+ :aws_secret_access_key => env.cloud_providers.aws.secret_access_key
17
15
  }
18
16
 
19
17
  env['storage_credentials'] = storage_credentials
20
- @storage_provider = ::Fog::Storage.new(Rubber::Util.symbolize_keys(env.storage_credentials))
21
18
  end
22
19
 
23
20
  super(env, capistrano)
@@ -36,6 +36,8 @@ module Rubber
36
36
  instance = {}
37
37
  instance[:id] = instance_id
38
38
  instance[:state] = state
39
+ instance[:external_ip] = capistrano.rubber.get_env('EXTERNAL_IP', "External IP address for host '#{instance_id}'", true)
40
+ instance[:internal_ip] = capistrano.rubber.get_env('INTERNAL_IP', "Internal IP address for host '#{instance_id}'", true, instance[:external_ip])
39
41
 
40
42
  [instance]
41
43
  end
@@ -105,6 +105,8 @@ namespace :rubber do
105
105
  # have precedence, so the servers show up in that group
106
106
  added_servers = []
107
107
  serial_roles.each do |rolename|
108
+ next if servers[rolename].nil?
109
+
108
110
  servers[rolename] -= added_servers
109
111
  added_servers << servers[rolename]
110
112
  servers[rolename] = servers[rolename].uniq.sort
@@ -0,0 +1,17 @@
1
+ module VagrantPlugins
2
+ module Rubber
3
+ class Command < Vagrant.plugin("2", :command)
4
+
5
+ def execute
6
+ require 'rubber'
7
+ ::Rubber::initialize(Dir.pwd, 'vagrant')
8
+
9
+ require 'rubber/cli'
10
+ success = ::Rubber::CLI.run(Dir.pwd, @argv)
11
+
12
+ success ? 0 : 1
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -1,15 +1,17 @@
1
1
  module VagrantPlugins
2
2
  module Rubber
3
3
  class Config < Vagrant.plugin("2", :config)
4
- attr_accessor :roles, :rubber_env
4
+ attr_accessor :roles, :rubber_env, :use_vagrant_ruby
5
5
 
6
6
  def initialize
7
7
  @roles = UNSET_VALUE
8
8
  @rubber_env = UNSET_VALUE
9
+ @use_vagrant_ruby = UNSET_VALUE
9
10
  end
10
11
 
11
12
  def finalize!
12
13
  @rubber_env = 'vagrant' if @rubber_env == UNSET_VALUE
14
+ @use_vagrant_ruby = true if @use_vagrant_ruby == UNSET_VALUE
13
15
 
14
16
  ::Rubber::initialize(Dir.pwd, @rubber_env)
15
17
 
@@ -21,6 +23,10 @@ module VagrantPlugins
21
23
  return { 'rubber' => ['rubber_env must be set to the Rubber environment to use for this cluster'] }
22
24
  end
23
25
 
26
+ unless [true, false].include?(@use_vagrant_ruby)
27
+ return { 'rubber' => ['use_vagrant_ruby must be set to a Boolean value'] }
28
+ end
29
+
24
30
  if @roles.nil?
25
31
  return { 'rubber' => ['roles must be set to a list of roles to use for this machine'] }
26
32
  end
@@ -4,6 +4,11 @@ module VagrantPlugins
4
4
  name 'rubber'
5
5
  description 'Provides support for provisioning your virtual machines with Rubber.'
6
6
 
7
+ command(:rubber) do
8
+ require File.expand_path('../command', __FILE__)
9
+ Command
10
+ end
11
+
7
12
  config(:rubber, :provisioner) do
8
13
  require File.expand_path('../config', __FILE__)
9
14
  Config
@@ -19,41 +19,73 @@ module VagrantPlugins
19
19
  def provision
20
20
  @ssh_info = machine.ssh_info
21
21
 
22
- create
22
+ create || refresh
23
23
  bootstrap && deploy_migrations
24
24
  end
25
25
 
26
26
  private
27
27
 
28
28
  def create
29
- script = <<-ENDSCRIPT
30
- unset GEM_HOME;
31
- unset GEM_PATH;
32
- PATH=#{ENV['PATH'].split(':')[1..-1].join(':')} RUN_FROM_VAGRANT=true RUBBER_ENV=#{config.rubber_env} ALIAS=#{machine.name} ROLES='#{config.roles}' EXTERNAL_IP=#{private_ip} INTERNAL_IP=#{private_ip} RUBBER_SSH_KEY=#{ssh_info[:private_key_path]} bash -c 'bundle exec cap rubber:create -S initial_ssh_user=#{ssh_info[:username]}'
33
- ENDSCRIPT
29
+ if config.use_vagrant_ruby
30
+ script = "RUN_FROM_VAGRANT=true RUBBER_ENV=#{config.rubber_env} ALIAS=#{machine.name} ROLES='#{config.roles}' EXTERNAL_IP=#{private_ip} INTERNAL_IP=#{private_ip} RUBBER_SSH_KEY=#{ssh_info[:private_key_path]} #{internal_cap_command} rubber:create -S initial_ssh_user=#{ssh_info[:username]}"
31
+ else
32
+ script = <<-ENDSCRIPT
33
+ unset GEM_HOME;
34
+ unset GEM_PATH;
35
+ PATH=#{ENV['PATH'].split(':')[1..-1].join(':')} RUN_FROM_VAGRANT=true RUBBER_ENV=#{config.rubber_env} ALIAS=#{machine.name} ROLES='#{config.roles}' EXTERNAL_IP=#{private_ip} INTERNAL_IP=#{private_ip} RUBBER_SSH_KEY=#{ssh_info[:private_key_path]} bash -c 'bundle exec cap rubber:create -S initial_ssh_user=#{ssh_info[:username]}'
36
+ ENDSCRIPT
37
+ end
38
+
39
+ puts script
40
+
41
+ system(script)
42
+ end
43
+
44
+ def refresh
45
+ if config.use_vagrant_ruby
46
+ script = "RUN_FROM_VAGRANT=true RUBBER_ENV=#{config.rubber_env} RUBBER_SSH_KEY=#{ssh_info[:private_key_path]} ALIAS=#{machine.name} EXTERNAL_IP=#{private_ip} INTERNAL_IP=#{private_ip} #{internal_cap_command} rubber:refresh -S initial_ssh_user=#{ssh_info[:username]}"
47
+ else
48
+ script = <<-ENDSCRIPT
49
+ unset GEM_HOME;
50
+ unset GEM_PATH;
51
+ PATH=#{ENV['PATH'].split(':')[1..-1].join(':')} RUN_FROM_VAGRANT=true RUBBER_ENV=#{config.rubber_env} RUBBER_SSH_KEY=#{ssh_info[:private_key_path]} ALIAS=#{machine.name} EXTERNAL_IP=#{private_ip} INTERNAL_IP=#{private_ip} bash -c 'bundle exec cap rubber:refresh -S initial_ssh_user=#{ssh_info[:username]}'
52
+ ENDSCRIPT
53
+ end
34
54
 
35
55
  system(script)
36
56
  end
37
57
 
38
58
  def bootstrap
39
- script = <<-ENDSCRIPT
40
- unset GEM_HOME;
41
- unset GEM_PATH;
42
- PATH=#{ENV['PATH'].split(':')[1..-1].join(':')} RUN_FROM_VAGRANT=true RUBBER_ENV=#{config.rubber_env} RUBBER_SSH_KEY=#{ssh_info[:private_key_path]} FILTER=#{machine.name} bash -c 'bundle exec cap rubber:bootstrap'
43
- ENDSCRIPT
59
+ if config.use_vagrant_ruby
60
+ script = "RUN_FROM_VAGRANT=true RUBBER_ENV=#{config.rubber_env} RUBBER_SSH_KEY=#{ssh_info[:private_key_path]} FILTER=#{machine.name} #{internal_cap_command} rubber:bootstrap"
61
+ else
62
+ script = <<-ENDSCRIPT
63
+ unset GEM_HOME;
64
+ unset GEM_PATH;
65
+ PATH=#{ENV['PATH'].split(':')[1..-1].join(':')} RUN_FROM_VAGRANT=true RUBBER_ENV=#{config.rubber_env} RUBBER_SSH_KEY=#{ssh_info[:private_key_path]} FILTER=#{machine.name} bash -c 'bundle exec cap rubber:bootstrap'
66
+ ENDSCRIPT
67
+ end
44
68
 
45
69
  system(script)
46
70
  end
47
71
 
48
72
  def deploy_migrations
49
- script = <<-ENDSCRIPT
50
- unset GEM_HOME;
51
- unset GEM_PATH;
52
- PATH=#{ENV['PATH'].split(':')[1..-1].join(':')} RUN_FROM_VAGRANT=true RUBBER_ENV=#{config.rubber_env} RUBBER_SSH_KEY=#{ssh_info[:private_key_path]} FILTER=#{machine.name} bash -c 'bundle exec cap deploy:migrations'
53
- ENDSCRIPT
73
+ if config.use_vagrant_ruby
74
+ script = "RUN_FROM_VAGRANT=true RUBBER_ENV=#{config.rubber_env} RUBBER_SSH_KEY=#{ssh_info[:private_key_path]} FILTER=#{machine.name} #{internal_cap_command} deploy:migrations"
75
+ else
76
+ script = <<-ENDSCRIPT
77
+ unset GEM_HOME;
78
+ unset GEM_PATH;
79
+ PATH=#{ENV['PATH'].split(':')[1..-1].join(':')} RUN_FROM_VAGRANT=true RUBBER_ENV=#{config.rubber_env} RUBBER_SSH_KEY=#{ssh_info[:private_key_path]} FILTER=#{machine.name} bash -c 'bundle exec cap deploy:migrations'
80
+ ENDSCRIPT
81
+ end
54
82
 
55
83
  system(script)
56
84
  end
85
+
86
+ def internal_cap_command
87
+ "ruby -e \"require 'capistrano/cli'; Capistrano::CLI.execute\""
88
+ end
57
89
  end
58
90
  end
59
91
  end
@@ -1,3 +1,3 @@
1
1
  module Rubber
2
- VERSION = "2.5.0"
2
+ VERSION = "2.5.1"
3
3
  end
@@ -0,0 +1,63 @@
1
+ namespace :rubber do
2
+
3
+ namespace :browsermob_proxy do
4
+
5
+ rubber.allow_optional_tasks(self)
6
+
7
+ after "rubber:install_packages", "rubber:browsermob_proxy:install"
8
+
9
+ task :install, :roles => :browsermob_proxy do
10
+ rubber.sudo_script 'install_browsermob_proxy', <<-ENDSCRIPT
11
+ # Create the log directory if necessary.
12
+ if [[ ! -d #{rubber_env.browsermob_proxy_log_dir} ]]; then
13
+ mkdir -p #{rubber_env.browsermob_proxy_log_dir}
14
+ chown app:app #{rubber_env.browsermob_proxy_log_dir}
15
+ fi
16
+
17
+ if [[ ! -d #{rubber_env.browsermob_proxy_dir} ]]; then
18
+ cd /tmp
19
+ wget -q https://s3-us-west-1.amazonaws.com/lightbody-bmp/browsermob-proxy-#{rubber_env.browsermob_proxy_version}-bin.zip
20
+ unzip browsermob-proxy-#{rubber_env.browsermob_proxy_version}-bin.zip
21
+
22
+ mv browsermob-proxy-#{rubber_env.browsermob_proxy_version} #{rubber_env.browsermob_proxy_dir}
23
+ chmod +x #{rubber_env.browsermob_proxy_dir}/bin/browsermob-proxy
24
+
25
+ rm browsermob-proxy-#{rubber_env.browsermob_proxy_version}-bin.zip
26
+ fi
27
+ ENDSCRIPT
28
+ end
29
+
30
+ after "rubber:bootstrap", "rubber:browsermob_proxy:bootstrap"
31
+
32
+ task :bootstrap, :roles => :browsermob_proxy do
33
+ # After everything installed on machines, we need the source tree
34
+ # on hosts in order to run rubber:config for bootstrapping the db
35
+ rubber.update_code_for_bootstrap
36
+
37
+ # Gen just the conf for cassandra
38
+ rubber.run_config(:file => "role/browsermob_proxy", :force => true, :deploy_path => release_path)
39
+ end
40
+
41
+ after "rubber:setup_app_permissions", "rubber:browsermob_proxy:setup_permissions"
42
+
43
+ task :setup_permissions, :roles => :browsermob_proxy do
44
+ rsudo "chown -R #{rubber_env.app_user}:#{rubber_env.app_user} #{rubber_env.browsermob_proxy_dir}"
45
+ end
46
+
47
+ task :restart, :roles => :browsermob_proxy do
48
+ stop
49
+ start
50
+ end
51
+
52
+ task :stop, :roles => :browsermob_proxy, :on_error => :continue do
53
+ rsudo "cat #{rubber_env.browsermob_proxy_dir}/browsermob_proxy.pid | xargs kill; exit 0"
54
+ end
55
+
56
+ task :start, :roles => :browsermob_proxy do
57
+ rsudo "#{rubber_env.browsermob_proxy_dir}/startup.sh"
58
+ end
59
+
60
+ after "rubber:create", "rubber:setup_dns_records"
61
+ end
62
+
63
+ end
@@ -0,0 +1,8 @@
1
+ <%
2
+ @read_cmd = 'crontab -l'
3
+ @write_cmd = 'crontab -'
4
+ @additive = ["# rubber-selenium-grid-hub-start", "# rubber-selenium-grid-hub-end"]
5
+ %>
6
+
7
+ # Rotate the BrowserMob Proxy logs at 2 AM.
8
+ 0 2 * * * <%= Rubber.root %>/script/rubber cron --task util:rotate_logs --directory=<%= rubber_env.browsermob_proxy_log_dir %>
@@ -0,0 +1,15 @@
1
+ <%
2
+ @path = '/etc/monit/monit.d/monit-browsermob_proxy.conf'
3
+ %>
4
+
5
+ <%
6
+ start_program = "/bin/bash -l -c '#{rubber_env.browsermob_proxy_dir}/startup.sh'"
7
+ stop_program = "/bin/bash -l -c 'cat #{rubber_env.browsermob_proxy_dir}/browsermob_proxy.pid | xargs kill; exit 0'"
8
+ %>
9
+
10
+ check process browsermob_proxy with pidfile <%= rubber_env.browsermob_proxy_dir %>/browsermob_proxy.pid
11
+ group browsermob_proxy
12
+ start program = "<%= start_program %>"
13
+ stop program = "<%= stop_program %>"
14
+
15
+ if totalmem > <%= rubber_env.browsermob_proxy_max_heap_in_mb.to_i + rubber_env.browsermob_proxy_permgen_in_mb.to_i %>.0 MB for 5 cycles then restart
@@ -0,0 +1,21 @@
1
+ <%
2
+ @path = "#{rubber_env.browsermob_proxy_dir}/startup.sh"
3
+ @perms = 0755
4
+
5
+ proxy_server = rubber_instances.for_role("caching_proxy").first
6
+
7
+ args = []
8
+ args << '-Xms256m'
9
+ args << "-Xmx#{rubber_env.browsermob_proxy_max_heap_in_mb}m"
10
+ args << "-XX:MaxPermSize=#{rubber_env.browsermob_proxy_permgen_in_mb}m"
11
+ args << '-Djsse.enableSNIExtension=false'
12
+
13
+ if proxy_server
14
+ args << "-Dhttp.proxyHost=#{proxy_server.internal_ip}"
15
+ args << "-Dhttp.proxyPort=#{rubber_env.caching_proxy_port}"
16
+ end
17
+ %>
18
+ #!/bin/bash
19
+
20
+ ulimit -n 65536
21
+ JAVA_OPTS="<%= args.join(' ') %>" nohup <%= rubber_env.browsermob_proxy_dir %>/bin/browsermob-proxy --port <%= rubber_env.browsermob_proxy_port %> >> <%= rubber_env.browsermob_proxy_log_dir %>/browsermob_proxy.log 2>&1 & echo $! > <%= rubber_env.browsermob_proxy_dir %>/browsermob_proxy.pid
@@ -0,0 +1,10 @@
1
+ browsermob_proxy_version: 2.0-beta-8
2
+ browsermob_proxy_dir: /opt/browsermob_proxy
3
+ browsermob_proxy_log_dir: /mnt/browsermob_proxy/log
4
+ browsermob_proxy_port: 8020
5
+ browsermob_proxy_max_heap_in_mb: 768
6
+ browsermob_proxy_permgen_in_mb: 256
7
+
8
+ roles:
9
+ browsermob_proxy:
10
+ packages: [openjdk-7-jdk]
@@ -0,0 +1 @@
1
+ description: The BrowserMob Proxy HTTP proxy and traffic monitoring & manipulation system
@@ -9,7 +9,7 @@ stop on runlevel [016]
9
9
 
10
10
  script
11
11
  cd <%= rubber_env.graylog_web_dir %>
12
- exec bash -l -c "bundle exec puma -p <%= rubber_env.graylog_web_port %> <%= rubber_env.graylog_web_dir %>/config.ru"
12
+ exec bash -l -c "RAILS_ENV=production bundle exec puma -p <%= rubber_env.graylog_web_port %> <%= rubber_env.graylog_web_dir %>/config.ru"
13
13
  end script
14
14
 
15
15
  post-start script
@@ -34,7 +34,7 @@ role_dependencies:
34
34
 
35
35
  roles:
36
36
  graylog_server:
37
- packages: [openjdk-6-jdk, mongodb-10gen]
37
+ packages: [openjdk-7-jdk, mongodb-10gen]
38
38
  graylog_web:
39
39
  packages: [libcurl4-openssl-dev]
40
40
  gems: [puma]
@@ -2,4 +2,3 @@ description: The graylog log aggregation and search module
2
2
  dependent_templates:
3
3
  - mongodb
4
4
  - elasticsearch
5
-
@@ -7,4 +7,4 @@ jetty_jvm_options: -XX:MaxPermSize=128m
7
7
 
8
8
  roles:
9
9
  jetty:
10
- packages: [openjdk-6-jdk]
10
+ packages: [openjdk-7-jdk]
@@ -46,7 +46,7 @@ namespace :rubber do
46
46
  # on hosts in order to run rubber:config for bootstrapping the db
47
47
  rubber.update_code_for_bootstrap
48
48
 
49
- # Gen just the conf for cassandra
49
+ # Gen just the conf for redis.
50
50
  rubber.run_config(:file => "role/redis/", :force => true, :deploy_path => release_path)
51
51
 
52
52
  restart
@@ -0,0 +1,66 @@
1
+ namespace :rubber do
2
+
3
+ namespace :selenium_grid do
4
+
5
+ rubber.allow_optional_tasks(self)
6
+
7
+ namespace :hub do
8
+ rubber.allow_optional_tasks(self)
9
+
10
+ after "rubber:install_packages", "rubber:selenium_grid:hub:install"
11
+
12
+ task :install, :roles => :selenium_grid_hub do
13
+ rubber.sudo_script 'install_selenium_grid_hub', <<-ENDSCRIPT
14
+ # Create the log directory if necessary.
15
+ if [[ ! -d #{rubber_env.selenium_grid_hub_log_dir} ]]; then
16
+ mkdir -p #{rubber_env.selenium_grid_hub_log_dir}
17
+ chown app:app #{rubber_env.selenium_grid_hub_log_dir}
18
+ fi
19
+
20
+ if [[ ! -d #{rubber_env.selenium_grid_hub_dir} ]]; then
21
+ mkdir -p #{rubber_env.selenium_grid_hub_dir}
22
+ chown app:app #{rubber_env.selenium_grid_hub_dir}
23
+ fi
24
+
25
+ # Fetch the Selenium Grid 2 JARs.
26
+ wget -q https://selenium.googlecode.com/files/selenium-server-standalone-#{rubber_env.selenium_grid_hub_version}.jar -O #{rubber_env.selenium_grid_hub_dir}/selenium-server-standalone-#{rubber_env.selenium_grid_hub_version}.jar
27
+
28
+ # Fetch the Graylog2 logging JARs.
29
+ wget -q http://files-staging.mogotest.com.s3.amazonaws.com/gelfj-1.0.jar -O #{rubber_env.selenium_grid_hub_dir}/gelfj.jar
30
+ wget -q http://files-staging.mogotest.com.s3.amazonaws.com/json-simple-1.1.jar -O #{rubber_env.selenium_grid_hub_dir}/json-simple.jar
31
+ ENDSCRIPT
32
+ end
33
+
34
+ after "rubber:bootstrap", "rubber:selenium_grid:hub:bootstrap"
35
+
36
+ task :bootstrap, :roles => :selenium_grid_hub do
37
+ # After everything installed on machines, we need the source tree
38
+ # on hosts in order to run rubber:config for bootstrapping the db
39
+ rubber.update_code_for_bootstrap
40
+
41
+ # Gen just the conf for cassandra
42
+ rubber.run_config(:file => "role/selenium_grid_hub", :force => true, :deploy_path => release_path)
43
+ end
44
+
45
+ after "rubber:setup_app_permissions", "rubber:selenium_grid:hub:setup_permissions"
46
+
47
+ task :setup_permissions, :roles => :selenium_grid_hub do
48
+ rsudo "chown -R #{rubber_env.app_user}:#{rubber_env.app_user} #{rubber_env.selenium_grid_hub_dir}"
49
+ end
50
+
51
+ task :restart, :roles => :selenium_grid_hub do
52
+ stop
53
+ start
54
+ end
55
+
56
+ task :stop, :roles => :selenium_grid_hub, :on_error => :continue do
57
+ rsudo "cat #{rubber_env.selenium_grid_hub_dir}/hub.pid | xargs kill; exit 0"
58
+ end
59
+
60
+ task :start, :roles => :selenium_grid_hub do
61
+ rsudo "#{rubber_env.selenium_grid_hub_dir}/startup.sh"
62
+ end
63
+ end
64
+
65
+ end
66
+ end
@@ -0,0 +1,8 @@
1
+ <%
2
+ @read_cmd = 'crontab -l'
3
+ @write_cmd = 'crontab -'
4
+ @additive = ["# rubber-selenium-grid-hub-start", "# rubber-selenium-grid-hub-end"]
5
+ %>
6
+
7
+ # Rotate the Selenium Grid hub logs at 1 AM.
8
+ 0 1 * * * <%= Rubber.root %>/script/rubber cron --task util:rotate_logs --directory=<%= rubber_env.selenium_grid_hub_log_dir %>
@@ -0,0 +1,15 @@
1
+ <%
2
+ @path = "#{rubber_env.selenium_grid_hub_dir}/logging.properties"
3
+ graylog_server = rubber_instances.for_role("graylog_server").first
4
+ %>
5
+ handlers = org.graylog2.logging.GelfHandler
6
+
7
+ .level = ALL
8
+
9
+ <% if graylog_server %>
10
+ org.graylog2.logging.GelfHandler.graylogHost = <%= graylog_server.full_name %>
11
+ org.graylog2.logging.GelfHandler.graylogPort = <%= rubber_env.graylog_server_port %>
12
+ org.graylog2.logging.GelfHandler.originHost = <%= rubber_env.host %>
13
+ org.graylog2.logging.GelfHandler.extractStacktrace = true
14
+ org.graylog2.logging.GelfHandler.facility = selenium
15
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <%
2
+ @path = '/etc/monit/monit.d/monit-selenium_grid_hub.conf'
3
+ %>
4
+
5
+ <%
6
+ start_program = "/bin/bash -l -c '#{rubber_env.selenium_grid_hub_dir}/startup.sh'"
7
+ stop_program = "/bin/bash -l -c 'cat #{rubber_env.selenium_grid_hub_dir}/hub.pid | xargs kill; exit 0'"
8
+ %>
9
+
10
+ check process selenium_grid_hub with pidfile <%= rubber_env.selenium_grid_hub_dir %>/hub.pid
11
+ group selenium_grid_hub
12
+ start program = "<%= start_program %>"
13
+ stop program = "<%= stop_program %>"
14
+
15
+ if totalmem > <%= rubber_env.selenium_grid_hub_max_heap_in_mb.to_i + rubber_env.selenium_grid_hub_permgen_in_mb.to_i %>.0 MB for 5 cycles then restart
@@ -0,0 +1,23 @@
1
+ <%
2
+ @path = "#{rubber_env.selenium_grid_hub_dir}/startup.sh"
3
+ @perms = 0755
4
+
5
+ args = []
6
+ args << '-Xms256m'
7
+ args << "-Xmx#{rubber_env.selenium_grid_hub_max_heap_in_mb}m"
8
+ args << '-XX:MaxPermSize=#{rubber_env.selenium_grid_hub_permgen_in_mb}m'
9
+ args << '-server'
10
+ args << '-Xdebug'
11
+ args << '-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005'
12
+ args << "-cp #{rubber_env.selenium_grid_hub_dir}/selenium-server-standalone-#{rubber_env.selenium_grid_hub_version}.jar:#{rubber_env.selenium_grid_hub_dir}/json-simple.jar:#{rubber_env.selenium_grid_hub_dir}/gelfj.jar"
13
+ args << "-Djava.util.logging.config.file=#{rubber_env.selenium_grid_hub_dir}/logging.properties"
14
+ args << "org.openqa.grid.selenium.GridLauncher"
15
+ args << "-role hub"
16
+ args << "-throwOnCapabilityNotPresent false"
17
+ args << "-browserTimeout 60"
18
+ args << "-log #{rubber_env.selenium_grid_hub_log_dir}/hub.log"
19
+ %>
20
+ #!/bin/bash
21
+
22
+ ulimit -n 65536
23
+ nohup java <%= args.join(' ') %> >> <%= rubber_env.selenium_grid_hub_log_dir %>/hub.log 2>&1 & echo $! > <%= rubber_env.selenium_grid_hub_dir %>/hub.pid
@@ -0,0 +1,15 @@
1
+ selenium_grid_hub_version: 2.33.0
2
+ selenium_grid_hub_log_dir: /mnt/selenium_grid_hub/log
3
+ selenium_grid_hub_dir: /opt/selenium_grid_hub
4
+ selenium_grid_hub_max_heap_in_mb: 768
5
+ selenium_grid_hub_permgen_in_mb: 256
6
+
7
+ roles:
8
+ selenium_grid_hub:
9
+ packages: [openjdk-7-jdk]
10
+
11
+ web_tools_proxies:
12
+ hub:
13
+ role: selenium_grid_hub
14
+ port: 4444
15
+ path: /
@@ -0,0 +1 @@
1
+ description: The Selenium Grid hub for the Selenium browser automation system
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.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Conway
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-03 00:00:00.000000000 Z
12
+ date: 2013-06-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -247,6 +247,7 @@ files:
247
247
  - lib/rubber/tag.rb
248
248
  - lib/rubber/thread_safe_proxy.rb
249
249
  - lib/rubber/util.rb
250
+ - lib/rubber/vagrant/command.rb
250
251
  - lib/rubber/vagrant/config.rb
251
252
  - lib/rubber/vagrant/plugin.rb
252
253
  - lib/rubber/vagrant/provisioner.rb
@@ -282,6 +283,12 @@ files:
282
283
  - templates/base/script/rubber
283
284
  - templates/base/templates.rb
284
285
  - templates/base/templates.yml
286
+ - templates/browsermob_proxy/config/rubber/deploy-browsermob_proxy.rb
287
+ - templates/browsermob_proxy/config/rubber/role/browsermob_proxy/crontab
288
+ - templates/browsermob_proxy/config/rubber/role/browsermob_proxy/monit-browsermob_proxy.conf
289
+ - templates/browsermob_proxy/config/rubber/role/browsermob_proxy/startup.sh
290
+ - templates/browsermob_proxy/config/rubber/rubber-browsermob_proxy.yml
291
+ - templates/browsermob_proxy/templates.yml
285
292
  - templates/cassandra/config/rubber/deploy-cassandra.rb
286
293
  - templates/cassandra/config/rubber/role/cassandra/0-collectd-rsyslog-filter.conf
287
294
  - templates/cassandra/config/rubber/role/cassandra/cassandra.in.sh
@@ -563,6 +570,13 @@ files:
563
570
  - templates/resque_scheduler/lib/tasks/resque-scheduler.rake
564
571
  - templates/resque_scheduler/templates.rb
565
572
  - templates/resque_scheduler/templates.yml
573
+ - templates/selenium_grid_hub/config/rubber/deploy-selenium-grid-hub.rb
574
+ - templates/selenium_grid_hub/config/rubber/role/selenium_grid_hub/crontab
575
+ - templates/selenium_grid_hub/config/rubber/role/selenium_grid_hub/logging.properties.conf
576
+ - templates/selenium_grid_hub/config/rubber/role/selenium_grid_hub/monit-selenium_grid_hub.conf
577
+ - templates/selenium_grid_hub/config/rubber/role/selenium_grid_hub/startup.sh
578
+ - templates/selenium_grid_hub/config/rubber/rubber-selenium-grid-hub.yml
579
+ - templates/selenium_grid_hub/templates.yml
566
580
  - templates/sidekiq/config/rubber/deploy-sidekiq.rb
567
581
  - templates/sidekiq/config/rubber/role/sidekiq/monit-sidekiq.conf
568
582
  - templates/sidekiq/config/rubber/rubber-sidekiq.yml