Browse Source

Tidy up and try to perfect bash_profile removal

- Make minor adjustments after merge conflict, clean up
- Load the benchmark_profile again
- Move llvm-dev installation to sudo apt-get group
- Set default location of PHP for composer.
- Export JAVA_HOME where sbt is used
- This is the 3rd commit message:
- Add removed comments with guidance back in
- This is the 4th commit message:
- Use COMPOSER_HOME and make it consistent
- This is the 5th commit message:
- Export URWEB_HOME
- Add missing export for C++/wt postgres
- Move exports from bash_profile for Python/pyramid
Brittany Mazza 10 years ago
parent
commit
282bec9a70

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

@@ -7,8 +7,8 @@ export WT_ROOT=${IROOT}/wt
 export WT_LIB=${WT_ROOT}/lib
 export WT_INC=${WT_ROOT}/include
 
+# This has to be included here since it is one of the vars NOT copied from the original environment
 export LD_LIBRARY_PATH="${BOOST_LIB}:${WT_LIB}:${LD_LIBRARY_PATH}"
-
 export CPLUS_INCLUDE_PATH=/usr/include/postgresql:/usr/include/postgresql/9.3/server:$CPLUS_INCLUDE_PATH
 
 sed -i 's|INSERT_DB_HOST_HERE|'"${DBHOST}"'|g' benchmark.cpp

+ 2 - 0
frameworks/C++/wt/setup_postgres.sh

@@ -7,7 +7,9 @@ export WT_ROOT=${IROOT}/wt
 export WT_LIB=${WT_ROOT}/lib
 export WT_INC=${WT_ROOT}/include
 
+# This has to be included here since it is one of the vars NOT copied from the original environment
 export LD_LIBRARY_PATH="${BOOST_LIB}:${WT_LIB}:${LD_LIBRARY_PATH}"
+export CPLUS_INCLUDE_PATH=/usr/include/postgresql:/usr/include/postgresql/9.3/server:$CPLUS_INCLUDE_PATH
 
 sed -i 's|INSERT_DB_HOST_HERE|'"${DBHOST}"'|g' benchmark.cpp
 

+ 2 - 2
frameworks/PHP/README.md

@@ -100,7 +100,7 @@ install the dependencies required by your project.
     fw_depends php composer 
     
     # Download dependencies
-    ${IROOT}/php-5.5.17/bin/php $IROOT/composer.phar install \
+    ${IROOT}/php-5.5.17/bin/php ${COMPOSER_HOME}/composer.phar install \
     --no-interaction --working-dir $TROOT --no-progress \
     --optimize-autoloader 
 
@@ -139,7 +139,7 @@ queries as they are shown. Use these steps
     # This will manually prompt you for your Github credentials 
     # to avoid the Github rate limit
     # When this command completes, you will have a lock file 
-    ${IROOT}/php-5.5.17/bin/php $IROOT/composer.phar install \
+    ${IROOT}/php-5.5.17/bin/php ${COMPOSER_HOME}/composer.phar install \
       --working-dir $TROOT
     
     # Add the lock file to this repository

+ 1 - 1
frameworks/PHP/Yii2/install.sh

@@ -4,6 +4,6 @@ export COMPOSER_HOME=${IROOT}/php-composer
 
 fw_depends php nginx composer
 
-${PHP_HOME}/bin/php $COMPOSER_HOME/composer.phar install \
+${PHP_HOME}/bin/php ${COMPOSER_HOME}/composer.phar install \
   --no-interaction --working-dir $TROOT \
   --no-progress --optimize-autoloader 

+ 2 - 1
frameworks/PHP/cakephp/install.sh

@@ -1,11 +1,12 @@
 #!/bin/bash
 
 export PHP_HOME=${IROOT}/php-5.5.17
+export COMPOSER_HOME=${IROOT}/php-composer
 export PHP_FPM=$PHP_HOME/sbin/php-fpm
 export NGINX_HOME=${IROOT}/nginx
 
 fw_depends php nginx composer
 
-${PHP_HOME}/bin/php $IROOT/composer.phar install \
+${PHP_HOME}/bin/php ${COMPOSER_HOME}/composer.phar install \
   --no-interaction --working-dir $TROOT \
   --no-progress --optimize-autoloader 

+ 1 - 1
frameworks/PHP/fuel/install.sh

@@ -8,6 +8,6 @@ export NGINX_HOME=${IROOT}/nginx
 
 fw_depends php nginx composer
 
-${PHP_HOME}/bin/php $COMPOSER_HOME/composer.phar install \
+${PHP_HOME}/bin/php ${COMPOSER_HOME}/composer.phar install \
   --no-interaction --working-dir $TROOT \
   --no-progress --optimize-autoloader 

+ 5 - 0
frameworks/PHP/hhvm/setup_hhvm.sh

