Browse Source

Removed passenger test for rails ruby, anc donverted it to use unicorn

Patrick Falls 12 years ago
parent
commit
321a75a375
3 changed files with 10 additions and 43 deletions
  1. 0 8
      rails/benchmark_config
  2. 10 3
      rails/setup_ruby.py
  3. 0 32
      rails/setup_unicorn.py

+ 0 - 8
rails/benchmark_config

@@ -16,14 +16,6 @@
       "query_url": "/rails/hello_world/db?queries=",
       "port": 8080,
       "sort": 17
-    },
-    "unicorn": {
-      "setup_file": "setup_unicorn",
-      "json_url": "/hello_world/json",
-      "db_url": "/hello_world/db",
-      "query_url": "/hello_world/db?queries=",
-      "port": 8080,
-      "sort": 37
     }
   }]
 }

+ 10 - 3
rails/setup_ruby.py

@@ -1,23 +1,30 @@
 
 import subprocess
 import sys
+import re
+import os
 import setup_util
 
 def start(args):
   setup_util.replace_text("rails/config/database-ruby.yml", "host: .*", "host: " + args.database_host)
-  
   try:
     subprocess.check_call("rvm ruby-2.0.0-p0 do bundle install --gemfile=Gemfile-ruby", shell=True, cwd="rails")
     subprocess.check_call("cp Gemfile-ruby Gemfile", shell=True, cwd="rails")
     subprocess.check_call("cp Gemfile-ruby.lock Gemfile.lock", shell=True, cwd="rails")
     subprocess.check_call("cp config/database-ruby.yml config/database.yml", shell=True, cwd="rails")
-    subprocess.check_call("rvm ruby-2.0.0-p0 do bundle exec passenger start -p 8080 -d -e production --pid-file=$HOME/FrameworkBenchmarks/rails/rails.pid --nginx-version=1.2.7 --max-pool-size=24", shell=True, cwd="rails")
+    subprocess.Popen("rvm ruby-2.0.0-p0 do bundle exec unicorn_rails -E production -c config/unicorn.rb", shell=True, cwd="rails")
     return 0
   except subprocess.CalledProcessError:
     return 1
 def stop():
   try:
-    subprocess.check_call("rvm ruby-2.0.0-p0 do bundle exec passenger stop --pid-file=$HOME/FrameworkBenchmarks/rails/rails.pid", shell=True, cwd='rails')
+    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
+    out, err = p.communicate()
+    for line in out.splitlines():
+      if 'unicorn' in line and 'master' in line:
+        pid = int(line.split(None, 2)[1])
+        os.kill(pid, 9)
+    # subprocess.check_call("rvm ruby-2.0.0-p0 do bundle exec passenger stop --pid-file=$HOME/FrameworkBenchmarks/rack/rack.pid", shell=True, cwd='rack')
     subprocess.check_call("rm Gemfile", shell=True, cwd="rails")
     subprocess.check_call("rm Gemfile.lock", shell=True, cwd="rails")
     return 0

+ 0 - 32
rails/setup_unicorn.py

@@ -1,32 +0,0 @@
-
-import subprocess
-import sys
-import re
-import os
-import setup_util
-
-def start(args):
-  setup_util.replace_text("rails/config/database-ruby.yml", "host: .*", "host: " + args.database_host)
-  try:
-    subprocess.check_call("rvm ruby-2.0.0-p0 do bundle install --gemfile=Gemfile-ruby", shell=True, cwd="rails")
-    subprocess.check_call("cp Gemfile-ruby Gemfile", shell=True, cwd="rails")
-    subprocess.check_call("cp Gemfile-ruby.lock Gemfile.lock", shell=True, cwd="rails")
-    subprocess.check_call("cp config/database-ruby.yml config/database.yml", shell=True, cwd="rails")
-    subprocess.Popen("rvm ruby-2.0.0-p0 do bundle exec unicorn_rails -E production -c config/unicorn.rb", shell=True, cwd="rails")
-    return 0
-  except subprocess.CalledProcessError:
-    return 1
-def stop():
-  try:
-    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-    out, err = p.communicate()
-    for line in out.splitlines():
-      if 'unicorn' in line and 'master' in line:
-        pid = int(line.split(None, 2)[1])
-        os.kill(pid, 9)
-    # subprocess.check_call("rvm ruby-2.0.0-p0 do bundle exec passenger stop --pid-file=$HOME/FrameworkBenchmarks/rack/rack.pid", shell=True, cwd='rack')
-    subprocess.check_call("rm Gemfile", shell=True, cwd="rails")
-    subprocess.check_call("rm Gemfile.lock", shell=True, cwd="rails")
-    return 0
-  except subprocess.CalledProcessError:
-    return 1