Browse Source

master Fixing a lot of the install process

Mike Smith 11 years ago
parent
commit
c205dcbae5

+ 2 - 1
config/benchmark_profile

@@ -13,8 +13,9 @@ export PERL_HOME=/opt/ActivePerl-5.16
 export DART_HOME=~/FrameworkBenchmarks/installs/dart-sdk
 export PYTHON_HOME=~/FrameworkBenchmarks/installs/python-2.7.5
 export RACKET_HOME=~/FrameworkBenchmarks/installs/racket-5.3.6
+export NIMROD_HOME=~/FrameworkBenchmarks/installs/nimrod
 
-export PATH="$PYTHON_HOME/bin:$PATH$JAVA_HOME/bin:$GRAILS_HOME/bin:$PLAY_HOME:$PLAY1_HOME:$VERTX_HOME/bin:$GOROOT/bin:$NODE_HOME/bin:$HOME/FrameworkBenchmarks/installs/bin:$MAVEN_HOME/bin:$PERL_HOME/bin:$PERL_HOME/site/bin:$DART_HOME/bin:$RACKET_HOME/bin:$PATH"
+export PATH="$PYTHON_HOME/bin:$PATH$JAVA_HOME/bin:$GRAILS_HOME/bin:$PLAY_HOME:$PLAY1_HOME:$VERTX_HOME/bin:$GOROOT/bin:$NODE_HOME/bin:$HOME/FrameworkBenchmarks/installs/bin:$MAVEN_HOME/bin:$PERL_HOME/bin:$PERL_HOME/site/bin:$DART_HOME/bin:$RACKET_HOME/bin:$NIMROD_HOME/bin:$PATH"
 
 export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/usr/local/apr/lib'
 

+ 31 - 0
config/create-postgres.sql

@@ -28,3 +28,34 @@ INSERT INTO Fortune (id, message) VALUES (9, 'Feature: A bug with seniority.');
 INSERT INTO Fortune (id, message) VALUES (10, 'Computers make very fast, very accurate mistakes.');
 INSERT INTO Fortune (id, message) VALUES (11, '<script>alert("This should not be displayed in a browser alert box.");</script>');
 INSERT INTO Fortune (id, message) VALUES (12, 'フレームワークのベンチマーク');
+
+
+DROP TABLE IF EXISTS "World";
+CREATE TABLE  "World" (
+  id integer NOT NULL,
+  randomNumber integer NOT NULL default 0,
+  PRIMARY KEY  (id)
+);
+
+INSERT INTO "World" (id, randomnumber)
+SELECT x.id, random() * 10000 + 1 FROM generate_series(1,10000) as x(id);
+
+DROP TABLE IF EXISTS "Fortune";
+CREATE TABLE "Fortune" (
+  id integer NOT NULL,
+  message varchar(2048) NOT NULL,
+  PRIMARY KEY  (id)
+);
+
+INSERT INTO "Fortune" (id, message) VALUES (1, 'fortune: No such file or directory');
+INSERT INTO "Fortune" (id, message) VALUES (2, 'A computer scientist is someone who fixes things that aren''t broken.');
+INSERT INTO "Fortune" (id, message) VALUES (3, 'After enough decimal places, nobody gives a damn.');
+INSERT INTO "Fortune" (id, message) VALUES (4, 'A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1');
+INSERT INTO "Fortune" (id, message) VALUES (5, 'A computer program does what you tell it to do, not what you want it to do.');
+INSERT INTO "Fortune" (id, message) VALUES (6, 'Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen');
+INSERT INTO "Fortune" (id, message) VALUES (7, 'Any program that runs right is obsolete.');
+INSERT INTO "Fortune" (id, message) VALUES (8, 'A list is only as strong as its weakest link. — Donald Knuth');
+INSERT INTO "Fortune" (id, message) VALUES (9, 'Feature: A bug with seniority.');
+INSERT INTO "Fortune" (id, message) VALUES (10, 'Computers make very fast, very accurate mistakes.');
+INSERT INTO "Fortune" (id, message) VALUES (11, '<script>alert("This should not be displayed in a browser alert box.");</script>');
+INSERT INTO "Fortune" (id, message) VALUES (12, 'フレームワークのベンチマーク');