@@ -1,5 +1,10 @@
 #!/bin/bash
 
+export PHP_HOME=${IROOT}/php-5.5.17
+export PHP_FPM=${PHP_HOME}/sbin/php-fpm
+export PATH="$PHP_HOME/bin:$PHP_HOME/sbin:$PATH"
+export NGINX_HOME=${IROOT}/nginx
+
 sed -i 's|host=localhost;|host='"${DBHOST}"';|g' once.php.inc
 sed -i 's|SourceRoot = .*/FrameworkBenchmarks/hhvm|SourceRoot = '"${TROOT}"'|g' deploy/config.hdf
 sed -i 's|Path = .*/.hhvm.hhbc|Path = '"${TROOT}"'/.hhvm.bbhc|g' deploy/config.hdf

+ 1 - 1
frameworks/PHP/kohana/install.sh

@@ -6,7 +6,7 @@ export NGINX_HOME=${IROOT}/nginx
 
 fw_depends php nginx composer
 
-${PHP_HOME}/bin/php $COMPOSER_HOME/composer.phar install \
+${PHP_HOME}/bin/php ${COMPOSER_HOME}/composer.phar install \
   --no-interaction --working-dir $TROOT \
   --no-progress --optimize-autoloader 
 

+ 1 - 1
frameworks/PHP/lithium/install.sh

@@ -7,7 +7,7 @@ export NGINX_HOME=${IROOT}/nginx
 
 fw_depends php nginx composer
 
-${PHP_HOME}/bin/php $COMPOSER_HOME/composer.phar install \
+${PHP_HOME}/bin/php ${COMPOSER_HOME}/composer.phar install \
   --no-interaction --working-dir $TROOT \
   --no-progress --optimize-autoloader 
 

+ 2 - 1
frameworks/PHP/php-fatfree/setup.sh

@@ -1,6 +1,7 @@
 #!/bin/bash
+
 export PHP_HOME=${IROOT}/php-5.5.17
-export PHP_FPM=$PHP_HOME/sbin/php-fpm
+export PHP_FPM=${PHP_HOME}/sbin/php-fpm
 export NGINX_HOME=${IROOT}/nginx
 
 sed -i 's|localhost|'"${DBHOST}"'|g' index.php

+ 6 - 4
frameworks/PHP/php-laravel/install.sh

@@ -1,9 +1,11 @@
 #!/bin/bash
 
-fw_depends php nginx composer
-
 export PHP_HOME=${IROOT}/php-5.5.17
+export COMPOSER_HOME=${IROOT}/php-composer
+
+fw_depends php nginx composer
 
-${PHP_HOME}/bin/php ${IROOT}/composer.phar install \
+${PHP_HOME}/bin/php ${COMPOSER_HOME}/composer.phar install \
   --no-interaction --working-dir ${TROOT} \
-  --no-progress --optimize-autoloader 
+  --no-progress --optimize-autoloader 
+  

+ 2 - 1
frameworks/PHP/php-laravel/setup.sh

@@ -1,6 +1,7 @@
 #!/bin/bash
 
 export PHP_HOME=${IROOT}/php-5.5.17
+export COMPOSER_HOME=${IROOT}/php-composer
 export PHP_FPM=${PHP_HOME}/sbin/php-fpm
 export NGINX_HOME=${IROOT}/nginx
 
@@ -11,4 +12,4 @@ sed -i 's|/home/vagrant/FrameworkBenchmarks/installs/nginx/|'"${IROOT}"'/nginx/|
 export PATH="${PHP_HOME}/bin:${PHP_HOME}/sbin:$PATH"
 
 $PHP_FPM --fpm-config ${FWROOT}/config/php-fpm.conf -g ${TROOT}/deploy/php-fpm.pid
-${NGINX_HOME}/sbin/nginx -c ${TROOT}/deploy/nginx.conf
+${NGINX_HOME}/sbin/nginx -c ${TROOT}/deploy/nginx.conf

+ 1 - 1
frameworks/PHP/php/install.sh

@@ -6,6 +6,6 @@ export NGINX_HOME=${IROOT}/nginx
 
 fw_depends php nginx composer
 
-${PHP_HOME}/bin/php $COMPOSER_HOME/composer.phar install \
+${PHP_HOME}/bin/php ${COMPOSER_HOME}/composer.phar install \
   --no-interaction --working-dir $TROOT \
   --no-progress --optimize-autoloader 

+ 1 - 1
frameworks/PHP/phreeze/install.sh

@@ -7,6 +7,6 @@ export NGINX_HOME=${IROOT}/nginx
 
 fw_depends php nginx composer
 
