rhoconnect 3.0.6 → 3.1.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/CHANGELOG.md +9 -0
  2. data/Gemfile +3 -3
  3. data/Gemfile.lock +38 -17
  4. data/Rakefile +0 -10
  5. data/bench/benchapp/Gemfile.lock +1 -0
  6. data/bench/distr_bench/distr_bench_main +94 -27
  7. data/bench/distr_bench/run_test_query_script.sh +22 -18
  8. data/bench/lib/bench/aws_utils.rb +326 -0
  9. data/bench/lib/bench/bench_result_processor.rb +268 -75
  10. data/bench/lib/bench/cli.rb +1 -0
  11. data/bench/lib/bench/distr_runner.rb +102 -0
  12. data/bench/lib/bench/utils.rb +127 -0
  13. data/bench/lib/bench.rb +16 -15
  14. data/bench/prepare_bench +3 -11
  15. data/bench/scripts/test_query_script.rb +6 -7
  16. data/bin/rhoconnect-benchmark +257 -5
  17. data/doc/benchmarks-running.txt +140 -0
  18. data/doc/client-java.txt +236 -0
  19. data/doc/client-objc.txt +41 -1
  20. data/doc/client.txt +12 -0
  21. data/doc/command-line.txt +12 -3
  22. data/doc/cud-conflicts.txt +68 -0
  23. data/doc/deploying.txt +1 -70
  24. data/doc/hosting-rhohub.txt +3 -0
  25. data/doc/install.txt +50 -13
  26. data/doc/java-plugin.txt +217 -177
  27. data/doc/net-plugin.txt +97 -64
  28. data/doc/plugin-intro.txt +4 -2
  29. data/doc/preparing-production.txt +63 -0
  30. data/doc/rhoconnect-redis-stack.txt +252 -0
  31. data/doc/source-adapters.txt +3 -1
  32. data/doc/tutorial.txt +111 -49
  33. data/examples/simple/dump.rdb +0 -0
  34. data/installer/unix-like/rho_connect_install_constants.rb +6 -5
  35. data/installer/unix-like/rho_connect_install_installers.rb +6 -2
  36. data/installer/utils/nix_install_test.rb +2 -0
  37. data/installer/utils/package_upload/auto-repo.rb +136 -0
  38. data/installer/utils/package_upload/repos.rake +6 -3
  39. data/installer/utils/package_upload/s3_upload.rb +11 -6
  40. data/installer/windows/rhosync.nsi +5 -5
  41. data/lib/rhoconnect/client_sync.rb +2 -2
  42. data/lib/rhoconnect/document.rb +12 -0
  43. data/lib/rhoconnect/jobs/source_job.rb +2 -2
  44. data/lib/rhoconnect/predefined_adapters/bench_adapter.rb +61 -0
  45. data/lib/rhoconnect/source.rb +5 -0
  46. data/lib/rhoconnect/source_adapter.rb +10 -1
  47. data/lib/rhoconnect/source_sync.rb +161 -88
  48. data/lib/rhoconnect/store.rb +48 -0
  49. data/lib/rhoconnect/test_methods.rb +6 -6
  50. data/lib/rhoconnect/version.rb +1 -1
  51. data/lib/rhoconnect.rb +25 -2
  52. data/spec/apps/rhotestapp/sources/sample_adapter.rb +29 -0
  53. data/spec/jobs/source_job_spec.rb +5 -5
  54. data/spec/source_adapter_spec.rb +10 -0
  55. data/spec/source_sync_spec.rb +114 -33
  56. data/spec/spec_helper.rb +21 -2
  57. data/spec/store_spec.rb +29 -0
  58. data/spec/support/shared_examples.rb +1 -1
  59. data/spec/test_methods_spec.rb +4 -4
  60. data/tasks/redis.rake +2 -2
  61. metadata +59 -59
  62. data/bench/benchapp/log/passenger.3000.log +0 -1
  63. data/bench/benchapp/log/passenger.9292.log +0 -59
  64. data/bench/benchapp/tmp/pids/passenger.3000.pid.lock +0 -0
  65. data/bench/benchapp/tmp/pids/passenger.9292.pid.lock +0 -0
  66. data/bench/lib/testdata/0-data.txt +0 -0
  67. data/bench/lib/testdata/1-data.txt +0 -0
  68. data/bench/lib/testdata/10-data.txt +0 -15
  69. data/bench/lib/testdata/2-data.txt +0 -3
  70. data/bench/lib/testdata/25-data.txt +0 -39
  71. data/bench/lib/testdata/250-data.txt +0 -353
  72. data/bench/lib/testdata/3-data.txt +0 -4
  73. data/bench/lib/testdata/50-data.txt +0 -70
  74. data/bench/lib/testdata/500-data.txt +0 -711
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 3.1.0.beta1 (2011-12-31)
2
+ * #20396499 - saving rhoconnect-benchmark results into the file
3
+ * #21630639 - rhoconnect-benchmark post-processing (GRUFF png images and EXCEL spreadsheets generation)
4
+ * #21363347 - rhoconnect-benchmark - support for varying the number of concurrent clients and payload, distributed AWS clients
5
+ * #20151369 - rhoconnect-benchmark command
6
+ * #21187827 - support for built-in internal adapters
7
+ * #22208995 - AWS Cloud Formation deployment guidelines docs
8
+ * #22209097 - Conflict Resolution framework for simultaneous CUD operations
9
+
1
10
  ## 3.0.6 (2011-11-15)