+ 41 - 13
config/create.js

@@ -1,7 +1,7 @@
 use hello_world
 db.world.drop()
 for (var i = 1; i <= 10000; i++) {
-  db.world.save( { _id: i, randomNumber: (Math.floor(Math.random() * 10000) + 1) })
+  db.world.save( { _id: i, id: i, randomNumber: (Math.floor(Math.random() * 10000) + 1) })
 }
 
 // http://docs.mongodb.org/manual/applications/optimization/
@@ -9,17 +9,45 @@ db.world.ensureIndex({_id: 1})
 
 db.fortune.drop()
 
-db.fortune.save( {_id: 1, message: 'fortune: No such file or directory'} );
-db.fortune.save( {_id: 2, message: "A computer scientist is someone who fixes things that aren't broken."} );
-db.fortune.save( {_id: 3, message: 'After enough decimal places, nobody gives a damn.'} );
-db.fortune.save( {_id: 4, message: 'A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1'} );
-db.fortune.save( {_id: 5, message: 'A computer program does what you tell it to do, not what you want it to do.'} );
-db.fortune.save( {_id: 6, message: 'Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen'} );
-db.fortune.save( {_id: 7, message: 'Any program that runs right is obsolete.'} );
-db.fortune.save( {_id: 8, message: 'A list is only as strong as its weakest link. — Donald Knuth'} );
-db.fortune.save( {_id: 9, message: 'Feature: A bug with seniority.'} );
-db.fortune.save( {_id: 10, message: 'Computers make very fast, very accurate mistakes.'} );
-db.fortune.save( {_id: 11, message: '<script>alert("This should not be displayed in a browser alert box.");</script>'} );
-db.fortune.save( {_id: 12, message: 'フレームワークのベンチマーク'} );
+db.fortune.save( {_id: 1, id: 1, message: 'fortune: No such file or directory'} );
+db.fortune.save( {_id: 2, id: 2, message: "A computer scientist is someone who fixes things that aren't broken."} );
+db.fortune.save( {_id: 3, id: 3, message: 'After enough decimal places, nobody gives a damn.'} );
+db.fortune.save( {_id: 4, id: 4, message: 'A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1'} );
+db.fortune.save( {_id: 5, id: 5, message: 'A computer program does what you tell it to do, not what you want it to do.'} );
+db.fortune.save( {_id: 6, id: 6, message: 'Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen'} );
+db.fortune.save( {_id: 7, id: 7, message: 'Any program that runs right is obsolete.'} );
+db.fortune.save( {_id: 8, id: 8, message: 'A list is only as strong as its weakest link. — Donald Knuth'} );
+db.fortune.save( {_id: 9, id: 9, message: 'Feature: A bug with seniority.'} );
+db.fortune.save( {_id: 10, id: 10, message: 'Computers make very fast, very accurate mistakes.'} );
+db.fortune.save( {_id: 11, id: 11, message: '<script>alert("This should not be displayed in a browser alert box.");</script>'} );
+db.fortune.save( {_id: 12, id: 12, message: 'フレームワークのベンチマーク'} );
 
 db.fortune.ensureIndex({_id: 1})