-${PHP_HOME}/bin/php $COMPOSER_HOME/composer.phar install \
+${PHP_HOME}/bin/php ${COMPOSER_HOME}/composer.phar install \
   --no-interaction --working-dir $TROOT \
   --no-progress --optimize-autoloader 

+ 1 - 1
frameworks/PHP/symfony2-stripped/install.sh

@@ -6,6 +6,6 @@ export NGINX_HOME=${IROOT}/nginx
 
 fw_depends php composer nginx
 
-${PHP_HOME}/bin/php $COMPOSER_HOME/composer.phar install \
+${PHP_HOME}/bin/php ${COMPOSER_HOME}/composer.phar install \
   --no-interaction --working-dir $TROOT \
   --no-progress --optimize-autoloader 

+ 0 - 14
frameworks/Python/pyramid/bash_profile.sh

@@ -1,14 +0,0 @@
-export PY2_ROOT=$IROOT/py2
-export PY2=$PY2_ROOT/bin/python
-export PY2_PIP=$PY2_ROOT/bin/pip
-export PY2_GUNICORN=$PY2_ROOT/bin/gunicorn
-
-export PYPY_ROOT=$IROOT/pypy
-export PYPY=$PYPY_ROOT/bin/python
-export PYPY_PIP=$PYPY_ROOT/bin/pip
-export PYPY_GUNICORN=$PYPY_ROOT/bin/gunicorn
-
-export PY3_ROOT=$IROOT/py3
-export PY3=$PY3_ROOT/bin/python3
-export PY3_PIP=$PY3_ROOT/bin/pip3
-export PY3_GUNICORN=$PY3_ROOT/bin/gunicorn

+ 15 - 0
frameworks/Python/pyramid/install.sh

@@ -1,5 +1,20 @@
 #!/bin/bash
 
+export PY2_ROOT=$IROOT/py2
+export PY2=$PY2_ROOT/bin/python
+export PY2_PIP=$PY2_ROOT/bin/pip
+export PY2_GUNICORN=$PY2_ROOT/bin/gunicorn
+
+export PYPY_ROOT=$IROOT/pypy
+export PYPY=$PYPY_ROOT/bin/python
+export PYPY_PIP=$PYPY_ROOT/bin/pip
+export PYPY_GUNICORN=$PYPY_ROOT/bin/gunicorn
+
+export PY3_ROOT=$IROOT/py3
+export PY3=$PY3_ROOT/bin/python
+export PY3_PIP=$PY3_ROOT/bin/pip3
+export PY3_GUNICORN=$PY3_ROOT/bin/gunicorn
+
 mkdir -p $IROOT/.pip_cache
 export PIP_DOWNLOAD_CACHE=$IROOT/.pip_cache
 

+ 6 - 1
frameworks/Python/pyramid/setup_py2.sh

@@ -1,3 +1,8 @@
 #!/bin/bash
 
-$PY2_GUNICORN wsgi:app -c gunicorn_conf.py &
+export PY2_ROOT=$IROOT/py2
+export PY2=$PY2_ROOT/bin/python
+export PY2_PIP=$PY2_ROOT/bin/pip
+export PY2_GUNICORN=$PY2_ROOT/bin/gunicorn
+
+$PY2_GUNICORN wsgi:app -c gunicorn_conf.py &

+ 6 - 1
frameworks/Python/pyramid/setup_py3.sh

@@ -1,3 +1,8 @@
 #!/bin/bash
 
-$PY3_GUNICORN wsgi:app -c gunicorn_conf.py &
+export PY3_ROOT=$IROOT/py3
+export PY3=$PY3_ROOT/bin/python3
+export PY3_PIP=$PY3_ROOT/bin/pip3
+export PY3_GUNICORN=$PY3_ROOT/bin/gunicorn
+
+$PY3_GUNICORN wsgi:app -c gunicorn_conf.py &

+ 1 - 1
frameworks/Ruby/README.md

@@ -12,7 +12,7 @@ In your framework's `install.sh`, put this prior to other statements:
 Because TFB uses Python's `subprocess` module, which runs 
 all shell processes in a non-login mode, you must source the 
 `rvm` script before using `rvm` anywhere. Placing the `source`
-call in your `insatll.sh` before other commands ensures that it 
+call in your `install.sh` before other commands ensures that it 
 will be called before installation and before running `setup.py`
 
 For compatibility with how the framework rounds are executed, 

+ 0 - 2
frameworks/Ruby/rails/run_unicorn.sh

@@ -13,8 +13,6 @@ else
 	source $HOME/.rvm/scripts/rvm
 fi
 
-sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
-
 $NGINX_HOME/sbin/nginx -c $TROOT/config/nginx.conf
 
 DB_HOST=${DBHOST} rvm 2.1.2 do bundle exec unicorn_rails -E production -c $TROOT/config/unicorn.rb &

+ 1 - 0
frameworks/Scala/finagle/setup.sh