2
11
  * #20022889 - support for GET/POST /api/application routes
3
12
  * #20609683 - support 'append' parameter in 'set_db_doc' REST API
data/Gemfile CHANGED
@@ -11,15 +11,15 @@ platforms :jruby do
11
11
  gem 'warbler'
12
12
  end
13
13
 
14
- gem 'sqlite3', ">= 1.3.3", :platforms => [:ruby, :mswin, :mingw]
15
-
16
14
  group :development do
17
15
  gem 'aws-s3', '>= 0.6.2', :require => 'aws/s3'
16
+ gem 'sqlite3', ">= 1.3.3", :platforms => [:ruby, :mswin, :mingw]
18
17
  gem 'fpm', '>= 0.3.8'
19
- gem 'fog', '>= 1.0.0'
18
+ gem 'fog'
20
19
  gem 'ffaker', '~> 1.8.0'
21
20
  gem 'thor', '>= 0.13.6'
22
21
  gem 'webmock', '~> 1.6.4'
22
+ gem 'SystemTimer', '~> 1.2.3', :platforms => :ruby_18
23
23
  end
24
24
 
25
25
  group :test do
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rhoconnect (3.0.6)
4
+ rhoconnect (3.1.0.beta1)
5
5
  bundler (~> 1.0)
6
6
  json (~> 1.5.0)
7
7
  rake (~> 0.9.2)
@@ -16,45 +16,59 @@ PATH
16
16
  GEM
17
17
  remote: http://rubygems.org/
18
18
  specs:
19
+ SystemTimer (1.2.3)
19
20
  addressable (2.2.6)
20
21
  aws-s3 (0.6.2)
21
22
  builder
22
23
  mime-types
23
24
  xml-simple
25
+ bouncy-castle-java (1.5.0146.1)
24
26
  builder (3.0.0)
25
27
  crack (0.3.1)
28
+ dbd-jdbc (0.1.4)
29
+ dbi (0.4.5)
30
+ deprecated (= 2.0.1)
31
+ deprecated (2.0.1)
26
32
  diff-lcs (1.1.3)
27
- excon (0.7.6)
33
+ excon (0.7.12)
28
34
  extlib (0.9.15)
29
35
  ffaker (1.8.1)
30
- fog (1.0.0)
36
+ fog (1.1.1)
31
37
  builder
32
- excon (~> 0.7.3)
38
+ excon (~> 0.7.4)
33
39
  formatador (~> 0.2.0)
34
40
  mime-types
35
41
  multi_json (~> 1.0.3)
36
42
  net-scp (~> 1.0.4)
37
- net-ssh (~> 2.1.4)
43
+ net-ssh (>= 2.1.3)
38
44
  nokogiri (~> 1.5.0)
39
45
  ruby-hmac
40
46
  formatador (0.2.1)
41
- fpm (0.3.10)
47
+ fpm (0.3.11)
42
48
  json
43
- highline (1.6.2)
49
+ highline (1.6.8)
50
+ jdbc-sqlite3 (3.7.2)
51
+ jruby-jars (1.6.5)
52
+ jruby-openssl (0.7.4)
53
+ bouncy-castle-java
54
+ jruby-rack (1.1.1)
44
55
  json (1.5.4)
45
- mime-types (1.17.1)
46
- multi_json (1.0.3)
56
+ json (1.5.4-java)
57
+ mime-types (1.17.2)
58
+ multi_json (1.0.4)
47
59
  net-scp (1.0.4)
48
60
  net-ssh (>= 1.99.1)
49
- net-ssh (2.1.4)
61
+ net-ssh (2.2.1)
50
62
  nokogiri (1.5.0)
63
+ nokogiri (1.5.0-java)
51
64
  rack (1.3.5)
52
65
  rack-protection (1.1.4)