+
+
+// Capitalization matters apparently
+use hello_world
+db.World.drop()
+for (var i = 1; i <= 10000; i++) {
+  db.World.save( { _id: i, id: i, randomNumber: (Math.floor(Math.random() * 10000) + 1) })
+}
+
+// http://docs.mongodb.org/manual/applications/optimization/
+db.World.ensureIndex({_id: 1})
+
+db.Fortune.drop()
+
+db.Fortune.save( {_id: 1, id: 1, message: 'fortune: No such file or directory'} );
+db.Fortune.save( {_id: 2, id: 2, message: "A computer scientist is someone who fixes things that aren't broken."} );
+db.Fortune.save( {_id: 3, id: 3, message: 'After enough decimal places, nobody gives a damn.'} );
+db.Fortune.save( {_id: 4, id: 4, message: 'A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1'} );
+db.Fortune.save( {_id: 5, id: 5, message: 'A computer program does what you tell it to do, not what you want it to do.'} );
+db.Fortune.save( {_id: 6, id: 6, message: 'Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen'} );
+db.Fortune.save( {_id: 7, id: 7, message: 'Any program that runs right is obsolete.'} );
+db.Fortune.save( {_id: 8, id: 8, message: 'A list is only as strong as its weakest link. — Donald Knuth'} );
+db.Fortune.save( {_id: 9, id: 9, message: 'Feature: A bug with seniority.'} );
+db.Fortune.save( {_id: 10, id: 10, message: 'Computers make very fast, very accurate mistakes.'} );
+db.Fortune.save( {_id: 11, id: 11, message: '<script>alert("This should not be displayed in a browser alert box.");</script>'} );
+db.Fortune.save( {_id: 12, id: 12, message: 'フレームワークのベンチマーク'} );
+
+db.Fortune.ensureIndex({_id: 1})

+ 18 - 14
toolset/benchmark/framework_test.py

@@ -858,20 +858,24 @@ class FrameworkTest:
   # is an HTTP error.
   ############################################################
   def __curl_url(self, url, testType, out, err):
-    # Use -i to output response with headers.
-    # Don't use -f so that the HTTP response code is ignored.
-    # Use --stderr - to redirect stderr to stdout so we get
-    # error output for sure in stdout.
-    # Use -sS to hide progress bar, but show errors.
-    subprocess.check_call(["curl", "-i", "-sS", url], stderr=err, stdout=out)
-    # HTTP output may not end in a newline, so add that here.
-    out.write( "\n\n" )
-    out.flush()
-    err.flush()
-
-    # We need to get the respond body from the curl and return it.
-    p = subprocess.Popen(["curl", "-s", url], stdout=subprocess.PIPE)
-    output = p.communicate()
+    output = None
+    try:
+      # Use -i to output response with headers.
+      # Don't use -f so that the HTTP response code is ignored.
+      # Use --stderr - to redirect stderr to stdout so we get
+      # error output for sure in stdout.
+      # Use -sS to hide progress bar, but show errors.
+      subprocess.check_call(["curl", "-i", "-sS", url], stderr=err, stdout=out)
+      # HTTP output may not end in a newline, so add that here.
+      out.write( "\n\n" )
+      out.flush()
+      err.flush()
+
+      # We need to get the respond body from the curl and return it.
+      p = subprocess.Popen(["curl", "-s", url], stdout=subprocess.PIPE)
+      output = p.communicate()
+    except:
+      pass
 
     if output:
       # We have the response body - return it

+ 8 - 2
toolset/run-tests.py

@@ -3,6 +3,7 @@ import argparse
 import ConfigParser
 import sys
 import os
+import multiprocessing
 from pprint import pprint 
 from benchmark.benchmarker import Benchmarker
 from setup.linux.unbuffered import Unbuffered
@@ -51,6 +52,11 @@ def main(argv=None):
     databaHost = os.getenv('TFB_DATABASE_HOST', clientHost)
     databaUser = os.getenv('TFB_DATABASE_USER', clientUser)
     dbIdenFile = os.getenv('TFB_DATABASE_IDENTITY_FILE', clientIden)
+    maxThreads = 8
+    try:
+        maxThreads = multiprocessing.cpu_count()
+    except:
+        pass
 
     ##########################################################
     # Set up argument parser
@@ -77,9 +83,9 @@ def main(argv=None):
     parser.add_argument('--max-concurrency', default=256, help='the maximum concurrency that the tests will run at. The query tests will run at this concurrency', type=int)
     parser.add_argument('--max-queries', default=20, help='The maximum number of queries to run during the query test', type=int)
     parser.add_argument('--query-interval', default=5, type=int)