@@ -1,5 +1,6 @@
 #!/bin/bash
 export SBT_HOME=${IROOT}/sbt
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 
 ${SBT_HOME}/bin/sbt update compile
 

+ 1 - 0
frameworks/Scala/lift-stateless/setup.sh

@@ -1,5 +1,6 @@
 #!/bin/bash
 export SBT_HOME=${IROOT}/sbt
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 
 sed -i 's|> ".*:3306|> "'"${DBHOST}"':3306|g' src/main/scala/Main.scala
 

+ 1 - 0
frameworks/Scala/plain/setup.sh

@@ -1,5 +1,6 @@
 #!/bin/bash
 export SBT_HOME=${IROOT}/sbt
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 
 sed -i 's|127.0.0.1|'"${DBHOST}"'|g' src/main/resources/application.conf
 

+ 1 - 0
frameworks/Scala/scalatra/setup.sh

@@ -1,6 +1,7 @@
 #!/bin/bash
 export RESIN_HOME=${IROOT}/resin-4.0.41
 export SBT_HOME=${IROOT}/sbt
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 
 sed -i 's|mysql://.*:3306|mysql://'"${DBHOST}"':3306|g' src/main/webapp/WEB-INF/resin-web.xml
 

+ 1 - 0
frameworks/Scala/spray/setup.sh

@@ -1,5 +1,6 @@
 #!/bin/bash
 export SBT_HOME=${IROOT}/sbt
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 
 ${SBT_HOME}/bin/sbt assembly
 

+ 1 - 0
frameworks/Scala/unfiltered/setup_unfiltered.sh

@@ -1,5 +1,6 @@
 #!/bin/bash
 export SBT_HOME=${IROOT}/sbt
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 
 sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' src/main/resources/application.conf
 sed -i 's|maxThreads = .*|maxThreads = '"${MAX_THREADS}"'|g' src/main/resources/application.conf

+ 3 - 2
frameworks/Ur/urweb/setup_mysql.sh

@@ -1,7 +1,8 @@
 #!/bin/bash
 
-${URWEB_HOME}/bin/urweb -dbms mysql -db "dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass host=${DBHOST}" bench
-
+export URWEB_HOME=${IROOT}/urweb
 export LD_LIBRARY_PATH=${URWEB_HOME}/lib
 
+${URWEB_HOME}/bin/urweb -dbms mysql -db "dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass host=${DBHOST}" bench
+
 ./bench.exe -q -k -t ${MAX_THREADS} &

+ 6 - 0
toolset/setup/linux/installer.py

@@ -107,6 +107,12 @@ class Installer:
       previousDir = os.getcwd()
       os.chdir(test_dir)
 
+      # Load benchmark_profile file
+      profile="$FWROOT/config/benchmark_profile"
+      setup_util.replace_environ(config=profile, 
+        command='export TROOT=%s && export IROOT=%s' %
+        (test_dir, test_install_dir))
+
       # Run test installation script
       #   FWROOT - Path of the FwBm root
       #   IROOT  - Path of this test's install directory

+ 2 - 4
toolset/setup/linux/prerequisites.sh

@@ -41,7 +41,8 @@ sudo apt-get -qqy install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options:
   libpq-dev mlton \
   libjemalloc-dev libluajit-5.1-dev `# Needed by lwan at least` \
   libhiredis-dev                    `# Redis client - Needed by ngx_mruby at least` \
-  cloc dstat                        `# Collect resource usage statistics`
+  cloc dstat                        `# Collect resource usage statistics` \
+  llvm-dev                          `# Required for correct Ruby installation`
 
 # Install gcc-4.8
 sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
@@ -60,7 +61,4 @@ RETCODE=$(fw_exists ~/.bash_profile.bak)
 
 sudo sh -c "echo '*               -    nofile          65535' >> /etc/security/limits.conf"
 
-#Ensure llvm-dev is installed (required for ruby to install correctly)
-sudo apt-get install llvm-dev
-
 touch fwbm_prereqs_installed

+ 3 - 2
toolset/setup/linux/systools/composer.sh

@@ -5,14 +5,15 @@ RETCODE=$(fw_exists ${IROOT}/php-composer.installed)
 
 fw_depends php
 
+PHP_HOME=${PHP_HOME:-${IROOT}/php-5.5.17}
+
 mkdir -p php-composer
 cd php-composer
 
 fw_get https://getcomposer.org/installer -O composer-installer.php
 
 # Use the PHP and composer from our PHP_HOME directory and 
-# COMPOSER_HOME directories (should be specified in frameworks 
-# install.sh file)
+# COMPOSER_HOME directories
 ${PHP_HOME}/bin/php composer-installer.php --install-dir=${COMPOSER_HOME}
 
 cd ..