53
66
  rack
54
67
  rack-test (0.6.1)
55
68
  rack (>= 1.0)
56
- rake (0.9.2)
69
+ rake (0.9.2.2)
57
70
  rcov (0.9.11)
71
+ rcov (0.9.11-java)
58
72
  redis (2.2.2)
59
73
  redis-namespace (1.0.3)
60
74
  redis (< 3.0.0)
@@ -74,12 +88,12 @@ GEM
74
88
  diff-lcs (~> 1.1.2)
75
89
  rspec-mocks (2.6.0)
76
90
  ruby-hmac (0.4.0)
77
- rubyzip (0.9.4)
91
+ rubyzip (0.9.5)
78
92
  sinatra (1.3.1)
79
- rack (>= 1.3.4, ~> 1.3)
80
- rack-protection (>= 1.1.2, ~> 1.1)
81
- tilt (>= 1.3.3, ~> 1.3)
82
- sqlite3 (1.3.4)
93
+ rack (~> 1.3, >= 1.3.4)
94
+ rack-protection (~> 1.1, >= 1.1.2)
95
+ tilt (~> 1.3, >= 1.3.3)
96
+ sqlite3 (1.3.5)
83
97
  templater (1.0.0)
84
98
  diff-lcs (>= 1.1.2)
85
99
  extlib (>= 0.9.5)
@@ -89,20 +103,27 @@ GEM
89
103
  uuidtools (2.1.2)
90
104
  vegas (0.1.8)
91
105
  rack (>= 1.0.0)
106
+ warbler (1.3.2)
107
+ jruby-jars (>= 1.4.0)
108
+ jruby-rack (>= 1.0.0)
109
+ rake (>= 0.8.7)
110
+ rubyzip (>= 0.9.4)
92
111
  webmock (1.6.4)
93
112
  addressable (~> 2.2, > 2.2.5)
94
113
  crack (>= 0.1.7)
95
114
  xml-simple (1.1.1)
96
115
 
97
116
  PLATFORMS
117
+ java
98
118
  ruby
99
119
 
100
120
  DEPENDENCIES
121
+ SystemTimer (~> 1.2.3)
101
122
  aws-s3 (>= 0.6.2)
102
123
  dbd-jdbc (>= 0.1.4)
103
124
  dbi (>= 0.4.5)
104
125
  ffaker (~> 1.8.0)
105
- fog (>= 1.0.0)
126
+ fog
106
127
  fpm (>= 0.3.8)
107
128
  jdbc-sqlite3 (>= 3.7.2)
108
129
  jruby-openssl (>= 0.7.4)
data/Rakefile CHANGED
@@ -155,11 +155,6 @@ task "build:deb" => :build do
155
155
  build_pkg "deb", "all", DEB_DEPS
156
156
  end
157
157
 
158
- desc "Build Debian DEB rhoconnect-#{Rhoconnect::VERSION}_all.deb package into the pkg directory"
159
- task "build:bench:deb" => :build do
160
- build_pkg "deb", "all", DEB_DEPS, true
161
- end
162
-
163
158
  RPM_DEPS = [
164
159
  "wget >= 1.0", "make >= 3.0", "patch >= 2.0",
165
160
  "gcc-c++ >= 4.1.2",
@@ -174,8 +169,3 @@ desc "Build Red Hat RPM rhoconnect-#{Rhoconnect::VERSION}.noarch.rpm package int
174
169
  task "build:rpm" => :build do
175
170
  build_pkg "rpm", "noarch", RPM_DEPS
176
171
  end
177
-
178
- desc "Build Red Hat RPM benchmark rhoconnect-#{Rhoconnect::VERSION}.noarch.rpm package into the pkg directory"
179
- task "build:bench:rpm" => :build do
180
- build_pkg "rpm", "noarch", RPM_DEPS, true
181
- end
@@ -18,6 +18,7 @@ GEM
18
18
  bouncy-castle-java
19
19
  jruby-rack (1.0.10)
20
20
  json (1.5.4)
21
+ json (1.5.4-java)
21
22
  mime-types (1.17.2)
22
23
  multi_json (1.0.3)
23
24
  rack (1.3.5)
@@ -2,7 +2,9 @@
2
2
 
3
3
  require 'rubygems'
4
4
  $LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__),'..','lib'))
5
+ require 'net/ssh/multi'
5
6
  require 'bench'
7
+ require 'bench/aws_utils'
6
8
 
7
9
  def process_results
8
10
  finished_data = Bench.get_server_state("bench_statistics_data")
@@ -56,33 +58,97 @@ if server != 'default'
56
58
  Bench.base_url = server
57
59
  end
