Browse Source

Merge pull request #2475 from nbrady-techempower/hosts

Use /etc/hosts aliases instead of $DBHOST and other
Mike Smith 8 years ago
parent
commit
c094138092

+ 3 - 3
benchmark.cfg.example

@@ -1,9 +1,9 @@
 [Defaults]
 # Available Keys: 
-client_host=127.0.0.1
+client_host=TFB-client
 client_identity_file=None
 client_user=techempower
-database_host=127.0.0.1
+database_host=TFB-database
 database_identity_file=None
 database_os=linux
 database_user=techempower
@@ -20,7 +20,7 @@ query_levels=[1, 5,10,15,20]
 threads=8
 mode=benchmark
 os=linux
-server_host=127.0.0.1
+server_host=TFB-server
 sleep=60
 test=None
 type=all

+ 0 - 2
frameworks/C++/cpoll_cppsp/setup.sh

@@ -1,7 +1,5 @@
 #!/bin/bash
 
-sed -i 's|#define BENCHMARK_DB_HOST ".*"|#define BENCHMARK_DB_HOST "'"$DBHOST"'"|g' www/connectioninfo.H
-
 fw_depends postgresql-server-dev-9.3 cppsp
 
 make clean

+ 1 - 1
frameworks/C++/cpoll_cppsp/www/connectioninfo.H

@@ -1,4 +1,4 @@
-#define BENCHMARK_DB_HOST "localhost"
+#define BENCHMARK_DB_HOST "TFB-database"
 #define MYSQL_MAX_CONNECTIONS 3000
 
 #include <stdexcept>

+ 1 - 1
frameworks/C/h2o/setup.sh

@@ -36,7 +36,7 @@ run_curl()
 run_h2o_app()
 {
 	"$1/h2o_app" -a1 -f "$2/template/fortunes.mustache" -m "$DB_CONN" "$3" "$4" \
-		-d "host=$DBHOST dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass" &
+		-d "host=TFB-database dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass" &
 }
 
 generate_profile_data()

+ 1 - 1
frameworks/Clojure/compojure/hello/src/hello/handler.clj

@@ -29,7 +29,7 @@
   (mysql {
           :classname "com.mysql.jdbc.Driver"
           :subprotocol "mysql"
-          :subname "//127.0.0.1:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"
+          :subname "//TFB-database:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"
           :user "benchmarkdbuser"
           :password "benchmarkdbpass"
           ;;OPTIONAL KEYS

+ 0 - 2
frameworks/Clojure/compojure/setup.sh

@@ -2,8 +2,6 @@
 
 fw_depends mysql java resin leiningen
 
-sed -i 's|127.0.0.1|'"${DBHOST}"'|g' hello/src/hello/handler.clj
-
 cd hello
 lein clean
 lein ring uberwar

+ 2 - 2
frameworks/JavaScript/ringojs/ringo-main.js

@@ -3,8 +3,8 @@ var mustache = require('ringo/mustache');
 
 // DO NOT TOUCH THE FOLLOWING LINE.
 // THIS VARIABLE IS REGEX REPLACED BY setup.py
-var dbHost = 'localhost';
-var mongodbUri = 'mongodb://localhost/hello_world';
+var dbHost = 'TFB-database';
+var mongodbUri = 'mongodb://TFB-database/hello_world';
 
 var sortFortunes = function(a, b) {
  return (a.message < b.message) ? -1 : (a.message > b.message) ? 1 : 0;

+ 1 - 2
frameworks/JavaScript/ringojs/setup.sh

@@ -1,7 +1,5 @@
 #!/bin/bash
 
-sed -i 's|dbHost = \x27.*\x27;|dbHost = \x27'"${DBHOST}"'\x27|g' ringo-main.js
-
 fw_depends mysql java ringojs
 
 rm -rf $RINGOJS_HOME/packages/*
@@ -9,3 +7,4 @@ ringo-admin install oberhamsi/sql-ringojs-client
 (cd $RINGOJS_HOME/packages/sql-ringojs-client/jars && curl -s -o mysql.jar https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.39/mysql-connector-java-5.1.39.jar)
 
 ringo --production -J-server -J-Xmx1g -J-Xms1g ringo-main.js &
+

+ 5 - 0
toolset/travis/travis_setup.sh

@@ -36,3 +36,8 @@ echo "database_user=travis"                            >> benchmark.cfg
 echo "runner_user=travis"                              >> benchmark.cfg
 
 echo "travis ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee -a /etc/sudoers
+
+echo 127.0.0.1 TFB-database | sudo tee --append /etc/hosts
+echo 127.0.0.1 TFB-client   | sudo tee --append /etc/hosts
+echo 127.0.0.1 TFB-server   | sudo tee --append /etc/hosts
+