-    parser.add_argument('--max-threads', default=8, help='The max number of threads to run weight at, this should be set to the number of cores for your system.', type=int)
+    parser.add_argument('--max-threads', default=maxThreads, help='The max number of threads to run weight at, this should be set to the number of cores for your system.', type=int)
     parser.add_argument('--duration', default=15, help='Time in seconds that each test should run for.')
-    parser.add_argument('--starting-concurrency', default=8, type=int)
+    parser.add_argument('--starting-concurrency', default=, type=int)
     parser.add_argument('--sleep', type=int, default=60, help='the amount of time to sleep after starting each test to allow the server to start up.')
     parser.add_argument('--parse', help='Parses the results of the given timestamp and merges that with the latest results')
     parser.add_argument('--name', default="ec2", help='The name to give this test. Results will be placed in a folder using this name.')

+ 13 - 26
toolset/setup/linux/installer.py

@@ -71,8 +71,8 @@ class Installer:
     #
     # Dart
     #
-    self.__download("https://storage.googleapis.com/dart-editor-archive-integration/latest/dartsdk-linux-64.tar.gz")
-    self.__run_command("tar xzf dartsdk-linux-64.tar.gz")
+    self.__download("http://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-x64-release.zip")
+    self.__run_command("unzip dartsdk-linux-x64-release.zip")
 
     #
     # Erlang
@@ -86,22 +86,19 @@ class Installer:
     #
     # nodejs
     #
-
     self.__download("http://nodejs.org/dist/v0.10.8/node-v0.10.8-linux-x64.tar.gz")
     self.__run_command("tar xzf node-v0.10.8-linux-x64.tar.gz")
 
     #
     # Java
     #
-
     self.__run_command("sudo apt-get install openjdk-7-jdk", True)
     self.__run_command("sudo apt-get remove --purge openjdk-6-jre openjdk-6-jre-headless", True)
 
     #
     # Ruby/JRuby
     #
-
-    self.__run_command("curl -L get.rvm.io | bash -s head")
+    self.__run_command("curl -L get.rvm.io | bash -s head --auto-dotfiles")
     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")
@@ -111,26 +108,24 @@ class Installer:
     #
     # go
     #
-
     self.__download("http://go.googlecode.com/files/go1.2.linux-amd64.tar.gz");
     self.__run_command("tar xzf go1.2.linux-amd64.tar.gz")
 
     #
     # Perl
     #
-
     self.__download("http://downloads.activestate.com/ActivePerl/releases/5.16.3.1603/ActivePerl-5.16.3.1603-x86_64-linux-glibc-2.3.5-296746.tar.gz");
     self.__run_command("tar xzf ActivePerl-5.16.3.1603-x86_64-linux-glibc-2.3.5-296746.tar.gz");
     self.__run_command("sudo ./install.sh --license-accepted --prefix /opt/ActivePerl-5.16 --no-install-html", cwd="ActivePerl-5.16.3.1603-x86_64-linux-glibc-2.3.5-296746", send_yes=True, retry=True)
     self.__download("http://cpanmin.us", "cpanminus.pl")
     self.__run_command("perl cpanminus.pl --sudo App::cpanminus", retry=True)
     self.__run_command("cpanm -f -S DBI DBD::mysql Kelp Dancer Mojolicious Kelp::Module::JSON::XS Dancer::Plugin::Database Starman Plack JSON Web::Simple DBD::Pg JSON::XS EV HTTP::Parser::XS Monoceros EV IO::Socket::IP IO::Socket::SSL", retry=True)
+    self.__run_command("sudo rm /usr/bin/perl")
 
     #
     # php
     #
-
-    self.__download("http://www.php.net/get/php-5.4.13.tar.gz/from/us1.php.net/mirror")
+    self.__download("http://museum.php.net/php5/php-5.4.13.tar.gz")
     self.__run_command("tar xzf php-5.4.13.tar.gz")
     self.__run_command("./configure --with-pdo-mysql --with-mysql --with-mcrypt --enable-intl --enable-mbstring --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --with-openssl", cwd="php-5.4.13")
     self.__run_command("make", cwd="php-5.4.13")