58
60
 
59
- # 5) Set up the server
60
- Bench.admin_login = 'rhoadmin'
61
- Bench.admin_password = ''
62
- Bench.get_test_server
63
- Bench.reset_app
64
- Bench.user_name = "benchuser"
65
- Bench.password = "password"
66
- Bench.set_server_state("test_db_storage:application:#{Bench.user_name}",@expected)
67
- Bench.reset_refresh_time('MockAdapter')
68
-
69
- #6) set the sync key
70
- @start_time = Time.now + 5.0
71
- Bench.set_server_state(sync_key, @start_time.to_f.to_s)
72
- puts "Sync Key #{sync_key} is set to #{@start_time} - Please, start the clients now!!!"
73
-
74
- #7) wait until all distributed clients are finished
75
- while true
76
- sleep(1)
77
- stats_data = Bench.get_server_state("bench_statistics_data")
78
- if (not stats_data.nil?) and stats_data.size == Bench.concurrency
79
- break
80
- end
81
- puts " Waiting for the clients to finish : #{Bench.concurrency - stats_data.size} out of #{Bench.concurrency}"
61
+ # 5) Create server EC2 instance
62
+ @fog = make_fog
63
+ server_stack = Constants::CENTOS_STACK
64
+ server_stack[:flavor_id] = 'm1.large'
65
+
66
+ puts "\n" +
67
+ "================================================\n" +
68
+ " Creating Benchmark Server \n" +
69
+ "================================================\n" +
70
+ "\n\n"
71
+
72
+ @server = create_ec2_instance(@fog, server_stack)
73
+ if @server.nil?
74
+ puts " Can not create Benchmark Server - Exiting..."
75
+ exit 7
76
+ end
77
+
78
+ @server_dist = compile_stack_info('centos')
79
+
80
+ # Establish connections
81
+ @server_ssh = establish_ssh_connection(@server.dns_name, @server_dist[:remote_user])
82
+ @server_dist[:remote_home] = @server_ssh.run("echo ~")[0].stdout.strip
83
+
84
+ install_package(@server_dist, @server_ssh)
85
+
86
+ start_servers(@server_ssh)
87
+
88
+ success = check_rc_service(@server.dns_name)
89
+
90
+ puts " success is #{success}"
91
+
92
+ if not success
93
+ exit 10
82
94
  end
83
95
 
84
- # 8) Now, save all data to the disk
96
+ destroy_ec2_instance(@server)
97
+ exit 1
98
+
99
+ # 5) Set up the server
85
100
  begin
101
+ Bench.admin_login = 'rhoadmin'
102
+ Bench.admin_password = ''
103
+ Bench.get_test_server
104
+ Bench.reset_app
105
+ Bench.user_name = "benchuser"
106
+ Bench.password = "password"
107
+ Bench.set_server_state("test_db_storage:application:#{Bench.user_name}",@expected)
108
+ Bench.reset_refresh_time('MockAdapter')
109
+
110
+ #6) set the sync key
111
+ @start_time = Time.now + 5.0
112
+ server_key = "#{sync_key}_#{Bench.datasize}"
113
+ Bench.set_server_state(server_key, @start_time.to_f.to_s)
114
+ puts "Sync Key #{server_key} is set to #{@start_time} - waiting for clients now!!!"
115
+
116
+ #7) Start-up all clients
117
+ n_iterations = 50
118
+ command="cd /opt/rhoconnect/bench/distr_bench; ./run_distr_client.sh #{sync_key} #{server} #{n_iterations} #{Bench.datasize} 1>/dev/null"
119
+
120
+ clients = ['ec2-107-20-56-25.compute-1.amazonaws.com',
121
+ 'ec2-107-20-56-25.compute-1.amazonaws.com',
122
+ 'ec2-67-202-35-54.compute-1.amazonaws.com',
123
+ 'ec2-50-17-104-6.compute-1.amazonaws.com',
124
+ 'ec2-204-236-222-92.compute-1.amazonaws.com',
125
+ 'ec2-50-17-92-146.compute-1.amazonaws.com',
126
+ 'ec2-107-22-124-158.compute-1.amazonaws.com',
127
+ 'ec2-184-72-165-204.compute-1.amazonaws.com',
128
+ 'ec2-107-20-41-32.compute-1.amazonaws.com',
129
+ 'ec2-107-22-35-238.compute-1.amazonaws.com',
130
+ 'ec2-50-16-180-250.compute-1.amazonaws.com']
131
+
132
+ sess_options = {:keys => ['/tmp/EC2-inst.pem']}
133
+ Net::SSH::Multi.start({:default_user => 'ec2-user'}) do |session|
134
+ # define the servers we want to use
135
+ session.use(sess_options) { clients[0..Bench.concurrency] }
136
+
137
+ # execute commands on all servers
138
+ session.exec command
139
+ end
140
+
141
+ #8) wait until all distributed clients are finished
142
+ while true
143
+ sleep(1)
144
+ stats_data = Bench.get_server_state("bench_statistics_data")
145
+ if (not stats_data.nil?) and stats_data.size == Bench.concurrency
146
+ break
147
+ end
148
+ puts " Waiting for the clients to finish : #{Bench.concurrency - stats_data.size} out of #{Bench.concurrency}"
149
+ end
150
+
151
+ # 9) Now, save all data to the disk
86
152
  sleep(1)
