Browse Source

update servers (and rails) and move them into a logical group + update ar-jdbc

... and use a single database.yml for MRI/JRuby + explicitly declare drivers

very necessary esp. since 1.2 was not 100% rails 3.2 compatible 
and AR-JDBC 1.3.x is compatible with latest rails (4.x) as well
kares 11 years ago
parent
commit
fc12b01bcf

+ 7 - 5
rails-stripped/Gemfile-jruby

@@ -1,7 +1,9 @@
 source 'https://rubygems.org'
 
-gem 'rails', '3.2.13'
-gem 'torqbox', '0.1.7'
-gem 'activerecord-jdbcmysql-adapter', '1.2.6'
-gem "rubyzip", "~> 1.0.0"
-gem "zip-zip", "~> 0.1"
+gem 'rails', '3.2.18'
+gem 'activerecord-jdbc-adapter', '~> 1.3.7'
+gem 'jdbc-mysql', '5.1.30'
+
+group :server do
+  gem 'torqbox', '0.1.7', :require => false
+end

+ 7 - 4
rails-stripped/Gemfile-ruby

@@ -1,6 +1,9 @@
 source 'https://rubygems.org'
 
-gem 'rails', '3.2.13'
-gem 'mysql2', '0.3.11'
-gem 'passenger', '4.0.19'
-gem "unicorn", "4.6.2"
+gem 'rails', '3.2.18'
+gem 'mysql2', '0.3.16'
+
+group :server do
+  gem 'passenger', '4.0.44', :require => false
+  gem 'unicorn', '4.8.3', :require => false
+end

+ 0 - 31
rails-stripped/config/database-jruby.yml

@@ -1,31 +0,0 @@
-# SQLite version 3.x
-#   gem install sqlite3
-#
-#   Ensure the SQLite 3 gem is defined in your Gemfile
-#   gem 'sqlite3'
-development:
-  adapter: jdbcmysql 
-  database: hello_world
-  username: benchmarkdbuser
-  password: benchmarkdbpass
-  host: localhost
-  pool: 5
-  timeout: 5000
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-
-#production:
-#  adapter: jdbc
-#  jndi: java:comp/env/jdbc/hello_world
-#  pool: 256
-
-production:
-  adapter: jdbcmysql 
-  database: hello_world
-  username: benchmarkdbuser
-  password: benchmarkdbpass
-  host: localhost
-  pool: 256
-  timeout: 5000

+ 0 - 22
rails-stripped/config/database-ruby.yml

@@ -1,22 +0,0 @@
-# SQLite version 3.x
-#   gem install sqlite3
-#
-#   Ensure the SQLite 3 gem is defined in your Gemfile
-#   gem 'sqlite3'
-development:
-  adapter: mysql2
-  database: hello_world
-  username: benchmarkdbuser
-  password: benchmarkdbpass
-  host: localhost
-  pool: 5
-  timeout: 5000
-
-production:
-  adapter: mysql2
-  database: hello_world
-  username: benchmarkdbuser
-  password: benchmarkdbpass
-  host: loclahost
-  pool: 200
-  timeout: 5000

+ 5 - 18
rails-stripped/config/database.yml

@@ -1,31 +1,18 @@
-# SQLite version 3.x
-#   gem install sqlite3
-#
-#   Ensure the SQLite 3 gem is defined in your Gemfile
-#   gem 'sqlite3'
+
 development:
-  adapter: jdbcmysql 
+  adapter: mysql2
   database: hello_world
   username: benchmarkdbuser
   password: benchmarkdbpass
-  host: 172.16.98.98
+  host: localhost
   pool: 5
   timeout: 5000
 
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-
-#production:
-#  adapter: jdbc
-#  jndi: java:comp/env/jdbc/hello_world
-#  pool: 256
-
 production:
-  adapter: jdbcmysql 
+  adapter: mysql2
   database: hello_world
   username: benchmarkdbuser
   password: benchmarkdbpass
-  host: 172.16.98.98
+  host: localhost
   pool: 256
   timeout: 5000

+ 1 - 2
rails-stripped/setup_jruby.py

@@ -5,13 +5,12 @@ import os
 import setup_util
 
 def start(args, logfile, errfile):
-  setup_util.replace_text("rails-stripped/config/database-jruby.yml", "host: .*", "host: " + args.database_host)
+  setup_util.replace_text("rails-stripped/config/database.yml", "host: .*", "host: " + args.database_host)
 
   try:
     subprocess.check_call("rvm jruby-1.7.8 do bundle install --gemfile=Gemfile-jruby", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
     subprocess.check_call("cp Gemfile-jruby Gemfile", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
     subprocess.check_call("cp Gemfile-jruby.lock Gemfile.lock", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
-    subprocess.check_call("cp config/database-jruby.yml config/database.yml", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
     subprocess.Popen("rvm jruby-1.7.8 do bundle exec torqbox -b 0.0.0.0 -E production", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:

+ 1 - 2
rails-stripped/setup_ruby.py

@@ -9,12 +9,11 @@ from os.path import expanduser
 home = expanduser("~")
 
 def start(args, logfile, errfile):
-  setup_util.replace_text("rails-stripped/config/database-ruby.yml", "host: .*", "host: " + args.database_host)
+  setup_util.replace_text("rails-stripped/config/database.yml", "host: .*", "host: " + args.database_host)
   try:
     subprocess.check_call("rvm ruby-2.0.0-p0 do bundle install --gemfile=Gemfile-ruby", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
     subprocess.check_call("cp Gemfile-ruby Gemfile", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
     subprocess.check_call("cp Gemfile-ruby.lock Gemfile.lock", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
-    subprocess.check_call("cp config/database-ruby.yml config/database.yml", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
     subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + home + "/FrameworkBenchmarks/rails-stripped/config/nginx.conf", shell=True, stderr=errfile, stdout=logfile)
     subprocess.Popen("rvm ruby-2.0.0-p0 do bundle exec unicorn_rails -E production -c config/unicorn.rb", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
     return 0