@@ -138,7 +133,6 @@ class Installer:
     self.__run_command("printf \"\\n\" | sudo pecl install apc-beta", cwd="php-5.4.13", retry=True)
     self.__run_command("sudo cp ../config/php.ini /usr/local/lib/php.ini")
     self.__run_command("sudo cp ../config/php-fpm.conf /usr/local/lib/php-fpm.conf")
-    self.__run_command("rm php-5.4.13.tar.gz")
 
     # Composer
     self.__download("https://getcomposer.org/installer", "composer-installer.php")
@@ -154,7 +148,6 @@ class Installer:
     #
     # Haskell
     #
-
     self.__run_command("sudo apt-get install ghc cabal-install", True)
 
     #
@@ -166,14 +159,14 @@ class Installer:
     self.__run_command("rm ringojs_0.9-1_all.deb")
 
     #
-    # Mono
+    # Mono - TODO - this install script doesn't work.
     #
-    self.__run_command("git clone git://github.com/mono/mono", retry=True)
-    self.__run_command("git checkout mono-3.2.3", cwd="mono")
-    self.__run_command("./autogen.sh --prefix=/usr/local", cwd="mono")
-    self.__run_command("make get-monolite-latest", cwd="mono")
-    self.__run_command("make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe", cwd="mono")
-    self.__run_command("sudo make install", cwd="mono")
+    #self.__run_command("git clone git://github.com/mono/mono", retry=True)
+    #self.__run_command("git checkout mono-3.2.3", cwd="mono")
+    #self.__run_command("./autogen.sh --prefix=/usr/local", cwd="mono")
+    #self.__run_command("make get-monolite-latest", cwd="mono")
+    #self.__run_command("make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe", cwd="mono")
+    #self.__run_command("sudo make install", cwd="mono")
 
     self.__run_command("mozroots --import --sync", retry=True)
 
@@ -192,8 +185,6 @@ class Installer:
     self.__run_command("./build.sh", cwd="nimrod/csources")
     self.__run_command("bin/nimrod c koch", cwd="nimrod")
     self.__run_command("./koch boot -d:release", cwd="nimrod")
-    self.__run_command("sudo ./koch install /usr/bin", cwd="nimrod")
-
 
     #
     # Racket
@@ -207,7 +198,6 @@ class Installer:
     #
     # Ur/Web
     #
-
     self.__run_command("hg clone -r3cc14f1e47d1 http://hg.impredicative.com/urweb")
     self.__run_command("./autogen.sh", cwd="urweb")
     self.__run_command("./configure", cwd="urweb")
@@ -284,21 +274,18 @@ class Installer:
     #
     self.__download("http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-2.3.3.zip")
     self.__run_command("unzip -o grails-2.3.3.zip")
-    self.__run_command("rm grails-2.3.3.zip")
 
     #
     # Play 2
     #
     self.__download("http://downloads.typesafe.com/play/2.2.0/play-2.2.0.zip")
     self.__run_command("unzip -o play-2.2.0.zip")
-    self.__run_command("rm play-2.2.0.zip")
 
     #
     # Play 1
     #
     self.__download("http://downloads.typesafe.com/releases/play-1.2.5.zip")
     self.__run_command("unzip -o play-1.2.5.zip")
-    self.__run_command("rm play-1.2.5.zip")
     self.__run_command("mv play-1.2.5/play play-1.2.5/play1")
 
     # siena
@@ -337,7 +324,7 @@ class Installer:
     #
     # Onion
     #
-    self.__run_command("git clone [email protected]:davidmoreno/onion.git")
+    self.__run_command("git clone https://github.com/davidmoreno/onion.git")
     self.__run_command("mkdir build", cwd="onion")
     self.__run_command("cmake ..", cwd="onion/build")
     self.__run_command("make", cwd="onion/build")