87
153
  @total_count = 0
88
154
  @start_time = 0.0
@@ -91,9 +157,10 @@ begin
91
157
  @times_count = 0
92
158
  process_results
93
159
  save_results
160
+
161
+ #10) Clean-up the db
162
+ Bench.reset_app
94
163
  rescue Exception => e
164
+ puts "Distributed Bench Run-time ERROR!!!"
95
165
  puts e
96
166
  end
97
-
98
- #8) Clean-up the db
99
- Bench.reset_app
@@ -11,18 +11,20 @@ if [ $# -gt 1 ] ; then
11
11
  server=$2
12
12
  fi
13
13
 
14
- clients[0]=ec2-50-17-151-136.compute-1.amazonaws.com
15
- clients[1]=ec2-107-22-43-25.compute-1.amazonaws.com
16
- clients[2]=ec2-75-101-174-0.compute-1.amazonaws.com
17
- clients[3]=ec2-50-16-87-55.compute-1.amazonaws.com
18
- clients[4]=ec2-107-22-48-222.compute-1.amazonaws.com
19
- clients[5]=ec2-107-22-61-93.compute-1.amazonaws.com
20
- clients[6]=ec2-107-22-53-145.compute-1.amazonaws.com
21
- clients[7]=ec2-50-17-152-123.compute-1.amazonaws.com
22
- clients[8]=ec2-50-17-155-181.compute-1.amazonaws.com
23
- clients[9]=ec2-75-101-225-80.compute-1.amazonaws.com
24
-
25
- n_iterations=100
14
+
15
+
16
+ clients[0]=ec2-107-20-56-25.compute-1.amazonaws.com
17
+ clients[1]=ec2-67-202-35-54.compute-1.amazonaws.com
18
+ clients[2]=ec2-50-17-104-6.compute-1.amazonaws.com
19
+ clients[3]=ec2-204-236-222-92.compute-1.amazonaws.com
20
+ clients[4]=ec2-50-17-92-146.compute-1.amazonaws.com
21
+ clients[5]=ec2-107-22-124-158.compute-1.amazonaws.com
22
+ clients[6]=ec2-184-72-165-204.compute-1.amazonaws.com
23
+ clients[7]=ec2-107-20-41-32.compute-1.amazonaws.com
24
+ clients[8]=ec2-107-22-35-238.compute-1.amazonaws.com
25
+ clients[9]=ec2-50-16-180-250.compute-1.amazonaws.com
26
+
27
+ n_iterations=25
26
28
  current_path=`pwd`
27
29
 
28
30
  # setup the benchmark directory structure
@@ -35,14 +37,16 @@ do
35
37
  do
36
38
  result_filename=./bench_results/query_bench_$timestamp_postfix/raw_data/query_bench_result.$payload
37
39
  sync_key=sync_${timestamp_postfix}
38
- for (( i = 0 ; i < $n_clients; i++ ))
39
- do
40
- ssh -i /tmp/EC2-inst.pem -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" ec2-user@${clients[$i]} "cd /opt/rhoconnect/bench/distr_bench; ./run_distr_client.sh $sync_key $server $n_iterations $payload 1>/dev/null" &
41
- done
40
+ # for (( i = 0 ; i < $n_clients; i++ ))
41
+ # do
42
+ # ssh -i /tmp/EC2-inst.pem -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" ec2-user@${clients[$i]} "cd /opt/rhoconnect/bench/distr_bench; ./run_distr_client.sh $sync_key $server $n_iterations $payload 1>/dev/null" &
43
+ # started_pid=$!
44
+ # echo $started_pid
45
+ # done
42
46
 
43
47
  # start main script
44
- ruby distr_bench_main ${sync_key}_$payload $payload $n_clients $result_filename $server
45
- sleep 5
48
+ ruby distr_bench_main $sync_key $payload $n_clients $result_filename $server
49
+ sleep 10
46
50
  done
47
51
  done
48
52