Browse Source

Docker ruby tests (#3422)

* Docker ruby

* h2o mruby

* fix failing postgres tests

* fix sinatra sequel postgres
Nate 7 years ago
parent
commit
908ddc5396
100 changed files with 247 additions and 1009 deletions
  1. 9 10
      .travis.yml
  2. 0 4
      frameworks/Ruby/grape/.gitignore
  3. 4 15
      frameworks/Ruby/grape/Gemfile
  4. 0 24
      frameworks/Ruby/grape/benchmark_config.json
  5. 1 0
      frameworks/Ruby/grape/config.ru
  6. 3 3
      frameworks/Ruby/grape/config/database.yml
  7. 2 2
      frameworks/Ruby/grape/config/nginx.conf
  8. 0 10
      frameworks/Ruby/grape/config/thin.yml
  9. 0 8
      frameworks/Ruby/grape/config/trinidad.yml
  10. 1 1
      frameworks/Ruby/grape/config/unicorn.rb
  11. 16 0
      frameworks/Ruby/grape/grape-unicorn.dockerfile
  12. 9 0
      frameworks/Ruby/grape/grape.dockerfile
  13. 0 9
      frameworks/Ruby/grape/run_mri_puma.sh
  14. 0 9
      frameworks/Ruby/grape/run_mri_thin.sh
  15. 0 12
      frameworks/Ruby/grape/run_mri_unicorn.sh
  16. 0 1
      frameworks/Ruby/h2o_mruby/benchmark_config.json
  17. 5 0
      frameworks/Ruby/h2o_mruby/h2o_mruby.dockerfile
  18. 0 5
      frameworks/Ruby/h2o_mruby/setup.sh
  19. 0 56
      frameworks/Ruby/hanami/.gitignore
  20. 7 13
      frameworks/Ruby/hanami/Gemfile
  21. 0 149
      frameworks/Ruby/hanami/Gemfile.lock
  22. 0 25
      frameworks/Ruby/hanami/benchmark_config.json
  23. 1 1
      frameworks/Ruby/hanami/config/nginx.conf
  24. 0 10
      frameworks/Ruby/hanami/config/thin.yml
  25. 17 0
      frameworks/Ruby/hanami/hanami-unicorn.dockerfile
  26. 9 0
      frameworks/Ruby/hanami/hanami.dockerfile
  27. 0 7
      frameworks/Ruby/hanami/run_mri_puma.sh
  28. 0 7
      frameworks/Ruby/hanami/run_mri_thin.sh
  29. 0 11
      frameworks/Ruby/hanami/run_mri_unicorn.sh
  30. 0 1
      frameworks/Ruby/ngx_mruby/.gitignore
  31. 0 36
      frameworks/Ruby/ngx_mruby/README.md
  32. 0 26
      frameworks/Ruby/ngx_mruby/benchmark_config.json
  33. 0 6
      frameworks/Ruby/ngx_mruby/db.rb
  34. 0 52
      frameworks/Ruby/ngx_mruby/nginx.conf
  35. 0 27
      frameworks/Ruby/ngx_mruby/queries.rb
  36. 0 36
      frameworks/Ruby/ngx_mruby/setup.sh
  37. 0 4
      frameworks/Ruby/ngx_mruby/source_code
  38. 0 31
      frameworks/Ruby/ngx_mruby/updates.rb
  39. 0 4
      frameworks/Ruby/padrino/.gitignore
  40. 5 16
      frameworks/Ruby/padrino/Gemfile
  41. 0 25
      frameworks/Ruby/padrino/benchmark_config.json
  42. 1 1
      frameworks/Ruby/padrino/config/nginx.conf
  43. 0 10
      frameworks/Ruby/padrino/config/thin.yml
  44. 0 8
      frameworks/Ruby/padrino/config/trinidad.yml
  45. 17 0
      frameworks/Ruby/padrino/padrino-unicorn.dockerfile
  46. 9 0
      frameworks/Ruby/padrino/padrino.dockerfile
  47. BIN
      frameworks/Ruby/padrino/public/favicon.ico
  48. 0 7
      frameworks/Ruby/padrino/run_mri_puma.sh
  49. 0 7
      frameworks/Ruby/padrino/run_thin.sh
  50. 0 11
      frameworks/Ruby/padrino/run_unicorn.sh
  51. 0 4
      frameworks/Ruby/rack-sequel/.gitignore
  52. 0 8
      frameworks/Ruby/rack-sequel/benchmark_config.json
  53. 0 6
      frameworks/Ruby/rack-sequel/config/bundle_install.sh
  54. 0 13
      frameworks/Ruby/rack-sequel/config/common_run.sh
  55. 7 0
      frameworks/Ruby/rack-sequel/rack-sequel-base.dockerfile
  56. 12 0
      frameworks/Ruby/rack-sequel/rack-sequel-jruby-base.dockerfile
  57. 12 0
      frameworks/Ruby/rack-sequel/rack-sequel-passenger-mri.dockerfile
  58. 11 0
      frameworks/Ruby/rack-sequel/rack-sequel-postgres-passenger-mri.dockerfile
  59. 4 0
      frameworks/Ruby/rack-sequel/rack-sequel-postgres-torquebox-jruby.dockerfile
  60. 4 0
      frameworks/Ruby/rack-sequel/rack-sequel-postgres-unicorn-mri.dockerfile
  61. 4 0
      frameworks/Ruby/rack-sequel/rack-sequel-postgres.dockerfile
  62. 4 0
      frameworks/Ruby/rack-sequel/rack-sequel-torquebox-jruby.dockerfile
  63. 4 0
      frameworks/Ruby/rack-sequel/rack-sequel-unicorn-mri.dockerfile
  64. 4 0
      frameworks/Ruby/rack-sequel/rack-sequel.dockerfile
  65. 0 13
      frameworks/Ruby/rack-sequel/run_jruby_puma.sh
  66. 0 13
      frameworks/Ruby/rack-sequel/run_jruby_torquebox.sh
  67. 0 20
      frameworks/Ruby/rack-sequel/run_mri_passenger.sh
  68. 0 11
      frameworks/Ruby/rack-sequel/run_mri_puma.sh
  69. 0 11
      frameworks/Ruby/rack-sequel/run_mri_unicorn.sh
  70. 0 4
      frameworks/Ruby/rack/.gitignore
  71. 3 14
      frameworks/Ruby/rack/Gemfile
  72. 0 21
      frameworks/Ruby/rack/benchmark_config.json
  73. 1 1
      frameworks/Ruby/rack/config/database.yml
  74. 1 1
      frameworks/Ruby/rack/config/nginx.conf
  75. 0 10
      frameworks/Ruby/rack/config/thin.yml
  76. 0 9
      frameworks/Ruby/rack/config/trinidad.yml
  77. BIN
      frameworks/Ruby/rack/lib/mysql-connector-java-5.1.28-bin.jar
  78. 0 0
      frameworks/Ruby/rack/public/.gitkeep
  79. 16 0
      frameworks/Ruby/rack/rack-unicorn.dockerfile
  80. 9 0
      frameworks/Ruby/rack/rack.dockerfile
  81. 0 9
      frameworks/Ruby/rack/run_mri_puma.sh
  82. 0 9
      frameworks/Ruby/rack/run_mri_thin.sh
  83. 0 12
      frameworks/Ruby/rack/run_mri_unicorn.sh
  84. 0 4
      frameworks/Ruby/rails/.gitignore
  85. 6 17
      frameworks/Ruby/rails/Gemfile
  86. BIN
      frameworks/Ruby/rails/app/assets/images/rails.png
  87. 0 15
      frameworks/Ruby/rails/app/assets/javascripts/application.js
  88. 0 13
      frameworks/Ruby/rails/app/assets/stylesheets/application.css
  89. 0 0
      frameworks/Ruby/rails/app/mailers/.gitkeep
  90. 0 25
      frameworks/Ruby/rails/benchmark_config.json
  91. 2 2
      frameworks/Ruby/rails/config/database.yml
  92. 1 1
      frameworks/Ruby/rails/config/nginx.conf
  93. 0 10
      frameworks/Ruby/rails/config/thin.yml
  94. 0 8
      frameworks/Ruby/rails/config/trinidad.yml
  95. 0 0
      frameworks/Ruby/rails/public/.keep
  96. 17 0
      frameworks/Ruby/rails/rails-unicorn.dockerfile
  97. 9 0
      frameworks/Ruby/rails/rails.dockerfile
  98. 0 7
      frameworks/Ruby/rails/run_mri_puma.sh
  99. 0 7
      frameworks/Ruby/rails/run_mri_thin.sh
  100. 0 11
      frameworks/Ruby/rails/run_mri_unicorn.sh

+ 9 - 10
.travis.yml

@@ -170,17 +170,16 @@ env:
      - "TESTDIR=Python/weppy"
      - "TESTDIR=Python/wheezyweb"
      - "TESTDIR=Python/wsgi"
-    # - "TESTDIR=Ruby/grape"
+     - "TESTDIR=Ruby/grape"
     # - "TESTDIR=Ruby/h2o_mruby"
-    # - "TESTDIR=Ruby/hanami"
-    # - "TESTDIR=Ruby/ngx_mruby"
-    # - "TESTDIR=Ruby/padrino"
-    # - "TESTDIR=Ruby/rack"
-    # - "TESTDIR=Ruby/rack-sequel"
-    # - "TESTDIR=Ruby/rails"
-    # - "TESTDIR=Ruby/roda-sequel"
-    # - "TESTDIR=Ruby/sinatra"
-    # - "TESTDIR=Ruby/sinatra-sequel"
+     - "TESTDIR=Ruby/hanami"
+     - "TESTDIR=Ruby/padrino"
+     - "TESTDIR=Ruby/rack"
+     - "TESTDIR=Ruby/rack-sequel"
+     - "TESTDIR=Ruby/rails"
+     - "TESTDIR=Ruby/roda-sequel"
+     - "TESTDIR=Ruby/sinatra"
+     - "TESTDIR=Ruby/sinatra-sequel"
      - "TESTDIR=Rust/iron"
      - "TESTDIR=Rust/nickel"
      - "TESTDIR=Rust/hyper"

+ 0 - 4
frameworks/Ruby/grape/.gitignore

@@ -1,4 +0,0 @@
-.bundle
-/vendor/
-/tmp/
-Gemfile.lock

+ 4 - 15
frameworks/Ruby/grape/Gemfile

@@ -1,21 +1,10 @@
 source 'http://rubygems.org'
 
-platforms :jruby do
-  gem 'activerecord-jdbcmysql-adapter', '~> 1.3.9', :require => false
-  gem 'torquebox', '3.2.0'
-  gem 'trinidad', '1.4.6'
-end
-
-platforms :ruby do
-  gem 'mysql2', '0.4.5'
-  gem 'unicorn', '5.3.0'
-  gem 'thin', '1.7.0'
-end
-
+gem 'mysql2', '0.4.10'
+gem 'unicorn', '5.3.0'
 gem 'puma', '~> 3.9.1'
-
-gem 'activerecord', '5.1.0', :require => 'active_record'
+gem 'activerecord', '5.1.5', :require => 'active_record'
 gem 'activerecord-import', "~> 0.18.1"
-gem 'grape', '0.19.2'
+gem 'grape', '1.0.2'
 gem 'rack', '1.6.5'
 gem 'json', '2.1.0'

+ 0 - 24
frameworks/Ruby/grape/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "grape",
   "tests": [{
     "default": {
-      "setup_file": "run_mri_puma",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/query?queries=",
@@ -23,30 +22,7 @@
       "notes": "",
       "versus": "rack-puma-mri"
     },
-    "thin": {
-      "setup_file": "run_mri_thin",
-      "json_url": "/json",
-      "db_url": "/db",
-      "query_url": "/query?queries=",
-      "update_url": "/updates?queries=",
-      "plaintext_url": "/plaintext",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Micro",
-      "database": "MySQL",
-      "framework": "grape",
-      "language": "Ruby",
-      "orm": "Full",
-      "platform": "Rack",
-      "webserver": "Thin",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "grape-thin-mri",
-      "notes": "",
-      "versus": "rack-thin-mri"
-    },
     "unicorn": {
-      "setup_file": "run_mri_unicorn",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/query?queries=",

+ 1 - 0
frameworks/Ruby/grape/config.ru

@@ -1,5 +1,6 @@
 require 'erb'
 require 'active_record'
+require 'yaml'
 
 Bundler.require :default
 

+ 3 - 3
frameworks/Ruby/grape/config/database.yml

@@ -1,9 +1,9 @@
 production:
-  adapter: <%= RUBY_PLATFORM == 'java' ? 'jdbcmysql' : 'mysql2' %>
+  adapter: mysql2
   encoding: utf8
-  host: localhost
+  host: TFB-database
   database: hello_world
   username: benchmarkdbuser
   password: benchmarkdbpass
-  pool: 256
+  pool: 512
   timeout: 5000

+ 2 - 2
frameworks/Ruby/grape/config/nginx.conf

@@ -37,7 +37,7 @@ events {
 
 http {
   # nginx will find this file in the config directory set at nginx build time
-  include /usr/local/nginx/conf/mime.types;
+  include /nginx/conf/mime.types;
 
   # fallback in case we can't determine a type
   default_type application/octet-stream;
@@ -76,7 +76,7 @@ http {
     # single worker for timing out).
 
     # for UNIX domain socket setups:
-    server unix:/tmp/.sock fail_timeout=0;
+    server unix:/tmp/unicorn.sock fail_timeout=0;
 
     # for TCP setups, point these to your backend servers
     # server 192.168.0.7:8080 fail_timeout=0;

+ 0 - 10
frameworks/Ruby/grape/config/thin.yml

@@ -1,10 +0,0 @@
---- 
-timeout: 30
-wait: 30
-max_conns: 1024
-max_persistent_conns: 512
-environment: production
-port: 8080
-servers: 8
-log: /tmp/thin.log
-quiet: true

+ 0 - 8
frameworks/Ruby/grape/config/trinidad.yml

@@ -1,8 +0,0 @@
----
-  port: 8080
-  threadsafe: true
-  environment: production
-  http:
-    address: '*'
-  logging:
-    level: SEVERE

+ 1 - 1
frameworks/Ruby/grape/config/unicorn.rb

@@ -1,5 +1,5 @@
 worker_processes 8
-listen "/tmp/.sock", :backlog => 4096
+listen "/tmp/unicorn.sock", :backlog => 4096
 
 preload_app true
 GC.respond_to?(:copy_on_write_friendly=) and GC.copy_on_write_friendly = true

+ 16 - 0
frameworks/Ruby/grape/grape-unicorn.dockerfile

@@ -0,0 +1,16 @@
+FROM tfb/nginx:latest
+
+FROM tfb/ruby-2.4:latest
+
+COPY --from=0 /nginx /nginx
+
+ENV NGINX_HOME="/nginx"
+ENV PATH=/nginx/sbin:${PATH}
+
+ADD ./ /grape
+
+WORKDIR /grape
+
+RUN bundle install --jobs=4 --gemfile=/grape/Gemfile --path=/grape/grape/bundle
+
+CMD nginx -c /grape/config/nginx.conf && bundle exec unicorn -E production -c config/unicorn.rb

+ 9 - 0
frameworks/Ruby/grape/grape.dockerfile

@@ -0,0 +1,9 @@
+FROM tfb/ruby-2.4:latest
+
+ADD ./ /grape
+
+WORKDIR /grape
+
+RUN bundle install --jobs=4 --gemfile=/grape/Gemfile --path=/grape/grape/bundle
+
+CMD bundle exec puma -t 8:32 -w 8 --preload -b tcp://0.0.0.0:8080 -e production

+ 0 - 9
frameworks/Ruby/grape/run_mri_puma.sh

@@ -1,9 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm ruby-2.4
-
-sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/grape/bundle
-
-rvm ruby-$MRI_VERSION do bundle exec puma -t 8:32 -w 8 --preload -b tcp://0.0.0.0:8080 -e production &

+ 0 - 9
frameworks/Ruby/grape/run_mri_thin.sh

@@ -1,9 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm ruby-2.4
-
-sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/grape/bundle
-
-rvm ruby-$MRI_VERSION do bundle exec thin start -C config/thin.yml &

+ 0 - 12
frameworks/Ruby/grape/run_mri_unicorn.sh

@@ -1,12 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm nginx ruby-2.4
-
-sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
-sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
-
-nginx -c $TROOT/config/nginx.conf
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/grape/bundle
-
-rvm ruby-$MRI_VERSION do bundle exec unicorn -E production -c config/unicorn.rb &

+ 0 - 1
frameworks/Ruby/h2o_mruby/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "h2o_mruby",
   "tests": [{
     "default": {
-      "setup_file": "setup",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "port": 8080,

+ 5 - 0
frameworks/Ruby/h2o_mruby/h2o_mruby.dockerfile

@@ -0,0 +1,5 @@
+FROM tfb/h2o:latest
+
+ADD ./h2o.conf /h2o_mruby/
+
+CMD "${H2O_HOME}/bin/h2o" -c "/h2o_mruby/h2o.conf"

+ 0 - 5
frameworks/Ruby/h2o_mruby/setup.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-fw_depends h2o
-
-"${H2O_HOME}/bin/h2o" -c "$TROOT/h2o.conf" -m daemon

+ 0 - 56
frameworks/Ruby/hanami/.gitignore

@@ -1,56 +0,0 @@
-/public/assets*
-/tmp
-
-# Except the .gitkeep
-!.gitkeep
-
-### Ruby ###
-*.gem
-*.rbc
-/.config
-/coverage/
-/InstalledFiles
-/pkg/
-/spec/reports/
-/spec/examples.txt
-/test/tmp/
-/test/version_tmp/
-/tmp/
-
-# Used by dotenv library to load environment variables.
-# .env
-
-## Specific to RubyMotion:
-.dat*
-.repl_history
-build/
-*.bridgesupport
-build-iPhoneOS/
-build-iPhoneSimulator/
-
-## Specific to RubyMotion (use of CocoaPods):
-#
-# We recommend against adding the Pods directory to your .gitignore. However
-# you should judge for yourself, the pros and cons are mentioned at:
-# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
-#
-# vendor/Pods/
-
-## Documentation cache and generated files:
-/.yardoc/
-/_yardoc/
-/doc/
-/rdoc/
-
-## Environment normalization:
-/.bundle/
-/vendor/bundle
-
-# for a library or gem, you might want to ignore these files since the code is
-# intended to run in multiple environments; otherwise, check them in:
-# Gemfile.lock
-# .ruby-version
-# .ruby-gemset
-
-# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
-.rvmrc

+ 7 - 13
frameworks/Ruby/hanami/Gemfile

@@ -1,15 +1,9 @@
 source 'https://rubygems.org'
 
-gem 'rake'
-gem 'hanami',       '~> 1.0'
-gem 'hanami-model', '~> 1.0'
-
-gem 'mysql2'
-
-gem 'rom-sql'
-
-group :production do
-  gem 'puma', "~> 3.9.1"
-  gem 'unicorn'
-  gem 'thin'
-end
+gem 'rake', '12.3.0'
+gem 'hanami', '1.1.0'
+gem 'hanami-model', '1.1.0'
+gem 'mysql2', '0.4.10'
+gem 'unicorn', '5.3.0'
+gem 'rom-sql', '1.3.5'
+gem 'puma', '3.9.1'

+ 0 - 149
frameworks/Ruby/hanami/Gemfile.lock

@@ -1,149 +0,0 @@
-GEM
-  remote: https://rubygems.org/
-  specs:
-    concurrent-ruby (1.0.5)
-    daemons (1.2.4)
-    dry-configurable (0.7.0)
-      concurrent-ruby (~> 1.0)
-    dry-container (0.6.0)
-      concurrent-ruby (~> 1.0)
-      dry-configurable (~> 0.1, >= 0.1.3)
-    dry-core (0.3.1)
-      concurrent-ruby (~> 1.0)
-    dry-equalizer (0.2.0)
-    dry-initializer (1.4.1)
-    dry-logic (0.4.1)
-      dry-container (~> 0.2, >= 0.2.6)
-      dry-core (~> 0.2)
-      dry-equalizer (~> 0.2)
-    dry-struct (0.3.0)
-      dry-configurable (~> 0.1)
-      dry-core (~> 0.3)
-      dry-equalizer (~> 0.2)
-      dry-types (~> 0.9, >= 0.9.0)
-      ice_nine (~> 0.11)
-    dry-types (0.10.3)
-      concurrent-ruby (~> 1.0)
-      dry-configurable (~> 0.1)
-      dry-container (~> 0.3)
-      dry-core (~> 0.2, >= 0.2.1)
-      dry-equalizer (~> 0.2)
-      dry-logic (~> 0.4, >= 0.4.0)
-      inflecto (~> 0.0.0, >= 0.0.2)
-    dry-validation (0.10.7)
-      concurrent-ruby (~> 1.0)
-      dry-configurable (~> 0.1, >= 0.1.3)
-      dry-core (~> 0.2, >= 0.2.1)
-      dry-equalizer (~> 0.2)
-      dry-logic (~> 0.4, >= 0.4.0)
-      dry-types (~> 0.9, >= 0.9.0)
-    eventmachine (1.2.3)
-    hanami (1.0.0)
-      bundler (~> 1.13)
-      concurrent-ruby (~> 1.0)
-      hanami-assets (~> 1.0)
-      hanami-controller (~> 1.0)
-      hanami-helpers (~> 1.0)
-      hanami-mailer (~> 1.0)
-      hanami-router (~> 1.0)
-      hanami-utils (~> 1.0)
-      hanami-validations (~> 1.0)
-      hanami-view (~> 1.0)
-      thor (~> 0.19)
-    hanami-assets (1.0.0)
-      hanami-helpers (~> 1.0)
-      hanami-utils (~> 1.0)
-      tilt (~> 2.0, >= 2.0.2)
-    hanami-controller (1.0.0)
-      hanami-utils (~> 1.0)
-      rack (~> 2.0)
-    hanami-helpers (1.0.0)
-      hanami-utils (~> 1.0)
-    hanami-mailer (1.0.0)
-      hanami-utils (~> 1.0)
-      mail (~> 2.5)
-      tilt (~> 2.0, >= 2.0.1)
-    hanami-model (1.0.0)
-      concurrent-ruby (~> 1.0)
-      dry-types (~> 0.9)
-      hanami-utils (~> 1.0)
-      rom-repository (~> 1.3)
-      rom-sql (~> 1.2)
-    hanami-router (1.0.0)
-      hanami-utils (~> 1.0)
-      http_router (= 0.11.2)
-      rack (~> 2.0)
-    hanami-utils (1.0.0)
-    hanami-validations (1.0.0)
-      dry-validation (~> 0.10)
-      hanami-utils (~> 1.0)
-    hanami-view (1.0.0)
-      hanami-utils (~> 1.0)
-      tilt (~> 2.0, >= 2.0.1)
-    http_router (0.11.2)
-      rack (>= 1.0.0)
-      url_mount (~> 0.2.1)
-    ice_nine (0.11.2)
-    inflecto (0.0.2)
-    kgio (2.11.0)
-    mail (2.6.5)
-      mime-types (>= 1.16, < 4)
-    mime-types (3.1)
-      mime-types-data (~> 3.2015)
-    mime-types-data (3.2016.0521)
-    mysql2 (0.4.6)
-    puma (3.9.1)
-    rack (2.0.3)
-    raindrops (0.18.0)
-    rake (12.0.0)
-    rom (3.2.3)
-      concurrent-ruby (~> 1.0)
-      dry-core (~> 0.3)
-      dry-equalizer (~> 0.2)
-      dry-initializer (~> 1.3)
-      dry-types (~> 0.9, >= 0.9.4)
-      rom-mapper (~> 0.5, >= 0.5.1)
-    rom-mapper (0.5.1)
-      dry-core (~> 0.2, >= 0.2.3)
-      dry-equalizer (~> 0.2)
-      transproc (~> 1.0)
-    rom-repository (1.3.3)
-      dry-core (~> 0.3, >= 0.3.1)
-      dry-struct (~> 0.1)
-      rom (~> 3.2, >= 3.2.3)
-      rom-mapper (~> 0.5)
-    rom-sql (1.3.3)
-      dry-core (~> 0.3)
-      dry-equalizer (~> 0.2)
-      dry-types (~> 0.10, >= 0.10.2)
-      rom (~> 3.2, >= 3.2.2)
-      sequel (~> 4.43)
-    sequel (4.47.0)
-    thin (1.7.0)
-      daemons (~> 1.0, >= 1.0.9)
-      eventmachine (~> 1.0, >= 1.0.4)
-      rack (>= 1, < 3)
-    thor (0.19.4)
-    tilt (2.0.7)
-    transproc (1.0.2)
-    unicorn (5.3.0)
-      kgio (~> 2.6)
-      raindrops (~> 0.7)
-    url_mount (0.2.1)
-      rack
-
-PLATFORMS
-  ruby
-
-DEPENDENCIES
-  hanami (~> 1.0)
-  hanami-model (~> 1.0)
-  mysql2
-  puma (~> 3.9.1)
-  rake
-  rom-sql
-  thin
-  unicorn
-
-BUNDLED WITH
-   1.15.1

+ 0 - 25
frameworks/Ruby/hanami/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "hanami",
   "tests": [{
     "default": {
-      "setup_file": "run_mri_puma",
       "json_url": "/hello_world/json",
       "db_url": "/hello_world/db",
       "query_url": "/hello_world/query?queries=",
@@ -24,31 +23,7 @@
       "notes": "",
       "versus": "rack-puma-mri"
     },
-    "thin": {
-      "setup_file": "run_mri_thin",
-      "json_url": "/hello_world/json",
-      "db_url": "/hello_world/db",
-      "query_url": "/hello_world/query?queries=",
-      "fortune_url": "/fortune",
-      "update_url": "/update?queries=",
-      "plaintext_url": "/plaintext",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "MySQL",
-      "framework": "hanami",
-      "language": "Ruby",
-      "orm": "Full",
-      "platform": "Rack",
-      "webserver": "Thin",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "hanami-thin-mri",
-      "notes": "",
-      "versus": "rack-thin-mri"
-    },
     "unicorn": {
-      "setup_file": "run_mri_unicorn",
       "json_url": "/hello_world/json",
       "db_url": "/hello_world/db",
       "query_url": "/hello_world/query?queries=",

+ 1 - 1
frameworks/Ruby/hanami/config/nginx.conf

@@ -37,7 +37,7 @@ events {
 
 http {
   # nginx will find this file in the config directory set at nginx build time
-  include /usr/local/nginx/conf/mime.types;
+  include /nginx/conf/mime.types;
 
   # fallback in case we can't determine a type
   default_type application/octet-stream;

+ 0 - 10
frameworks/Ruby/hanami/config/thin.yml

@@ -1,10 +0,0 @@
---- 
-timeout: 30
-wait: 30
-max_conns: 1024
-max_persistent_conns: 512
-environment: production
-port: 8080
-servers: 8
-log: /tmp/thin.log
-quiet: true

+ 17 - 0
frameworks/Ruby/hanami/hanami-unicorn.dockerfile

@@ -0,0 +1,17 @@
+FROM tfb/nginx:latest
+
+FROM tfb/ruby-2.4:latest
+
+COPY --from=0 /nginx /nginx
+
+ENV NGINX_HOME="/nginx"
+ENV PATH=/nginx/sbin:${PATH}
+
+ADD ./ /hanami
+
+WORKDIR /hanami
+
+RUN bundle install --jobs=4 --gemfile=/hanami/Gemfile --path=/hanami/hanami/bundle
+
+CMD nginx -c /hanami/config/nginx.conf && \
+    RACK_ENV=none DB_HOST=TFB-database bundle exec unicorn_rails -E production -c config/unicorn.rb

+ 9 - 0
frameworks/Ruby/hanami/hanami.dockerfile

@@ -0,0 +1,9 @@
+FROM tfb/ruby-2.4:latest
+
+ADD ./ /hanami
+
+WORKDIR /hanami
+
+RUN bundle install --jobs=4 --gemfile=/hanami/Gemfile --path=/hanami/hanami/bundle
+
+CMD DB_HOST=TFB-database bundle exec puma -t 8:32 -w 8 --preload -b tcp://0.0.0.0:8080 -e production

+ 0 - 7
frameworks/Ruby/hanami/run_mri_puma.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm ruby-2.4
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/hanami/bundle
-
-DB_HOST=${DBHOST} rvm ruby-$MRI_VERSION do bundle exec puma -t 8:32 -w 8 --preload -b tcp://0.0.0.0:8080 -e production &

+ 0 - 7
frameworks/Ruby/hanami/run_mri_thin.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm ruby-2.4
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/hanami/bundle
-
-DB_HOST=${DBHOST} rvm ruby-$MRI_VERSION do bundle exec thin start -C config/thin.yml &

+ 0 - 11
frameworks/Ruby/hanami/run_mri_unicorn.sh

@@ -1,11 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm ruby-2.4 nginx
-
-sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/hanami/bundle
-
-nginx -c $TROOT/config/nginx.conf
-
-RACK_ENV=none DB_HOST=${DBHOST} rvm ruby-$MRI_VERSION do bundle exec unicorn_rails -E production -c $TROOT/config/unicorn.rb &

+ 0 - 1
frameworks/Ruby/ngx_mruby/.gitignore

@@ -1 +0,0 @@
-/ngx_mruby/

+ 0 - 36
frameworks/Ruby/ngx_mruby/README.md

@@ -1,36 +0,0 @@
-# [nginx + mruby](https://github.com/matsumoto-r/ngx_mruby) Benchmark Test
-
-The information below contains information specific to nginx + mruby. 
-For further guidance, review the 
-[documentation](http://frameworkbenchmarks.readthedocs.org/en/latest/). 
-Also note the additional information provided in the [Ruby README](../).
-
-This is the nginx + mruby portion of a [benchmarking test suite](../../) 
-comparing a variety of web platforms.
-
----
-
-The nginx app is distributes across a few files. most of it is in [nginx.conf](nginx.conf)
-The nginx conf is inside [nginx.conf](nginx.conf)
-Requires a nginx compiled with ngx_mruby module. It has been called nginx_mruby for lack of a better name
-
-## Infrastructure Software Versions
-
-The tests were run with:
-
-* [Ruby 2.0.0-p0](http://www.ruby-lang.org/)
-
-## Paths & Source for Tests
-
-* [JSON Serialization](nginx.conf): "/json"
-* [Single Database Query](db.rb): "/db"
-* [Multiple Database Query](queries.rb): "/queries?queries={#}"
-* _Fortunes: N/A_
-* _Database Updates: N/A_
-* [Plaintext](nginx.conf): "/plaintext"
-
-## Get Help
-
-### Experts
-
-_No experts listed, yet. If you're an expert, add yourself!_

+ 0 - 26
frameworks/Ruby/ngx_mruby/benchmark_config.json

@@ -1,26 +0,0 @@
-{
-  "framework": "ngx_mruby",
-  "tests": [{
-    "default": {
-      "setup_file": "setup",
-      "json_url": "/json",
-      "db_url": "/db",
-      "query_url": "/queries?queries=",
-      "plaintext_url": "/plaintext",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Micro",
-      "database": "MySQL",
-      "framework": "ngx_mruby",
-      "language": "Ruby",
-      "orm": "Raw",
-      "platform": "None",
-      "webserver": "nginx",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "ngx_mruby",
-      "notes": "",
-      "versus": "ngx_mruby"
-    }
-  }]
-}

+ 0 - 6
frameworks/Ruby/ngx_mruby/db.rb

@@ -1,6 +0,0 @@
-# https://github.com/mattn/mruby-mysql/blob/master/example/example.rb
-db = Userdata.new("my_#{Process.pid}").db
-result_set = db.execute("select * from World where id = ?", rand(10000))
-world = Hash[result_set.fields.zip(result_set.next)]
-result_set.close
-Nginx.rputs JSON::stringify(world)

+ 0 - 52
frameworks/Ruby/ngx_mruby/nginx.conf

@@ -1,52 +0,0 @@
-pid        /tmp/nginx.pid;
-error_log stderr error;
-worker_processes auto;
-
-events {
-    worker_connections  16384;
-    multi_accept on;
-}
-
-http {
-    resolver 127.0.0.1;
-    access_log off;
-    mruby_init_worker_code 'Userdata.new("my_#{Process.pid}").db = MySQL::Database.new("DBHOSTNAME", "benchmarkdbuser", "benchmarkdbpass", "hello_world")';
-    mruby_exit_worker_code 'db = Userdata.new("my_#{Process.pid}").db ; db.close if db';
-    server {
-        listen       8080;
-        server_name  localhost;
-
-        location / {
-            root   html;
-            index  index.html index.htm;
-        }
-
-        location /plaintext {
-            default_type "text/plain";
-            mruby_content_handler_code 'Nginx.rputs "Hello, world!"';
-        }
-
-        location /json {
-            default_type "application/json";
-            mruby_content_handler_code 'Nginx.rputs JSON::stringify("message" => "Hello, World!")';
-        }
-
-        location ~ /db {
-            default_type "application/json";
-            #note: next line has cwd
-            mruby_content_handler 'CWD/db.rb' cache;
-        }
-
-        location ~ /queries {
-            default_type "application/json";
-            #note: next line has cwd
-            mruby_content_handler 'CWD/queries.rb' cache;
-        }
-
-#        location ~ /fortunes {
-#            default_type "application/html";
-#            #note: next line has cwd
-#            mruby_content_handler 'CWD/fortunes.rb' cache;
-#        }
-    }
-}

+ 0 - 27
frameworks/Ruby/ngx_mruby/queries.rb

@@ -1,27 +0,0 @@
-class World
-  def db
-    @db ||= Userdata.new("my_#{Process.pid}").db
-  end
-
-  def find(id)
-    ret = nil
-    db.execute("select * from World where id = ?", id) do |row, fields|
-      ret = Hash[fields.zip(row)]
-    end
-    ret
-  end
-
-  def save(world)
-    db.execute("update World set randomNumber = ? where id = ?", world["randomNumber"], world["randomNumber"])
-  end
-end
-
-r = Nginx::Request.new
-
-num_queries = r.var.arg_queries.to_i
-num_queries = 1 if num_queries < 1
-num_queries = 500 if num_queries > 500
-
-world = World.new
-ret = num_queries.times.map { world.find(rand(10000)) }
-Nginx.rputs JSON::stringify(ret)

+ 0 - 36
frameworks/Ruby/ngx_mruby/setup.sh

@@ -1,36 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm nginx libhiredis-dev
-
-# We assume single-user installation as 
-# done in our rvm.sh script and 
-# in Travis-CI
-if [ "$TRAVIS" = "true" ]
-then
-  rvmsudo rvm install ruby-2.0
-else
-  rvm install ruby-2.0
-fi
-
-sed -i 's|CWD|'"${TROOT}"'|g' nginx.conf
-sed -i 's|DBHOSTNAME|'"${DBHOST}"'|g' nginx.conf
-
-rvm use ruby-2.0
-
-RETCODE=$(fw_exists ${IROOT}/nginx_mruby.installed)
-[ "$RETCODE" == 0 ] || { \
-  git clone git://github.com/matsumoto-r/ngx_mruby.git
-  cd ngx_mruby
-  git submodule init
-  git submodule update
-  [ -d mruby/mrbgems/mruby-mysql ] || git clone git://github.com/mattn/mruby-mysql.git mruby/mrbgems/mruby-mysql
-
-  NGINX_CONFIG_OPT_ENV="--prefix=${IROOT}/nginx_mruby --with-http_stub_status_module" sh build.sh
-  make install
-
-  echo -e "export PATH=${IROOT}/nginx_mruby/sbin:\$PATH" > $IROOT/nginx_mruby.installed
-}
-
-source $IROOT/nginx_mruby.installed
-
-nginx -c $TROOT/nginx.conf &

+ 0 - 4
frameworks/Ruby/ngx_mruby/source_code

@@ -1,4 +0,0 @@
-./ngx_mruby/db.rb
-./ngx_mruby/fortune.rb
-./ngx_mruby/queries.rb
-./ngx_mruby/updates.rb

+ 0 - 31
frameworks/Ruby/ngx_mruby/updates.rb

@@ -1,31 +0,0 @@
-r = Nginx::Request.new
-
-num_queries = r.var.arg_queries.to_i
-num_queries = 1 if num_queries < 0
-num_queries = 500 if num_queries > 500
-
-class Worlds
-  def db
-    @db ||= Userdata.new("my_#{Process.pid}").db
-  end
-
-  def find(id)
-    db.execute("select * from World where id = ?", id) do |row, fields|
-      return Hash[fields.zip(row)]
-    end
-  end
-
-  def save(world)
-    #TODO: consider execute_batch
-    db.execute("update World set randomNumber = ? where id = ?", world["randomNumber"], world["randomNumber"])
-  end
-end
-
-ret = num_queries.times.map { World.find(rand(10000)) }
-
-ret.each do |world|
-  world["randomNumber"] = rand(10000) + 1
-  World.save(world)
-end
-
-Nginx.rputs JSON::stringify(ret)

+ 0 - 4
frameworks/Ruby/padrino/.gitignore

@@ -1,4 +0,0 @@
-.bundle
-vendor/bundle
-/tmp/
-Gemfile.lock

+ 5 - 16
frameworks/Ruby/padrino/Gemfile

@@ -1,21 +1,10 @@
 source 'http://rubygems.org'
 
-platforms :jruby do
-  gem "jdbc-mysql", '5.1.38', :require => 'jdbc/mysql'
-  gem 'torqbox', '0.1.7'
-  gem "trinidad", '1.4.6'
-end
-
-platforms :ruby do
-  gem 'mysql2', '0.3.20'
-  gem "unicorn", '4.8.3'
-  gem "thin", '1.6.2'
-end
-
-gem 'puma', "~> 3.9.1"
-gem 'json', '1.8.3'
-
+gem 'mysql2', '0.4.10'
+gem "unicorn", '5.3.0'
+gem 'puma', '3.9.1'
+gem 'json', '1.8.6'
 gem 'slim', '2.0.3'
 gem 'dm-mysql-adapter', '1.2.0'
 gem 'dm-core', '1.2.1'
-gem "padrino", "~> 0.12.3"
+gem 'padrino', '0.14.3'

+ 0 - 25
frameworks/Ruby/padrino/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "padrino",
   "tests": [{
     "default": {
-      "setup_file": "run_mri_puma",
       "json_url": "/json",
       "db_url": "/db", 
       "query_url": "/queries?queries=", 
@@ -24,31 +23,7 @@
       "notes": "",
       "versus": "rack-puma-mri"
     },
-    "thin": {
-      "setup_file": "run_thin",
-      "json_url": "/json",
-      "db_url": "/db", 
-      "query_url": "/queries?queries=", 
-      "fortune_url": "/fortunes",
-      "update_url": "/updates?queries=", 
-      "plaintext_url": "/plaintext",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Micro",
-      "database": "MySQL",
-      "framework": "padrino",
-      "language": "Ruby",
-      "orm": "Full",
-      "platform": "Rack",
-      "webserver": "Thin",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "padrino-thin",
-      "notes": "",
-      "versus": "rack-thin"
-    },
     "unicorn": {
-      "setup_file": "run_unicorn",
       "json_url": "/json",
       "db_url": "/db", 
       "query_url": "/queries?queries=", 

+ 1 - 1
frameworks/Ruby/padrino/config/nginx.conf

@@ -37,7 +37,7 @@ events {
 
 http {
   # nginx will find this file in the config directory set at nginx build time
-  include /usr/local/nginx/conf/mime.types;
+  include /nginx/conf/mime.types;
 
   # fallback in case we can't determine a type
   default_type application/octet-stream;

+ 0 - 10
frameworks/Ruby/padrino/config/thin.yml

@@ -1,10 +0,0 @@
---- 
-timeout: 30
-wait: 30
-max_conns: 1024
-max_persistent_conns: 512
-environment: production
-port: 8080
-servers: 8
-log: /tmp/thin.log
-quiet: true

+ 0 - 8
frameworks/Ruby/padrino/config/trinidad.yml

@@ -1,8 +0,0 @@
----
-  port: 8080
-  threadsafe: true
-  environment: production
-  http:
-    address: '*'
-  logging:
-    level: SEVERE

+ 17 - 0
frameworks/Ruby/padrino/padrino-unicorn.dockerfile

@@ -0,0 +1,17 @@
+FROM tfb/nginx:latest
+
+FROM tfb/ruby-2.4:latest
+
+COPY --from=0 /nginx /nginx
+
+ENV NGINX_HOME="/nginx"
+ENV PATH=/nginx/sbin:${PATH}
+
+ADD ./ /padrino
+
+WORKDIR /padrino
+
+RUN bundle install --jobs=4 --gemfile=/padrino/Gemfile --path=/padrino/padrino/bundle
+
+CMD nginx -c /padrino/config/nginx.conf && \
+    DB_HOST=TFB-database bundle exec unicorn -E production -c config/unicorn.rb

+ 9 - 0
frameworks/Ruby/padrino/padrino.dockerfile

@@ -0,0 +1,9 @@
+FROM tfb/ruby-2.4:latest
+
+ADD ./ /padrino
+
+WORKDIR /padrino
+
+RUN bundle install --jobs=4 --gemfile=/padrino/Gemfile --path=/padrino/padrino/bundle
+
+CMD DB_HOST=TFB-database bundle exec puma -C config/puma.rb -w 8 --preload

BIN
frameworks/Ruby/padrino/public/favicon.ico


+ 0 - 7
frameworks/Ruby/padrino/run_mri_puma.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm ruby-2.2
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/padrino/bundle
-
-DB_HOST=${DBHOST} rvm ruby-$MRI_VERSION do bundle exec puma -C config/puma.rb -w 8 --preload &

+ 0 - 7
frameworks/Ruby/padrino/run_thin.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm ruby-2.2
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/padrino/bundle
-
-DB_HOST=${DBHOST} rvm ruby-$MRI_VERSION do bundle exec thin start -C config/thin.yml &

+ 0 - 11
frameworks/Ruby/padrino/run_unicorn.sh

@@ -1,11 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm nginx ruby-2.2
-
-sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/padrino/bundle
-
-nginx -c $TROOT/config/nginx.conf
-
-DB_HOST=${DBHOST} rvm ruby-$MRI_VERSION do bundle exec unicorn -E production -c config/unicorn.rb &

+ 0 - 4
frameworks/Ruby/rack-sequel/.gitignore

@@ -1,4 +0,0 @@
-.bundle
-vendor/bundle
-passenger.*
-Gemfile.lock

+ 0 - 8
frameworks/Ruby/rack-sequel/benchmark_config.json

@@ -3,7 +3,6 @@
   "tests": [
     {
       "default": {
-        "setup_file": "run_mri_puma",
         "json_url": "/json",
         "db_url": "/db",
         "query_url": "/queries?queries=",
@@ -26,7 +25,6 @@
         "notes": ""
       },
       "postgres": {
-        "setup_file": "run_mri_puma",
         "json_url": "/json",
         "db_url": "/db",
         "query_url": "/queries?queries=",
@@ -49,7 +47,6 @@
         "notes": ""
       },
       "passenger-mri": {
-        "setup_file": "run_mri_passenger",
         "json_url": "/json",
         "db_url": "/db",
         "query_url": "/queries?queries=",
@@ -72,7 +69,6 @@
         "notes": ""
       },
       "postgres-passenger-mri": {
-        "setup_file": "run_mri_passenger",
         "json_url": "/json",
         "db_url": "/db",
         "query_url": "/queries?queries=",
@@ -95,7 +91,6 @@
         "notes": ""
       },
       "unicorn-mri": {
-        "setup_file": "run_mri_unicorn",
         "json_url": "/json",
         "db_url": "/db",
         "query_url": "/queries?queries=",
@@ -118,7 +113,6 @@
         "notes": ""
       },
       "postgres-unicorn-mri": {
-        "setup_file": "run_mri_unicorn",
         "json_url": "/json",
         "db_url": "/db",
         "query_url": "/queries?queries=",
@@ -141,7 +135,6 @@
         "notes": ""
       },
       "torquebox-jruby": {
-        "setup_file": "run_jruby_torquebox",
         "json_url": "/json",
         "db_url": "/db",
         "query_url": "/queries?queries=",
@@ -164,7 +157,6 @@
         "notes": ""
       },
       "postgres-torquebox-jruby": {
-        "setup_file": "run_jruby_torquebox",
         "json_url": "/json",
         "db_url": "/db",
         "query_url": "/queries?queries=",

+ 0 - 6
frameworks/Ruby/rack-sequel/config/bundle_install.sh

@@ -1,6 +0,0 @@
-#!/bin/bash
-
-# Ensure we don't accidentally (try to) use gems for the wrong platform.
-rm -f $TROOT/Gemfile.lock
-
-bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/rack-sequel/bundle

+ 0 - 13
frameworks/Ruby/rack-sequel/config/common_run.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-
-if [[ $LOGDIR == *postgres* ]] ; then
-  DBTYPE=postgresql
-else
-  DBTYPE=mysql
-fi
-
-export DBTYPE
-
-if [[ $LOGDIR == *jruby* ]] ; then
-  . $(dirname $0)/config/java_tune.sh
-fi

+ 7 - 0
frameworks/Ruby/rack-sequel/rack-sequel-base.dockerfile

@@ -0,0 +1,7 @@
+FROM tfb/ruby-2.4:latest
+
+ADD ./ /rack-sequel
+
+WORKDIR /rack-sequel
+
+RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile --path=/rack-sequel/rack-sequel/bundle

+ 12 - 0
frameworks/Ruby/rack-sequel/rack-sequel-jruby-base.dockerfile

@@ -0,0 +1,12 @@
+FROM tfb/jruby-9.1:latest
+
+ADD ./ /rack-sequel
+
+WORKDIR /rack-sequel
+
+ENV THREAD_FACTOR=2
+
+RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile --path=/rack-sequel/rack-sequel/bundle
+
+ENV DBTYPE=mysql
+CMD bundle exec torquebox run --io-threads $(( MAX_CONCURRENCY / 2 )) --worker-threads $MAX_CONCURRENCY -b 0.0.0.0 -p 8080 -e production

+ 12 - 0
frameworks/Ruby/rack-sequel/rack-sequel-passenger-mri.dockerfile

@@ -0,0 +1,12 @@
+FROM tfb/rack-sequel-base:latest
+
+# TODO: https://github.com/phusion/passenger/issues/1916
+ENV _PASSENGER_FORCE_HTTP_SESSION=true
+ENV DBTYPE=mysql
+
+RUN ruby -r /rack-sequel/config/auto_tune -e 'puts auto_tune.first' > instances
+CMD bundle exec passenger start --log-level 1 \
+       --engine builtin --disable-turbocaching --disable-security-update-check \
+       --spawn-method direct --max-pool-size $(cat instances) --min-instances $(cat instances) --max-request-queue-size 1024 \
+       --address 0.0.0.0 --port 8080 --environment production
+

+ 11 - 0
frameworks/Ruby/rack-sequel/rack-sequel-postgres-passenger-mri.dockerfile

@@ -0,0 +1,11 @@
+FROM tfb/rack-sequel-base:latest
+
+# TODO: https://github.com/phusion/passenger/issues/1916
+ENV _PASSENGER_FORCE_HTTP_SESSION=true
+ENV DBTYPE=postgresql
+
+RUN ruby -r /rack-sequel/config/auto_tune -e 'puts auto_tune.first' > instances
+CMD bundle exec passenger start --log-level 1 \
+       --engine builtin --disable-turbocaching --disable-security-update-check \
+       --spawn-method direct --max-pool-size $(cat instances) --min-instances $(cat instances) --max-request-queue-size 1024 \
+       --address 0.0.0.0 --port 8080 --environment production

+ 4 - 0
frameworks/Ruby/rack-sequel/rack-sequel-postgres-torquebox-jruby.dockerfile

@@ -0,0 +1,4 @@
+FROM tfb/rack-sequel-jruby-base:latest
+
+ENV DBTYPE=postgresql
+CMD bundle exec torquebox run --io-threads $(( MAX_CONCURRENCY / 2 )) --worker-threads $MAX_CONCURRENCY -b 0.0.0.0 -p 8080 -e production

+ 4 - 0
frameworks/Ruby/rack-sequel/rack-sequel-postgres-unicorn-mri.dockerfile

@@ -0,0 +1,4 @@
+FROM tfb/rack-sequel-base:latest
+
+ENV DBTYPE=postgresql
+CMD bundle exec unicorn -c config/mri_unicorn.rb -o 0.0.0.0 -p 8080 -E production

+ 4 - 0
frameworks/Ruby/rack-sequel/rack-sequel-postgres.dockerfile

@@ -0,0 +1,4 @@
+FROM tfb/rack-sequel-base:latest
+
+ENV DBTYPE=postgresql
+CMD bundle exec puma -C config/mri_puma.rb -b tcp://0.0.0.0:8080 -e production

+ 4 - 0
frameworks/Ruby/rack-sequel/rack-sequel-torquebox-jruby.dockerfile

@@ -0,0 +1,4 @@
+FROM tfb/rack-sequel-jruby-base:latest
+
+ENV DBTYPE=mysql
+CMD bundle exec torquebox run --io-threads $(( MAX_CONCURRENCY / 2 )) --worker-threads $MAX_CONCURRENCY -b 0.0.0.0 -p 8080 -e production

+ 4 - 0
frameworks/Ruby/rack-sequel/rack-sequel-unicorn-mri.dockerfile

@@ -0,0 +1,4 @@
+FROM tfb/rack-sequel-base:latest
+
+ENV DBTYPE=mysql
+CMD bundle exec unicorn -c config/mri_unicorn.rb -o 0.0.0.0 -p 8080 -E production

+ 4 - 0
frameworks/Ruby/rack-sequel/rack-sequel.dockerfile

@@ -0,0 +1,4 @@
+FROM tfb/rack-sequel-base:latest
+
+ENV DBTYPE=mysql
+CMD bundle exec puma -C config/mri_puma.rb -b tcp://0.0.0.0:8080 -e production

+ 0 - 13
frameworks/Ruby/rack-sequel/run_jruby_puma.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-
-THREAD_FACTOR=1
-
-. $(dirname $0)/config/common_run.sh
-
-fw_depends $DBTYPE rvm jruby-9.1
-
-rvm use jruby-$JRUBY_VERSION
-
-. $(dirname $0)/config/bundle_install.sh
-
-bundle exec puma -t $MAX_CONCURRENCY:$MAX_CONCURRENCY -b tcp://0.0.0.0:8080 -e production &

+ 0 - 13
frameworks/Ruby/rack-sequel/run_jruby_torquebox.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-
-THREAD_FACTOR=2
-
-. $(dirname $0)/config/common_run.sh
-
-fw_depends $DBTYPE rvm jruby-9.1
-
-rvm use jruby-$JRUBY_VERSION
-
-. $(dirname $0)/config/bundle_install.sh
-
-bundle exec torquebox run --io-threads $(( MAX_CONCURRENCY / 2 )) --worker-threads $MAX_CONCURRENCY -b 0.0.0.0 -p 8080 -e production &

+ 0 - 20
frameworks/Ruby/rack-sequel/run_mri_passenger.sh

@@ -1,20 +0,0 @@
-#!/bin/bash
-
-. $(dirname $0)/config/common_run.sh
-
-fw_depends $DBTYPE rvm ruby-2.4
-
-rvm use ruby-$MRI_VERSION
-
-. $(dirname $0)/config/bundle_install.sh
-
-# TODO: https://github.com/phusion/passenger/issues/1916
-export _PASSENGER_FORCE_HTTP_SESSION=true
-
-# FWBM only... Passenger will auto-tune itself in production!
-instances=$(ruby -r$(dirname $0)/config/auto_tune -e 'puts auto_tune.first')
-
-bundle exec passenger start --log-level 1 \
-  --engine builtin --disable-turbocaching --disable-security-update-check \
-  --spawn-method direct --max-pool-size $instances --min-instances $instances --max-request-queue-size 1024 \
-  --address 0.0.0.0 --port 8080 --environment production &

+ 0 - 11
frameworks/Ruby/rack-sequel/run_mri_puma.sh

@@ -1,11 +0,0 @@
-#!/bin/bash
-
-. $(dirname $0)/config/common_run.sh
-
-fw_depends $DBTYPE rvm ruby-2.4
-
-rvm use ruby-$MRI_VERSION
-
-. $(dirname $0)/config/bundle_install.sh
-
-bundle exec puma -C config/mri_puma.rb -b tcp://0.0.0.0:8080 -e production &

+ 0 - 11
frameworks/Ruby/rack-sequel/run_mri_unicorn.sh

@@ -1,11 +0,0 @@
-#!/bin/bash
-
-. $(dirname $0)/config/common_run.sh
-
-fw_depends $DBTYPE rvm ruby-2.4
-
-rvm use ruby-$MRI_VERSION
-
-. $(dirname $0)/config/bundle_install.sh
-
-bundle exec unicorn -c config/mri_unicorn.rb -o 0.0.0.0 -p 8080 -E production &

+ 0 - 4
frameworks/Ruby/rack/.gitignore

@@ -1,4 +0,0 @@
-.bundle
-/vendor/
-/tmp/
-Gemfile.lock

+ 3 - 14
frameworks/Ruby/rack/Gemfile

@@ -1,18 +1,7 @@
 source 'http://rubygems.org'
 
-platforms :jruby do
-  gem 'jdbc-mysql', '5.1.38', :require => 'jdbc/mysql'
-  gem 'torquebox', '3.2.0'
-  gem 'trinidad', '1.4.6'
-end
-
-platforms :ruby do
-  gem 'mysql2', '0.4.5'
-  gem 'unicorn', '5.3.0'
-  gem 'thin', '1.7.0'
-end
-
-gem 'puma', '~> 3.9.1'
-
+gem 'mysql2', '0.4.5'
+gem 'unicorn', '5.3.0'
+gem 'puma', '3.9.1'
 gem 'rack', '2.0.1'
 gem 'json', '2.1.0'

+ 0 - 21
frameworks/Ruby/rack/benchmark_config.json

@@ -22,27 +22,6 @@
       "display_name": "rack-puma-mri",
       "notes": ""
     },
-    "thin": {
-      "setup_file": "run_mri_thin",
-      "json_url": "/json",
-      "db_url": "/db",
-      "query_url": "/queries?queries=",
-      "update_url": "/updates?queries=",
-      "plaintext_url": "/plaintext",
-      "port": 8080,
-      "approach": "Stripped",
-      "classification": "Platform",
-      "database": "MySQL",
-      "framework": "rack",
-      "language": "Ruby",
-      "orm": "Raw",
-      "platform": "Rack",
-      "webserver": "Thin",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "rack-thin-mri",
-      "notes": ""
-    },
     "unicorn": {
       "setup_file": "run_mri_unicorn",
       "json_url": "/json",

+ 1 - 1
frameworks/Ruby/rack/config/database.yml

@@ -1,6 +1,6 @@
 ---
   :encoding: utf8
-  :host: 127.0.0.1
+  :host: TFB-database
   :database: hello_world
   :username: benchmarkdbuser
   :password: benchmarkdbpass

+ 1 - 1
frameworks/Ruby/rack/config/nginx.conf

@@ -37,7 +37,7 @@ events {
 
 http {
   # nginx will find this file in the config directory set at nginx build time
-  include /usr/local/nginx/conf/mime.types;
+  include /nginx/conf/mime.types;
 
   # fallback in case we can't determine a type
   default_type application/octet-stream;

+ 0 - 10
frameworks/Ruby/rack/config/thin.yml

@@ -1,10 +0,0 @@
---- 
-timeout: 30
-wait: 30
-max_conns: 1024
-max_persistent_conns: 512
-environment: production
-port: 8080
-servers: 8
-log: /tmp/thin.log
-quiet: true

+ 0 - 9
frameworks/Ruby/rack/config/trinidad.yml

@@ -1,9 +0,0 @@
----
-  port: 8080
-  threadsafe: true
-  environment: production
-  http:
-    address: '*'
-  logging:
-    level: SEVERE
-  java_lib: lib

BIN
frameworks/Ruby/rack/lib/mysql-connector-java-5.1.28-bin.jar


+ 0 - 0
frameworks/Ruby/rack/public/.gitkeep


+ 16 - 0
frameworks/Ruby/rack/rack-unicorn.dockerfile

@@ -0,0 +1,16 @@
+FROM tfb/nginx:latest
+
+FROM tfb/ruby-2.4:latest
+
+COPY --from=0 /nginx /nginx
+
+ENV NGINX_HOME="/nginx"
+ENV PATH=/nginx/sbin:${PATH}
+
+ADD ./ /rack
+
+WORKDIR /rack
+
+RUN bundle install --jobs=4 --gemfile=/rack/Gemfile --path=/rack/rack/bundle
+
+CMD nginx -c /rack/config/nginx.conf && bundle exec unicorn -E production -c config/unicorn.rb

+ 9 - 0
frameworks/Ruby/rack/rack.dockerfile

@@ -0,0 +1,9 @@
+FROM tfb/ruby-2.4:latest
+
+ADD ./ /rack
+
+WORKDIR /rack
+
+RUN bundle install --jobs=4 --gemfile=/rack/Gemfile --path=/rack/rack/bundle
+
+CMD bundle exec puma -t 8:32 -w 8 --preload -b tcp://0.0.0.0:8080 -e production

+ 0 - 9
frameworks/Ruby/rack/run_mri_puma.sh

@@ -1,9 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm ruby-2.4
-
-sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/rack/bundle
-
-rvm ruby-$MRI_VERSION do bundle exec puma -t 8:32 -w 8 --preload -b tcp://0.0.0.0:8080 -e production &

+ 0 - 9
frameworks/Ruby/rack/run_mri_thin.sh

@@ -1,9 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm ruby-2.4
-
-sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/rack/bundle
-
-rvm ruby-$MRI_VERSION do bundle exec thin start -C config/thin.yml &

+ 0 - 12
frameworks/Ruby/rack/run_mri_unicorn.sh

@@ -1,12 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm nginx ruby-2.4
-
-sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
-sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/rack/bundle
-
-nginx -c $TROOT/config/nginx.conf
-
-rvm ruby-$MRI_VERSION do bundle exec unicorn -E production -c config/unicorn.rb &

+ 0 - 4
frameworks/Ruby/rails/.gitignore

@@ -1,4 +0,0 @@
-.bundle
-vendor/bundle
-/tmp/
-Gemfile.lock

+ 6 - 17
frameworks/Ruby/rails/Gemfile

@@ -1,20 +1,9 @@
 source 'http://rubygems.org'
 
-platforms :jruby do
-  gem 'activerecord-jdbcmysql-adapter', '~> 1.3.9', :require => false
-  gem 'torquebox', '3.2.0'
-  gem 'trinidad', '1.4.6'
-end
-
-platforms :ruby do
-  gem 'mysql2', '0.4.5'
-  gem 'unicorn', '5.3.0'
-  gem 'thin', '1.7.0'
-end
-
-gem 'puma', '~> 3.9.1'
-
+gem 'mysql2', '0.4.10'
+gem 'unicorn', '5.4.0'
+gem 'puma', '3.9.1'
 gem 'activerecord-import', '0.18.1'
-gem 'activerecord', '5.1.0', :require => 'active_record'
-
-gem 'rails', '~> 5.1.0'
+gem 'activerecord', '5.1.5', :require => 'active_record'
+gem 'rails', '5.1.5'
+gem 'tzinfo-data', '1.2018.3'

BIN
frameworks/Ruby/rails/app/assets/images/rails.png


+ 0 - 15
frameworks/Ruby/rails/app/assets/javascripts/application.js

@@ -1,15 +0,0 @@
-// This is a manifest file that'll be compiled into application.js, which will include all the files
-// listed below.
-//
-// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
-// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
-//
-// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
-// the compiled file.
-//
-// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
-// GO AFTER THE REQUIRES BELOW.
-//
-//= require jquery
-//= require jquery_ujs
-//= require_tree .

+ 0 - 13
frameworks/Ruby/rails/app/assets/stylesheets/application.css

@@ -1,13 +0,0 @@
-/*
- * This is a manifest file that'll be compiled into application.css, which will include all the files
- * listed below.
- *
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
- * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
- *
- * You're free to add application-wide styles to this file and they'll appear at the top of the
- * compiled file, but it's generally better to create a new file per style scope.
- *
- *= require_self
- *= require_tree .
-*/

+ 0 - 0
frameworks/Ruby/rails/app/mailers/.gitkeep


+ 0 - 25
frameworks/Ruby/rails/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "rails",
   "tests": [{
     "default": {
-      "setup_file": "run_mri_puma",
       "json_url": "/hello_world/json",
       "db_url": "/hello_world/db",
       "query_url": "/hello_world/query?queries=",
@@ -24,31 +23,7 @@
       "notes": "",
       "versus": "rack-puma-mri"
     },
-    "thin": {
-      "setup_file": "run_mri_thin",
-      "json_url": "/hello_world/json",
-      "db_url": "/hello_world/db",
-      "query_url": "/hello_world/query?queries=",
-      "fortune_url": "/fortune",
-      "update_url": "/update?queries=",
-      "plaintext_url": "/plaintext",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "MySQL",
-      "framework": "rails",
-      "language": "Ruby",
-      "orm": "Full",
-      "platform": "Rack",
-      "webserver": "Thin",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "rails-thin-mri",
-      "notes": "",
-      "versus": "rack-thin-mri"
-    },
     "unicorn": {
-      "setup_file": "run_mri_unicorn",
       "json_url": "/hello_world/json",
       "db_url": "/hello_world/db",
       "query_url": "/hello_world/query?queries=",

+ 2 - 2
frameworks/Ruby/rails/config/database.yml

@@ -1,10 +1,10 @@
 ---
 _: &common
-  adapter: <%= RUBY_PLATFORM == 'java' ? 'jdbcmysql' : 'mysql2' %>
+  adapter: mysql2
   database: hello_world
   username: benchmarkdbuser
   password: benchmarkdbpass
-  host: <%= ENV['DB_HOST'] %>
+  host: TFB-database
   timeout: 5000
 
 development:

+ 1 - 1
frameworks/Ruby/rails/config/nginx.conf

@@ -37,7 +37,7 @@ events {
 
 http {
   # nginx will find this file in the config directory set at nginx build time
-  include /usr/local/nginx/conf/mime.types;
+  include /nginx/conf/mime.types;
 
   # fallback in case we can't determine a type
   default_type application/octet-stream;

+ 0 - 10
frameworks/Ruby/rails/config/thin.yml

@@ -1,10 +0,0 @@
---- 
-timeout: 30
-wait: 30
-max_conns: 1024
-max_persistent_conns: 512
-environment: production
-port: 8080
-servers: 8
-log: /tmp/thin.log
-quiet: true

+ 0 - 8
frameworks/Ruby/rails/config/trinidad.yml

@@ -1,8 +0,0 @@
----
-  port: 8080
-  threadsafe: true
-  environment: production
-  http:
-    address: '*'
-  logging:
-    level: SEVERE

+ 0 - 0
frameworks/Ruby/rails/public/.keep


+ 17 - 0
frameworks/Ruby/rails/rails-unicorn.dockerfile

@@ -0,0 +1,17 @@
+FROM tfb/nginx:latest
+
+FROM tfb/ruby-2.4:latest
+
+COPY --from=0 /nginx /nginx
+
+ENV NGINX_HOME="/nginx"
+ENV PATH=/nginx/sbin:${PATH}
+
+ADD ./ /rails
+
+WORKDIR /rails
+
+RUN bundle install --jobs=4 --gemfile=/rails/Gemfile --path=/rails/rails/bundle
+
+CMD nginx -c /rails/config/nginx.conf && \
+    DB_HOST=TFB-database bundle exec unicorn_rails -E production -c config/unicorn.rb

+ 9 - 0
frameworks/Ruby/rails/rails.dockerfile

@@ -0,0 +1,9 @@
+FROM tfb/ruby-2.4:latest
+
+ADD ./ /rails
+
+WORKDIR /rails
+
+RUN bundle install --jobs=4 --gemfile=/rails/Gemfile --path=/rails/rails/bundle
+
+CMD DB_HOST=TFB-database bundle exec puma -C config/mri_puma.rb -b tcp://0.0.0.0:8080 -e production

+ 0 - 7
frameworks/Ruby/rails/run_mri_puma.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm ruby-2.4
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/rails/bundle
-
-DB_HOST=${DBHOST} rvm ruby-$MRI_VERSION do bundle exec puma -C config/mri_puma.rb -b tcp://0.0.0.0:8080 -e production &

+ 0 - 7
frameworks/Ruby/rails/run_mri_thin.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm ruby-2.4
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/rails/bundle
-
-DB_HOST=${DBHOST} rvm ruby-$MRI_VERSION do bundle exec thin start -C config/thin.yml &

+ 0 - 11
frameworks/Ruby/rails/run_mri_unicorn.sh

@@ -1,11 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql rvm ruby-2.4 nginx
-
-sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
-
-rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=$IROOT/rails/bundle
-
-nginx -c $TROOT/config/nginx.conf
-
-DB_HOST=${DBHOST} rvm ruby-$MRI_VERSION do bundle exec unicorn_rails -E production -c $TROOT/config/unicorn.rb &

Some files were not shown because too many files changed in this diff