Parcourir la source

Bump JRuby to 1.7.8 and switch from Warbler/Resin to TorqBox

This bumps JRuby from 1.7.4 to 1.7.8 and updates the server used from
Warbler and Resin to TorqBox. TorqBox is based on JBoss Undertow and
is the next-generation, lightweight, embeddable version of
TorqueBox (http://torquebox.org).
Ben Browning il y a 12 ans
Parent
commit
350162445f

+ 1 - 3
rack/Gemfile-jruby

@@ -1,8 +1,6 @@
 source 'http://rubygems.org'
 
-gem 'jruby-rack', '1.2.0.SNAPSHOT'
-gem 'warbler', '1.3.6'
-gem 'jruby-jars', '1.7.4'
+gem 'torqbox', '0.1.2'
 gem 'json', '1.7.6'
 gem "rubyzip", "~> 1.0.0"
 gem "zip-zip", "~> 0.1"

+ 3 - 4
rack/README.md

@@ -10,14 +10,13 @@ This is the Ruby Rack portion of a [benchmarking test suite](../) comparing a va
 The tests were run with:
 
 * [Ruby 2.0.0-p0](http://www.ruby-lang.org/)
-* [JRuby 1.7.4](http://jruby.org/)
+* [JRuby 1.7.8](http://jruby.org/)
 * [Rack 1.5.1](http://rack.github.com/)
 * [Unicorn 4.6.2](http://unicorn.bogomips.org/)
-* [Resin 4.0.34](http://www.caucho.com/)
+* [TorqBox 0.1.2](http://torquebox.org/torqbox/)
 
 ## References
 * https://github.com/FooBarWidget/passenger/pull/71
-* https://github.com/jruby/jruby-rack/issues/146
 
 ## Test URLs
 ### JSON Encoding Test
@@ -26,5 +25,5 @@ Ruby:
 localhost:8080
 
 JRuby:
-localhost:8080/rack/
+localhost:8080
 

+ 3 - 3
rack/benchmark_config

@@ -22,8 +22,8 @@
     },
     "jruby": {
       "setup_file": "setup_jruby",
-      "json_url": "/rack/json",
-      "plaintext_url": "/rack/plaintext",
+      "json_url": "/json",
+      "plaintext_url": "/plaintext",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Platform",
@@ -32,7 +32,7 @@
       "language": "Ruby",
       "orm": "Full",
       "platform": "JRuby",
-      "webserver": "Resin",
+      "webserver": "TorqBox",
       "os": "Linux",
       "database_os": "Linux",
       "display_name": "rack",

+ 0 - 151
rack/config/warble.rb

@@ -1,151 +0,0 @@
-# Disable Rake-environment-task framework detection by uncommenting/setting to false
-# Warbler.framework_detection = false
-
-# Warbler web application assembly configuration file
-Warbler::Config.new do |config|
-  # Features: additional options controlling how the jar is built.
-  # Currently the following features are supported:
-  # - gemjar: package the gem repository in a jar file in WEB-INF/lib
-  # - executable: embed a web server and make the war executable
-  # - compiled: compile .rb files to .class files
-  # config.features = %w(gemjar)
-
-  # Application directories to be included in the webapp.
-  config.dirs = %w(app config lib log vendor tmp)
-
-  # Additional files/directories to include, above those in config.dirs
-  # config.includes = FileList["db"]
-
-  # Additional files/directories to exclude
-  # config.excludes = FileList["lib/tasks/*"]
-
-  # Additional Java .jar files to include.  Note that if .jar files are placed
-  # in lib (and not otherwise excluded) then they need not be mentioned here.
-  # JRuby and JRuby-Rack are pre-loaded in this list.  Be sure to include your
-  # own versions if you directly set the value
-  # config.java_libs += FileList["lib/java/*.jar"]
-
-  # Loose Java classes and miscellaneous files to be included.
-  # config.java_classes = FileList["target/classes/**.*"]
-
-  # One or more pathmaps defining how the java classes should be copied into
-  # the archive. The example pathmap below accompanies the java_classes
-  # configuration above. See http://rake.rubyforge.org/classes/String.html#M000017
-  # for details of how to specify a pathmap.
-  # config.pathmaps.java_classes << "%{target/classes/,}p"
-
-  # Bundler support is built-in. If Warbler finds a Gemfile in the
-  # project directory, it will be used to collect the gems to bundle
-  # in your application. If you wish to explicitly disable this
-  # functionality, uncomment here.
-  # config.bundler = false
-
-  # An array of Bundler groups to avoid including in the war file.
-  # Defaults to ["development", "test"].
-  # config.bundle_without = []
-
-  # Other gems to be included. If you don't use Bundler or a gemspec
-  # file, you need to tell Warbler which gems your application needs
-  # so that they can be packaged in the archive.
-  # For Rails applications, the Rails gems are included by default
-  # unless the vendor/rails directory is present.
-  # config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl"]
-  # config.gems << "tzinfo"
-
-  # Uncomment this if you don't want to package rails gem.
-  # config.gems -= ["rails"]
-
-  # The most recent versions of gems are used.
-  # You can specify versions of gems by using a hash assignment:
-  # config.gems["rails"] = "2.3.10"
-  
-  # You can also use regexps or Gem::Dependency objects for flexibility or
-  # finer-grained control.
-  # config.gems << /^merb-/
-  # config.gems << Gem::Dependency.new("merb-core", "= 0.9.3")
-
-  # Include gem dependencies not mentioned specifically. Default is
-  # true, uncomment to turn off.
-  # config.gem_dependencies = false
-
-  # Array of regular expressions matching relative paths in gems to be
-  # excluded from the war. Defaults to empty, but you can set it like
-  # below, which excludes test files.
-  # config.gem_excludes = [/^(test|spec)\//]
-
-  # Pathmaps for controlling how application files are copied into the archive
-  # config.pathmaps.application = ["WEB-INF/%p"]
-
-  # Name of the archive (without the extension). Defaults to the basename
-  # of the project directory.
-  # config.jar_name = "mywar"
-
-  # Name of the MANIFEST.MF template for the war file. Defaults to a simple
-  # MANIFEST.MF that contains the version of Warbler used to create the war file.
-  # config.manifest_file = "config/MANIFEST.MF"
-
-  # When using the 'compiled' feature and specified, only these Ruby
-  # files will be compiled. Default is to compile all \.rb files in
-  # the application.
-  # config.compiled_ruby_files = FileList['app/**/*.rb']
-
-  # === War files only below here ===
-
-  # Path to the pre-bundled gem directory inside the war file. Default
-  # is 'WEB-INF/gems'. Specify path if gems are already bundled
-  # before running Warbler. This also sets 'gem.path' inside web.xml.
-  # config.gem_path = "WEB-INF/vendor/bundler_gems"
-
-  # Files for WEB-INF directory (next to web.xml). This contains
-  # web.xml by default. If there is an .erb-File it will be processed
-  # with webxml-config. You may want to exclude this file via
-  # config.excludes.
-  # config.webinf_files += FileList["jboss-web.xml"]
-
-  # Files to be included in the root of the webapp.  Note that files in public
-  # will have the leading 'public/' part of the path stripped during staging.
-  # config.public_html = FileList["public/**/*", "doc/**/*"]
-
-  # Pathmaps for controlling how public HTML files are copied into the .war
-  # config.pathmaps.public_html = ["%{public/,}p"]
-
-  # Embedded webserver to use with the 'executable' feature. Currently supported
-  # webservers are:
-  # * <tt>winstone</tt> (default) - Winstone 0.9.10 from sourceforge
-  # * <tt>jenkins-ci.winstone</tt> - Improved Winstone from Jenkins CI
-  # * <tt>jetty</tt> - Embedded Jetty from Eclipse
-  # config.webserver = 'jetty'
-
-# Value of RAILS_ENV for the webapp -- default as shown below
-  # config.webxml.rails.env = ENV['RAILS_ENV'] || 'production'
-
-  # Application booter to use, one of :rack, :rails, or :merb (autodetected by default)
-  # config.webxml.booter = :rails
-
-  # Set JRuby to run in 1.9 mode.
-  config.webxml.jruby.compat.version = "1.9"
-
-  # When using the :rack booter, "Rackup" script to use.
-  # - For 'rackup.path', the value points to the location of the rackup
-  # script in the web archive file. You need to make sure this file
-  # gets included in the war, possibly by adding it to config.includes
-  # or config.webinf_files above.
-  # - For 'rackup', the rackup script you provide as an inline string
-  #   is simply embedded in web.xml.
-  # The script is evaluated in a Rack::Builder to load the application.
-  # Examples:
-  # config.webxml.rackup.path = 'WEB-INF/hello.ru'
-  # config.webxml.rackup = %{require './lib/demo'; run Rack::Adapter::Camping.new(Demo)}
-  # config.webxml.rackup = require 'cgi' && CGI::escapeHTML(File.read("config.ru"))
-
-  # Control the pool of Rails runtimes. Leaving unspecified means
-  # the pool will grow as needed to service requests. It is recommended
-  # that you fix these values when running a production server!
-  # If you're using threadsafe! mode, you probably don't want to set these values,
-  # since 1 runtime(default for threadsafe mode) will be enough.
-  # config.webxml.jruby.min.runtimes = 2
-  # config.webxml.jruby.max.runtimes = 4
-
-  # JNDI data source name
-  # config.webxml.jndi = 'jdbc/rails'
-end

+ 8 - 6
rack/setup_jruby.py

@@ -6,19 +6,21 @@ import re
 def start(args, logfile, errfile):
 
   try:
-    subprocess.check_call("rvm jruby-1.7.4 do bundle install --gemfile=Gemfile-jruby", shell=True, cwd="rack", stderr=errfile, stdout=logfile)
+    subprocess.check_call("rvm jruby-1.7.8 do bundle install --gemfile=Gemfile-jruby", shell=True, cwd="rack", stderr=errfile, stdout=logfile)
     subprocess.check_call("cp Gemfile-jruby Gemfile", shell=True, cwd="rack", stderr=errfile, stdout=logfile)
     subprocess.check_call("cp Gemfile-jruby.lock Gemfile.lock", shell=True, cwd="rack", stderr=errfile, stdout=logfile)
-    subprocess.check_call("rvm jruby-1.7.4 do warble war", shell=True, cwd="rack", stderr=errfile, stdout=logfile)
-    subprocess.check_call("rm -rf $RESIN_HOME/webapps/*", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.check_call("cp rack.war $RESIN_HOME/webapps/rack.war", shell=True, cwd="rack", stderr=errfile, stdout=logfile)
-    subprocess.check_call("$RESIN_HOME/bin/resinctl start", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.Popen("rvm jruby-1.7.8 do bundle exec torqbox -E production", shell=True, cwd="rack", stderr=errfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
     return 1
 def stop(logfile, errfile):
   try:
-    subprocess.check_call("$RESIN_HOME/bin/resinctl shutdown", shell=True, stderr=errfile, stdout=logfile)
+    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
+    out, err = p.communicate()
+    for line in out.splitlines():
+      if 'torqbox' in line:
+        pid = int(line.split(None, 2)[1])
+        os.kill(pid, 9)
     subprocess.check_call("rm Gemfile", shell=True, cwd="rack", stderr=errfile, stdout=logfile)
     subprocess.check_call("rm Gemfile.lock", shell=True, cwd="rack", stderr=errfile, stdout=logfile)
     return 0

+ 0 - 1
rack/source_code

@@ -1,4 +1,3 @@
 ./rack/config/unicorn.rb
-./rack/config/warble.rb
 ./rack/setup_jruby.py
 ./rack/setup_ruby.py

+ 1 - 4
rails-stripped/Gemfile-jruby

@@ -1,10 +1,7 @@
 source 'https://rubygems.org'
 
-gem 'jruby-openssl', '0.8.5'
 gem 'rails', '3.2.13'
-gem 'jruby-rack', '1.2.0.SNAPSHOT'
-gem 'warbler', '1.3.6'
-gem 'jruby-jars', '1.7.4'
+gem 'torqbox', '0.1.2'
 gem 'activerecord-jdbcmysql-adapter', '1.2.6'
 gem "rubyzip", "~> 1.0.0"
 gem "zip-zip", "~> 0.1"

+ 4 - 5
rails-stripped/README.md

@@ -13,15 +13,14 @@ This is the Ruby on Rails portion of a [benchmarking test suite](../) comparing
 ## Infrastructure Software Versions
 The tests were run with:
 * [Ruby 2.0.0-p0](http://www.ruby-lang.org/)
-* [JRuby 1.7.4](http://jruby.org/)
+* [JRuby 1.7.8](http://jruby.org/)
 * [Rails 3.2.11](http://rubyonrails.org/)
 * [Unicorn 4.6.2](http://unicorn.bogomips.org/)
-* [Resin 4.0.34](http://www.caucho.com/)
+* [TorqBox 0.1.2](http://torquebox.org/torqbox/)
 * [MySQL 5.5.29](https://dev.mysql.com/)
 
 ## References
 * https://github.com/FooBarWidget/passenger/pull/71
-* https://github.com/jruby/jruby-rack/issues/146
 
 ## Test URLs
 ### JSON Encoding Test
@@ -30,7 +29,7 @@ Ruby:
 localhost:8080/hello_world/json
 
 JRuby:
-localhost:8080/rails/hello_world/json
+localhost:8080/hello_world/json
 
 ### Data-Store/Database Mapping Test
 
@@ -38,4 +37,4 @@ Ruby:
 localhost:8080/hello_world/db?queries=5
 
 JRuby:
-localhost:8080/rails/hello_world/db?queries=5
+localhost:8080/hello_world/db?queries=5

+ 4 - 4
rails-stripped/benchmark_config

@@ -23,9 +23,9 @@
     },
     "jruby": {
       "setup_file": "setup_jruby",
-      "json_url": "/rails/hello_world/json",
-      "db_url": "/rails/hello_world/db",
-      "query_url": "/rails/hello_world/db?queries=",
+      "json_url": "/hello_world/json",
+      "db_url": "/hello_world/db",
+      "query_url": "/hello_world/db?queries=",
       "port": 8080,
       "approach": "Stripped",
       "classification": "Fullstack",
@@ -34,7 +34,7 @@
       "language": "Ruby",
       "orm": "Full",
       "platform": "JRuby",
-      "webserver": "Resin",
+      "webserver": "TorqBox",
       "os": "Linux",
       "database_os": "Linux",
       "display_name": "rails",

+ 0 - 151
rails-stripped/config/warble.rb

@@ -1,151 +0,0 @@
-# Disable Rake-environment-task framework detection by uncommenting/setting to false
-# Warbler.framework_detection = false
-
-# Warbler web application assembly configuration file
-Warbler::Config.new do |config|
-  # Features: additional options controlling how the jar is built.
-  # Currently the following features are supported:
-  # - gemjar: package the gem repository in a jar file in WEB-INF/lib
-  # - executable: embed a web server and make the war executable
-  # - compiled: compile .rb files to .class files
-  # config.features = %w(gemjar)
-
-  # Application directories to be included in the webapp.
-  config.dirs = %w(app config lib log vendor tmp views)
-
-  # Additional files/directories to include, above those in config.dirs
-  # config.includes = FileList["hello_world.rb"]
-
-  # Additional files/directories to exclude
-  # config.excludes = FileList["lib/tasks/*"]
-
-  # Additional Java .jar files to include.  Note that if .jar files are placed
-  # in lib (and not otherwise excluded) then they need not be mentioned here.
-  # JRuby and JRuby-Rack are pre-loaded in this list.  Be sure to include your
-  # own versions if you directly set the value
-  # config.java_libs += FileList["lib/java/*.jar"]
-
-  # Loose Java classes and miscellaneous files to be included.
-  # config.java_classes = FileList["target/classes/**.*"]
-
-  # One or more pathmaps defining how the java classes should be copied into
-  # the archive. The example pathmap below accompanies the java_classes
-  # configuration above. See http://rake.rubyforge.org/classes/String.html#M000017
-  # for details of how to specify a pathmap.
-  # config.pathmaps.java_classes << "%{target/classes/,}p"
-
-  # Bundler support is built-in. If Warbler finds a Gemfile in the
-  # project directory, it will be used to collect the gems to bundle
-  # in your application. If you wish to explicitly disable this
-  # functionality, uncomment here.
-  # config.bundler = false
-
-  # An array of Bundler groups to avoid including in the war file.
-  # Defaults to ["development", "test"].
-  # config.bundle_without = []
-
-  # Other gems to be included. If you don't use Bundler or a gemspec
-  # file, you need to tell Warbler which gems your application needs
-  # so that they can be packaged in the archive.
-  # For Rails applications, the Rails gems are included by default
-  # unless the vendor/rails directory is present.
-  # config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl"]
-  # config.gems << "tzinfo"
-
-  # Uncomment this if you don't want to package rails gem.
-  # config.gems -= ["rails"]
-
-  # The most recent versions of gems are used.
-  # You can specify versions of gems by using a hash assignment:
-  # config.gems["rails"] = "2.3.10"
-
-  # You can also use regexps or Gem::Dependency objects for flexibility or
-  # finer-grained control.
-  # config.gems << /^merb-/
-  # config.gems << Gem::Dependency.new("merb-core", "= 0.9.3")
-
-  # Include gem dependencies not mentioned specifically. Default is
-  # true, uncomment to turn off.
-  # config.gem_dependencies = false
-
-  # Array of regular expressions matching relative paths in gems to be
-  # excluded from the war. Defaults to empty, but you can set it like
-  # below, which excludes test files.
-  # config.gem_excludes = [/^(test|spec)\//]
-
-  # Pathmaps for controlling how application files are copied into the archive
-  # config.pathmaps.application = ["WEB-INF/%p"]
-
-  # Name of the archive (without the extension). Defaults to the basename
-  # of the project directory.
-  # config.jar_name = "mywar"
-
-  # Name of the MANIFEST.MF template for the war file. Defaults to a simple
-  # MANIFEST.MF that contains the version of Warbler used to create the war file.
-  # config.manifest_file = "config/MANIFEST.MF"
-
-  # When using the 'compiled' feature and specified, only these Ruby
-  # files will be compiled. Default is to compile all \.rb files in
-  # the application.
-  # config.compiled_ruby_files = FileList['app/**/*.rb']
-
-  # === War files only below here ===
-
-  # Path to the pre-bundled gem directory inside the war file. Default
-  # is 'WEB-INF/gems'. Specify path if gems are already bundled
-  # before running Warbler. This also sets 'gem.path' inside web.xml.
-  # config.gem_path = "WEB-INF/vendor/bundler_gems"
-
-  # Files for WEB-INF directory (next to web.xml). This contains
-  # web.xml by default. If there is an .erb-File it will be processed
-  # with webxml-config. You may want to exclude this file via
-  # config.excludes.
-  config.webinf_files += FileList["resin-web.xml"]
-
-  # Files to be included in the root of the webapp.  Note that files in public
-  # will have the leading 'public/' part of the path stripped during staging.
-  # config.public_html = FileList["public/**/*", "doc/**/*"]
-
-  # Pathmaps for controlling how public HTML files are copied into the .war
-  # config.pathmaps.public_html = ["%{public/,}p"]
-
-  # Embedded webserver to use with the 'executable' feature. Currently supported
-  # webservers are:
-  # * <tt>winstone</tt> (default) - Winstone 0.9.10 from sourceforge
-  # * <tt>jenkins-ci.winstone</tt> - Improved Winstone from Jenkins CI
-  # * <tt>jetty</tt> - Embedded Jetty from Eclipse
-  # config.webserver = 'jetty'
-
-  # Value of RAILS_ENV for the webapp -- default as shown below
-  # config.webxml.rails.env = ENV['RAILS_ENV'] || 'production'
-
-  # Application booter to use, one of :rack, :rails, or :merb (autodetected by default)
-  # config.webxml.booter = :rails
-
-  # Set JRuby to run in 1.9 mode.
-  # config.webxml.jruby.compat.version = "1.9"
-
-  # When using the :rack booter, "Rackup" script to use.
-  # - For 'rackup.path', the value points to the location of the rackup
-  # script in the web archive file. You need to make sure this file
-  # gets included in the war, possibly by adding it to config.includes
-  # or config.webinf_files above.
-  # - For 'rackup', the rackup script you provide as an inline string
-  #   is simply embedded in web.xml.
-  # The script is evaluated in a Rack::Builder to load the application.
-  # Examples:
-  # config.webxml.rackup.path = 'WEB-INF/hello.ru'
-  # config.webxml.rackup = %{require './lib/demo'; run Rack::Adapter::Camping.new(Demo)}
-  # config.webxml.rackup = require 'cgi' && CGI::escapeHTML(File.read("config.ru"))
-
-  # Control the pool of Rails runtimes. Leaving unspecified means
-  # the pool will grow as needed to service requests. It is recommended
-  # that you fix these values when running a production server!
-  # If you're using threadsafe! mode, you probably don't want to set these values,
-  # since 1 runtime(default for threadsafe mode) will be enough.
-  # config.webxml.jruby.min.runtimes = 24
-  # config.webxml.jruby.max.runtimes = 24
-
-  # JNDI data source name
-  # config.webxml.jndi = 'jdbc/rails'
-end

+ 0 - 13
rails-stripped/resin-web.xml

@@ -1,13 +0,0 @@
-<web-app xmlns="http://caucho.com/ns/resin">
-
-<database jndi-name='jdbc/hello_world'>
-  <driver>
-    <type>com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource</type>
-    <url>jdbc:mysql://172.16.98.98:3306/hello_world?jdbcCompliantTruncation=false&amp;elideSetAutoCommits=true&amp;useLocalSessionState=true&amp;cachePrepStmts=true&amp;cacheCallableStmts=true&amp;alwaysSendSetIsolation=false&amp;prepStmtCacheSize=4096&amp;cacheServerConfiguration=true&amp;prepStmtCacheSqlLimit=2048&amp;zeroDateTimeBehavior=convertToNull&amp;traceProtocol=false&amp;useUnbufferedInput=false&amp;useReadAheadInput=false&amp;maintainTimeStats=false&amp;useServerPrepStmts&amp;cacheRSMetadata=true</url>
-    <user>benchmarkdbuser</user>
-    <password>benchmarkdbpass</password>
-    <useUnicode/>
-  </driver>
-</database>
-
-</web-app>

+ 8 - 7
rails-stripped/setup_jruby.py

@@ -5,23 +5,24 @@ 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/resin-web.xml", "mysql:\/\/.*:3306", "mysql://" + args.database_host + ":3306")
 
   try:
-    subprocess.check_call("rvm jruby-1.7.4 do bundle install --gemfile=Gemfile-jruby", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
+    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.check_call("rvm jruby-1.7.4 do warble war", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
-    subprocess.check_call("rm -rf $RESIN_HOME/webapps/*", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.check_call("cp rails-stripped.war $RESIN_HOME/webapps/rails.war", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
-    subprocess.check_call("$RESIN_HOME/bin/resinctl start", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.Popen("rvm jruby-1.7.8 do bundle exec torqbox -E production", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
     return 1
 def stop(logfile, errfile):
   try:
-    subprocess.check_call("$RESIN_HOME/bin/resinctl shutdown", shell=True, stderr=errfile, stdout=logfile)
+    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
+    out, err = p.communicate()
+    for line in out.splitlines():
+      if 'torqbox' in line:
+        pid = int(line.split(None, 2)[1])
+        os.kill(pid, 9)
     subprocess.check_call("rm Gemfile", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
     subprocess.check_call("rm Gemfile.lock", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile)
     return 0

+ 1 - 4
rails/Gemfile-jruby

@@ -1,10 +1,7 @@
 source 'https://rubygems.org'
 
-gem 'jruby-openssl', '0.8.5'
 gem 'rails', '3.2.13'
-gem 'jruby-rack', '1.2.0.SNAPSHOT'
-gem 'warbler', '1.3.6'
-gem 'jruby-jars', '1.7.4'
+gem 'torqbox', '0.1.2'
 gem 'activerecord-jdbcmysql-adapter', '1.2.6'
 gem "rubyzip", "~> 1.0.0"
 gem "zip-zip", "~> 0.1"

+ 4 - 5
rails/README.md

@@ -13,15 +13,14 @@ This is the Ruby on Rails portion of a [benchmarking test suite](../) comparing
 ## Infrastructure Software Versions
 The tests were run with:
 * [Ruby 2.0.0-p0](http://www.ruby-lang.org/)
-* [JRuby 1.7.4](http://jruby.org/)
+* [JRuby 1.7.8](http://jruby.org/)
 * [Rails 3.2.11](http://rubyonrails.org/)
 * [Unicorn 4.6.2](http://unicorn.bogomips.org/)
-* [Resin 4.0.34](http://www.caucho.com/)
+* [TorqBox 0.1.2](http://torquebox.org/torqbox/)
 * [MySQL 5.5.29](https://dev.mysql.com/)
 
 ## References
 * https://github.com/FooBarWidget/passenger/pull/71
-* https://github.com/jruby/jruby-rack/issues/146
 
 ## Test URLs
 ### JSON Encoding Test
@@ -30,7 +29,7 @@ Ruby:
 localhost:8080/hello_world/json
 
 JRuby:
-localhost:8080/rails/hello_world/json
+localhost:8080/hello_world/json
 
 ### Data-Store/Database Mapping Test
 
@@ -38,4 +37,4 @@ Ruby:
 localhost:8080/hello_world/db?queries=5
 
 JRuby:
-localhost:8080/rails/hello_world/db?queries=5
+localhost:8080/hello_world/db?queries=5

+ 6 - 6
rails/benchmark_config

@@ -25,11 +25,11 @@
     },
     "jruby": {
       "setup_file": "setup_jruby",
-      "json_url": "/rails/hello_world/json",
-      "db_url": "/rails/hello_world/db",
-      "query_url": "/rails/hello_world/db?queries=",
-      "fortune_url": "/rails/fortune",
-      "update_url": "/rails/update?queries=",
+      "json_url": "/hello_world/json",
+      "db_url": "/hello_world/db",
+      "query_url": "/hello_world/db?queries=",
+      "fortune_url": "/fortune",
+      "update_url": "/update?queries=",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Fullstack",
@@ -38,7 +38,7 @@
       "language": "Ruby",
       "orm": "Full",
       "platform": "JRuby",
-      "webserver": "Resin",
+      "webserver": "TorqBox",
       "os": "Linux",
       "database_os": "Linux",
       "display_name": "rails",

+ 0 - 151
rails/config/warble.rb

@@ -1,151 +0,0 @@
-# Disable Rake-environment-task framework detection by uncommenting/setting to false
-# Warbler.framework_detection = false
-
-# Warbler web application assembly configuration file
-Warbler::Config.new do |config|
-  # Features: additional options controlling how the jar is built.
-  # Currently the following features are supported:
-  # - gemjar: package the gem repository in a jar file in WEB-INF/lib
-  # - executable: embed a web server and make the war executable
-  # - compiled: compile .rb files to .class files
-  # config.features = %w(gemjar)
-
-  # Application directories to be included in the webapp.
-  config.dirs = %w(app config lib log vendor tmp views)
-
-  # Additional files/directories to include, above those in config.dirs
-  # config.includes = FileList["hello_world.rb"]
-
-  # Additional files/directories to exclude
-  # config.excludes = FileList["lib/tasks/*"]
-
-  # Additional Java .jar files to include.  Note that if .jar files are placed
-  # in lib (and not otherwise excluded) then they need not be mentioned here.
-  # JRuby and JRuby-Rack are pre-loaded in this list.  Be sure to include your
-  # own versions if you directly set the value
-  # config.java_libs += FileList["lib/java/*.jar"]
-
-  # Loose Java classes and miscellaneous files to be included.
-  # config.java_classes = FileList["target/classes/**.*"]
-
-  # One or more pathmaps defining how the java classes should be copied into
-  # the archive. The example pathmap below accompanies the java_classes
-  # configuration above. See http://rake.rubyforge.org/classes/String.html#M000017
-  # for details of how to specify a pathmap.
-  # config.pathmaps.java_classes << "%{target/classes/,}p"
-
-  # Bundler support is built-in. If Warbler finds a Gemfile in the
-  # project directory, it will be used to collect the gems to bundle
-  # in your application. If you wish to explicitly disable this
-  # functionality, uncomment here.
-  # config.bundler = false
-
-  # An array of Bundler groups to avoid including in the war file.
-  # Defaults to ["development", "test"].
-  # config.bundle_without = []
-
-  # Other gems to be included. If you don't use Bundler or a gemspec
-  # file, you need to tell Warbler which gems your application needs
-  # so that they can be packaged in the archive.
-  # For Rails applications, the Rails gems are included by default
-  # unless the vendor/rails directory is present.
-  # config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl"]
-  # config.gems << "tzinfo"
-
-  # Uncomment this if you don't want to package rails gem.
-  # config.gems -= ["rails"]
-
-  # The most recent versions of gems are used.
-  # You can specify versions of gems by using a hash assignment:
-  # config.gems["rails"] = "2.3.10"
-
-  # You can also use regexps or Gem::Dependency objects for flexibility or
-  # finer-grained control.
-  # config.gems << /^merb-/
-  # config.gems << Gem::Dependency.new("merb-core", "= 0.9.3")
-
-  # Include gem dependencies not mentioned specifically. Default is
-  # true, uncomment to turn off.
-  # config.gem_dependencies = false
-
-  # Array of regular expressions matching relative paths in gems to be
-  # excluded from the war. Defaults to empty, but you can set it like
-  # below, which excludes test files.
-  # config.gem_excludes = [/^(test|spec)\//]
-
-  # Pathmaps for controlling how application files are copied into the archive
-  # config.pathmaps.application = ["WEB-INF/%p"]
-
-  # Name of the archive (without the extension). Defaults to the basename
-  # of the project directory.
-  # config.jar_name = "mywar"
-
-  # Name of the MANIFEST.MF template for the war file. Defaults to a simple
-  # MANIFEST.MF that contains the version of Warbler used to create the war file.
-  # config.manifest_file = "config/MANIFEST.MF"
-
-  # When using the 'compiled' feature and specified, only these Ruby
-  # files will be compiled. Default is to compile all \.rb files in
-  # the application.
-  # config.compiled_ruby_files = FileList['app/**/*.rb']
-
-  # === War files only below here ===
-
-  # Path to the pre-bundled gem directory inside the war file. Default
-  # is 'WEB-INF/gems'. Specify path if gems are already bundled
-  # before running Warbler. This also sets 'gem.path' inside web.xml.
-  # config.gem_path = "WEB-INF/vendor/bundler_gems"
-
-  # Files for WEB-INF directory (next to web.xml). This contains
-  # web.xml by default. If there is an .erb-File it will be processed
-  # with webxml-config. You may want to exclude this file via
-  # config.excludes.
-  config.webinf_files += FileList["resin-web.xml"]
-
-  # Files to be included in the root of the webapp.  Note that files in public
-  # will have the leading 'public/' part of the path stripped during staging.
-  # config.public_html = FileList["public/**/*", "doc/**/*"]
-
-  # Pathmaps for controlling how public HTML files are copied into the .war
-  # config.pathmaps.public_html = ["%{public/,}p"]
-
-  # Embedded webserver to use with the 'executable' feature. Currently supported
-  # webservers are:
-  # * <tt>winstone</tt> (default) - Winstone 0.9.10 from sourceforge
-  # * <tt>jenkins-ci.winstone</tt> - Improved Winstone from Jenkins CI
-  # * <tt>jetty</tt> - Embedded Jetty from Eclipse
-  # config.webserver = 'jetty'
-
-  # Value of RAILS_ENV for the webapp -- default as shown below
-  # config.webxml.rails.env = ENV['RAILS_ENV'] || 'production'
-
-  # Application booter to use, one of :rack, :rails, or :merb (autodetected by default)
-  # config.webxml.booter = :rails
-
-  # Set JRuby to run in 1.9 mode.
-  # config.webxml.jruby.compat.version = "1.9"
-
-  # When using the :rack booter, "Rackup" script to use.
-  # - For 'rackup.path', the value points to the location of the rackup
-  # script in the web archive file. You need to make sure this file
-  # gets included in the war, possibly by adding it to config.includes
-  # or config.webinf_files above.
-  # - For 'rackup', the rackup script you provide as an inline string
-  #   is simply embedded in web.xml.
-  # The script is evaluated in a Rack::Builder to load the application.
-  # Examples:
-  # config.webxml.rackup.path = 'WEB-INF/hello.ru'
-  # config.webxml.rackup = %{require './lib/demo'; run Rack::Adapter::Camping.new(Demo)}
-  # config.webxml.rackup = require 'cgi' && CGI::escapeHTML(File.read("config.ru"))
-
-  # Control the pool of Rails runtimes. Leaving unspecified means
-  # the pool will grow as needed to service requests. It is recommended
-  # that you fix these values when running a production server!
-  # If you're using threadsafe! mode, you probably don't want to set these values,
-  # since 1 runtime(default for threadsafe mode) will be enough.
-  # config.webxml.jruby.min.runtimes = 24
-  # config.webxml.jruby.max.runtimes = 24
-
-  # JNDI data source name
-  # config.webxml.jndi = 'jdbc/rails'
-end

+ 0 - 13
rails/resin-web.xml

@@ -1,13 +0,0 @@
-<web-app xmlns="http://caucho.com/ns/resin">
-
-<database jndi-name='jdbc/hello_world'>
-  <driver>
-    <type>com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource</type>
-    <url>jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&amp;elideSetAutoCommits=true&amp;useLocalSessionState=true&amp;cachePrepStmts=true&amp;cacheCallableStmts=true&amp;alwaysSendSetIsolation=false&amp;prepStmtCacheSize=4096&amp;cacheServerConfiguration=true&amp;prepStmtCacheSqlLimit=2048&amp;zeroDateTimeBehavior=convertToNull&amp;traceProtocol=false&amp;useUnbufferedInput=false&amp;useReadAheadInput=false&amp;maintainTimeStats=false&amp;useServerPrepStmts&amp;cacheRSMetadata=true</url>
-    <user>benchmarkdbuser</user>
-    <password>benchmarkdbpass</password>
-    <useUnicode/>
-  </driver>
-</database>
-
-</web-app>

+ 9 - 8
rails/setup_jruby.py

@@ -5,25 +5,26 @@ import setup_util
 
 def start(args, logfile, errfile):
   setup_util.replace_text("rails/config/database-jruby.yml", "host: .*", "host: " + args.database_host)
-  setup_util.replace_text("rails/resin-web.xml", "mysql:\/\/.*:3306", "mysql://" + args.database_host + ":3306")
 
   try:
-    subprocess.check_call("rvm jruby-1.7.4 do bundle install --gemfile=Gemfile-jruby", shell=True, cwd="rails", stderr=errfile, stdout=logfile)
+    subprocess.check_call("rvm jruby-1.7.8 do bundle install --gemfile=Gemfile-jruby", shell=True, cwd="rails", stderr=errfile, stdout=logfile)
     subprocess.check_call("cp Gemfile-jruby Gemfile", shell=True, cwd="rails", stderr=errfile, stdout=logfile)
     subprocess.check_call("cp Gemfile-jruby.lock Gemfile.lock", shell=True, cwd="rails", stderr=errfile, stdout=logfile)
     subprocess.check_call("cp config/database-jruby.yml config/database.yml", shell=True, cwd="rails", stderr=errfile, stdout=logfile)
-    subprocess.check_call("rvm jruby-1.7.4 do warble war", shell=True, cwd="rails", stderr=errfile, stdout=logfile)
-    subprocess.check_call("rm -rf $RESIN_HOME/webapps/*", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.check_call("cp rails.war $RESIN_HOME/webapps/rails.war", shell=True, cwd="rails", stderr=errfile, stdout=logfile)
-    subprocess.check_call("$RESIN_HOME/bin/resinctl start", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.Popen("rvm jruby-1.7.8 do bundle exec torqbox -E production", shell=True, cwd="rails", stderr=errfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
     return 1
 def stop(logfile, errfile):
   try:
-    subprocess.check_call("$RESIN_HOME/bin/resinctl shutdown", shell=True, stderr=errfile, stdout=logfile)
+    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
+    out, err = p.communicate()
+    for line in out.splitlines():
+      if 'torqbox' in line:
+        pid = int(line.split(None, 2)[1])
+        os.kill(pid, 9)
     subprocess.check_call("rm Gemfile", shell=True, cwd="rails", stderr=errfile, stdout=logfile)
     subprocess.check_call("rm Gemfile.lock", shell=True, cwd="rails", stderr=errfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
-    return 1
+    return 1

+ 1 - 3
sinatra/Gemfile-jruby

@@ -1,9 +1,7 @@
 source 'https://rubygems.org'
 gem 'sinatra', '1.3.4'
 gem 'sinatra-contrib', '1.3.2'
-gem 'warbler', '1.3.6'
-gem 'jruby-jars', '1.7.4'
-gem 'jruby-rack', '1.2.0.SNAPSHOT'
+gem 'torqbox', '0.1.2'
 gem 'activerecord-jdbcmysql-adapter', '1.2.6'
 gem "sinatra-activerecord", "1.2.2"
 gem "rubyzip", "~> 1.0.0"

+ 4 - 5
sinatra/README.md

@@ -12,15 +12,14 @@ This is the Ruby Sinatra portion of a [benchmarking test suite](../) comparing a
 ## Infrastructure Software Versions
 The tests were run with:
 * [Ruby 2.0.0-p0](http://www.ruby-lang.org/)
-* [JRuby 1.7.4](http://jruby.org/)
+* [JRuby 1.7.8](http://jruby.org/)
 * [Sinatra 1.3.4](http://www.sinatrarb.com/)
 * [Unicorn 4.6.2](http://unicorn.bogomips.org/)
-* [Resin 4.0.34](http://www.caucho.com/)
+* [TorqBox 0.1.2](http://torquebox.org/torqbox/)
 * [MySQL 5.5.29](https://dev.mysql.com/)
 
 ## References
 * https://github.com/FooBarWidget/passenger/pull/71
-* https://github.com/jruby/jruby-rack/issues/146
 
 ## Test URLs
 
@@ -30,7 +29,7 @@ Ruby:
 localhost:8080/json
 
 JRuby:
-localhost:8080/sinatra/json
+localhost:8080/json
 
 ### Data-Store/Database Mapping Test
 
@@ -38,4 +37,4 @@ Ruby:
 localhost:8080/db?queries=5
 
 JRuby:
-localhost:8080/sinatra/db?queries=5
+localhost:8080/db?queries=5

+ 5 - 5
sinatra/benchmark_config

@@ -24,10 +24,10 @@
     },
     "jruby": {
       "setup_file": "setup_jruby",
-      "json_url": "/sinatra/json",
-      "db_url": "/sinatra/db",
-      "query_url": "/sinatra/db?queries=",
-      "plaintext_url": "/sinatra/plaintext",
+      "json_url": "/json",
+      "db_url": "/db",
+      "query_url": "/db?queries=",
+      "plaintext_url": "/plaintext",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Micro",
@@ -36,7 +36,7 @@
       "language": "Ruby",
       "orm": "Full",
       "platform": "JRuby",
-      "webserver": "Resin",
+      "webserver": "TorqBox",
       "os": "Linux",
       "database_os": "Linux",
       "display_name": "sinatra-jruby",

+ 0 - 151
sinatra/config/warble.rb

@@ -1,151 +0,0 @@
-# Disable Rake-environment-task framework detection by uncommenting/setting to false
-# Warbler.framework_detection = false
-
-# Warbler web application assembly configuration file
-Warbler::Config.new do |config|
-  # Features: additional options controlling how the jar is built.
-  # Currently the following features are supported:
-  # - gemjar: package the gem repository in a jar file in WEB-INF/lib
-  # - executable: embed a web server and make the war executable
-  # - compiled: compile .rb files to .class files
-  # config.features = %w(gemjar)
-
-  # Application directories to be included in the webapp.
-  config.dirs = %w(app config lib log vendor tmp views)
-
-  # Additional files/directories to include, above those in config.dirs
-  config.includes = FileList["hello_world.rb"]
-
-  # Additional files/directories to exclude
-  # config.excludes = FileList["lib/tasks/*"]
-
-  # Additional Java .jar files to include.  Note that if .jar files are placed
-  # in lib (and not otherwise excluded) then they need not be mentioned here.
-  # JRuby and JRuby-Rack are pre-loaded in this list.  Be sure to include your
-  # own versions if you directly set the value
-  # config.java_libs += FileList["lib/java/*.jar"]
-
-  # Loose Java classes and miscellaneous files to be included.
-  # config.java_classes = FileList["target/classes/**.*"]
-
-  # One or more pathmaps defining how the java classes should be copied into
-  # the archive. The example pathmap below accompanies the java_classes
-  # configuration above. See http://rake.rubyforge.org/classes/String.html#M000017
-  # for details of how to specify a pathmap.
-  # config.pathmaps.java_classes << "%{target/classes/,}p"
-
-  # Bundler support is built-in. If Warbler finds a Gemfile in the
-  # project directory, it will be used to collect the gems to bundle
-  # in your application. If you wish to explicitly disable this
-  # functionality, uncomment here.
-  # config.bundler = false
-
-  # An array of Bundler groups to avoid including in the war file.
-  # Defaults to ["development", "test"].
-  # config.bundle_without = []
-
-  # Other gems to be included. If you don't use Bundler or a gemspec
-  # file, you need to tell Warbler which gems your application needs
-  # so that they can be packaged in the archive.
-  # For Rails applications, the Rails gems are included by default
-  # unless the vendor/rails directory is present.
-  # config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl"]
-  # config.gems << "tzinfo"
-
-  # Uncomment this if you don't want to package rails gem.
-  # config.gems -= ["rails"]
-
-  # The most recent versions of gems are used.
-  # You can specify versions of gems by using a hash assignment:
-  # config.gems["rails"] = "2.3.10"
-
-  # You can also use regexps or Gem::Dependency objects for flexibility or
-  # finer-grained control.
-  # config.gems << /^merb-/
-  # config.gems << Gem::Dependency.new("merb-core", "= 0.9.3")
-
-  # Include gem dependencies not mentioned specifically. Default is
-  # true, uncomment to turn off.
-  # config.gem_dependencies = false
-
-  # Array of regular expressions matching relative paths in gems to be
-  # excluded from the war. Defaults to empty, but you can set it like
-  # below, which excludes test files.
-  # config.gem_excludes = [/^(test|spec)\//]
-
-  # Pathmaps for controlling how application files are copied into the archive
-  # config.pathmaps.application = ["WEB-INF/%p"]
-
-  # Name of the archive (without the extension). Defaults to the basename
-  # of the project directory.
-  # config.jar_name = "mywar"
-
-  # Name of the MANIFEST.MF template for the war file. Defaults to a simple
-  # MANIFEST.MF that contains the version of Warbler used to create the war file.
-  # config.manifest_file = "config/MANIFEST.MF"
-
-  # When using the 'compiled' feature and specified, only these Ruby
-  # files will be compiled. Default is to compile all \.rb files in
-  # the application.
-  # config.compiled_ruby_files = FileList['app/**/*.rb']
-
-  # === War files only below here ===
-
-  # Path to the pre-bundled gem directory inside the war file. Default
-  # is 'WEB-INF/gems'. Specify path if gems are already bundled
-  # before running Warbler. This also sets 'gem.path' inside web.xml.
-  # config.gem_path = "WEB-INF/vendor/bundler_gems"
-
-  # Files for WEB-INF directory (next to web.xml). This contains
-  # web.xml by default. If there is an .erb-File it will be processed
-  # with webxml-config. You may want to exclude this file via
-  # config.excludes.
-  config.webinf_files += FileList["resin-web.xml"]
-
-  # Files to be included in the root of the webapp.  Note that files in public
-  # will have the leading 'public/' part of the path stripped during staging.
-  # config.public_html = FileList["public/**/*", "doc/**/*"]
-
-  # Pathmaps for controlling how public HTML files are copied into the .war
-  # config.pathmaps.public_html = ["%{public/,}p"]
-
-  # Embedded webserver to use with the 'executable' feature. Currently supported
-  # webservers are:
-  # * <tt>winstone</tt> (default) - Winstone 0.9.10 from sourceforge
-  # * <tt>jenkins-ci.winstone</tt> - Improved Winstone from Jenkins CI
-  # * <tt>jetty</tt> - Embedded Jetty from Eclipse
-  # config.webserver = 'jetty'
-
-  # Value of RAILS_ENV for the webapp -- default as shown below
-  # config.webxml.rails.env = ENV['RAILS_ENV'] || 'production'
-
-  # Application booter to use, one of :rack, :rails, or :merb (autodetected by default)
-  # config.webxml.booter = :rails
-
-  # Set JRuby to run in 1.9 mode.
-  # config.webxml.jruby.compat.version = "1.9"
-
-  # When using the :rack booter, "Rackup" script to use.
-  # - For 'rackup.path', the value points to the location of the rackup
-  # script in the web archive file. You need to make sure this file
-  # gets included in the war, possibly by adding it to config.includes
-  # or config.webinf_files above.
-  # - For 'rackup', the rackup script you provide as an inline string
-  #   is simply embedded in web.xml.
-  # The script is evaluated in a Rack::Builder to load the application.
-  # Examples:
-  # config.webxml.rackup.path = 'WEB-INF/hello.ru'
-  # config.webxml.rackup = %{require './lib/demo'; run Rack::Adapter::Camping.new(Demo)}
-  # config.webxml.rackup = require 'cgi' && CGI::escapeHTML(File.read("config.ru"))
-
-  # Control the pool of Rails runtimes. Leaving unspecified means
-  # the pool will grow as needed to service requests. It is recommended
-  # that you fix these values when running a production server!
-  # If you're using threadsafe! mode, you probably don't want to set these values,
-  # since 1 runtime(default for threadsafe mode) will be enough.
-  # config.webxml.jruby.min.runtimes = 16
-  # config.webxml.jruby.max.runtimes = 16
-
-  # JNDI data source name
-  config.webxml.jndi = 'jdbc/hello_world'
-end

+ 2 - 2
sinatra/hello_world.rb

@@ -6,7 +6,7 @@ set :logging, false
 set :activerecord_logger, nil
 
 if RUBY_PLATFORM == 'java'
-  set :database, { :adapter => 'jdbc', :jndi => 'java:comp/env/jdbc/hello_world', :pool => 256 }
+  set :database, { :adapter => 'jdbcmysql', :database => 'hello_world', :username => 'benchmarkdbuser', :password => 'benchmarkdbpass', :host => 'localhost', :pool => 256, :timeout => 5000 }
 else
   set :database, { :adapter => 'mysql2', :database => 'hello_world', :username => 'benchmarkdbuser', :password => 'benchmarkdbpass', :host => 'localhost', :pool => 256, :timeout => 5000 }
 end
@@ -33,4 +33,4 @@ get '/db' do
   end
   
   results.to_json
-end
+end

+ 0 - 13
sinatra/resin-web.xml

@@ -1,13 +0,0 @@
-<web-app xmlns="http://caucho.com/ns/resin">
-
-<database jndi-name='jdbc/hello_world'>
-  <driver>
-    <type>com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource</type>
-    <url>jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&amp;elideSetAutoCommits=true&amp;useLocalSessionState=true&amp;cachePrepStmts=true&amp;cacheCallableStmts=true&amp;alwaysSendSetIsolation=false&amp;prepStmtCacheSize=4096&amp;cacheServerConfiguration=true&amp;prepStmtCacheSqlLimit=2048&amp;zeroDateTimeBehavior=convertToNull&amp;traceProtocol=false&amp;useUnbufferedInput=false&amp;useReadAheadInput=false&amp;maintainTimeStats=false&amp;useServerPrepStmts&amp;cacheRSMetadata=true</url>
-    <user>benchmarkdbuser</user>
-    <password>benchmarkdbpass</password>
-    <useUnicode/>
-  </driver>
-</database>
-
-</web-app>

+ 9 - 8
sinatra/setup_jruby.py

@@ -4,22 +4,23 @@ import sys
 import setup_util
 
 def start(args, logfile, errfile):
-  setup_util.replace_text("sinatra/resin-web.xml", "mysql:\/\/.*:3306", "mysql://" + args.database_host + ":3306")
-
+  setup_util.replace_text("sinatra/hello_world.rb", ":host => '.*'", ":host => '" + args.database_host + "'")
   try:
-    subprocess.check_call("rvm jruby-1.7.4 do bundle install --gemfile=Gemfile-jruby", shell=True, cwd="sinatra", stderr=errfile, stdout=logfile)
+    subprocess.check_call("rvm jruby-1.7.8 do bundle install --gemfile=Gemfile-jruby", shell=True, cwd="sinatra", stderr=errfile, stdout=logfile)
     subprocess.check_call("cp Gemfile-jruby Gemfile", shell=True, cwd="sinatra", stderr=errfile, stdout=logfile)
     subprocess.check_call("cp Gemfile-jruby.lock Gemfile.lock", shell=True, cwd="sinatra", stderr=errfile, stdout=logfile)
-    subprocess.check_call("rvm jruby-1.7.4 do warble war", shell=True, cwd="sinatra", stderr=errfile, stdout=logfile)
-    subprocess.check_call("rm -rf $RESIN_HOME/webapps/*", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.check_call("cp sinatra.war $RESIN_HOME/webapps/sinatra.war", shell=True, cwd="sinatra", stderr=errfile, stdout=logfile)
-    subprocess.check_call("$RESIN_HOME/bin/resinctl start", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.Popen("rvm jruby-1.7.8 do bundle exec torqbox -E production", shell=True, cwd="sinatra", stderr=errfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
     return 1
 def stop(logfile, errfile):
   try:
-    subprocess.check_call("$RESIN_HOME/bin/resinctl shutdown", shell=True, stderr=errfile, stdout=logfile)
+    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
+    out, err = p.communicate()
+    for line in out.splitlines():
+      if 'torqbox' in line:
+        pid = int(line.split(None, 2)[1])
+        os.kill(pid, 9)
     subprocess.check_call("rm Gemfile", shell=True, cwd="sinatra", stderr=errfile, stdout=logfile)
     subprocess.check_call("rm Gemfile.lock", shell=True, cwd="sinatra", stderr=errfile, stdout=logfile)
     return 0

+ 0 - 5
toolset/deployment/common/remote/lsr-step-2.sh

@@ -28,10 +28,5 @@ echo "INSTALL: Creating MongoDB database"
 cd "$BENCHMARK_HOME" || fail "Error changing directory."
 retry mongo --host $BENCHMARK_CLIENT_IP < config/create.js || fail "Error creating MongoDB database."
 
-echo ""
-echo "INSTALL: Installing jruby-rack"
-bash -c 'source ~/.rvm/scripts/rvm && cd "$BENCHMARK_HOME/installs/jruby-rack" && rvm jruby-1.7.4 do jruby -S bundle exec rake clean gem SKIP_SPECS=true && cd target && rvm jruby-1.7.4 do gem install jruby-rack-1.2.0.SNAPSHOT.gem && echo "rvm commands finished"'
-# TODO rvm seems to abort the script after the command finishes
-
 echo ""
 echo "End of step 2"

+ 0 - 3
toolset/setup/README.md

@@ -61,9 +61,6 @@ When they are online again, connect via ssh to the Linux server and type these c
     ulimit -n 8192
     # Most software is installed automatically by the script, but running the mongo command below from
     # the install script was causing some errors. For now this needs to be run manually.
-    cd installs/jruby-rack && rvm jruby-1.7.4 do jruby -S bundle exec rake clean gem SKIP_SPECS=true
-    cd target && rvm jruby-1.7.4 do gem install jruby-rack-1.2.0.SNAPSHOT.gem
-    cd ../../..
     cd installs && curl -sS https://getcomposer.org/installer | php -- --install-dir=bin
     cd ..
     sudo apt-get remove --purge openjdk-6-jre openjdk-6-jre-headless

+ 2 - 8
toolset/setup/linux/installer.py

@@ -105,14 +105,8 @@ class Installer:
     self.__run_command("echo rvm_auto_reload_flag=2 >> ~/.rvmrc")
     self.__bash_from_string("source ~/.rvm/scripts/'rvm' && rvm install 2.0.0-p0")
     self.__bash_from_string("source ~/.rvm/scripts/'rvm' && rvm 2.0.0-p0 do gem install bundler")
-    self.__bash_from_string("source ~/.rvm/scripts/'rvm' && rvm install jruby-1.7.4")
-    self.__bash_from_string("source ~/.rvm/scripts/'rvm' && rvm jruby-1.7.4 do gem install bundler")
-
-    # We need a newer version of jruby-rack
-    self.__run_command("git clone git://github.com/jruby/jruby-rack.git", retry=True);
-    self.__bash_from_string("cd jruby-rack && source ~/.rvm/scripts/'rvm' && rvm jruby-1.7.4 do bundle install")
-    self.__bash_from_string("cd jruby-rack && source ~/.rvm/scripts/'rvm' && rvm jruby-1.7.4 do jruby -S bundle exec rake clean gem SKIP_SPECS=true")
-    self.__bash_from_string("cd jruby-rack/target && source ~/.rvm/scripts/'rvm' && rvm jruby-1.7.4 do gem install jruby-rack-1.2.0.SNAPSHOT.gem")
+    self.__bash_from_string("source ~/.rvm/scripts/'rvm' && rvm install jruby-1.7.8")
+    self.__bash_from_string("source ~/.rvm/scripts/'rvm' && rvm jruby-1.7.8 do gem install bundler")
 
     #
     # go