installer.py 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. import subprocess
  2. import os
  3. import time
  4. import sys
  5. class Installer:
  6. ############################################################
  7. # install_software
  8. ############################################################
  9. def install_software(self):
  10. if self.benchmarker.install == 'all' or self.benchmarker.install == 'server':
  11. self.__install_server_software()
  12. if self.benchmarker.install == 'all' or self.benchmarker.install == 'client':
  13. self.__install_client_software()
  14. ############################################################
  15. # End install_software
  16. ############################################################
  17. ############################################################
  18. # __install_server_software
  19. ############################################################
  20. def __install_server_software(self):
  21. #######################################
  22. # Prerequisites
  23. #######################################
  24. self.__run_command("sudo apt-get update", True)
  25. self.__run_command("sudo apt-get upgrade", True)
  26. self.__run_command("sudo apt-get install build-essential libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev python-software-properties unzip git-core libcurl4-openssl-dev libbz2-dev libmysqlclient-dev mongodb-clients libreadline6-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev libgdbm-dev ncurses-dev automake libffi-dev htop libtool bison libevent-dev libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 liborc-0.4-0 libwxbase2.8-0 libwxgtk2.8-0 libgnutls-dev libjson0-dev libmcrypt-dev libicu-dev cmake gettext curl libpq-dev mercurial", True)
  27. self.__run_command("sudo add-apt-repository ppa:ubuntu-toolchain-r/test", True)
  28. self.__run_command("sudo apt-get update", True)
  29. self.__run_command("sudo apt-get install gcc-4.8 g++-4.8", True)
  30. self.__run_command("cp ../config/benchmark_profile ../../.bash_profile")
  31. self.__run_command("sudo sh -c \"echo '* - nofile 16384' >> /etc/security/limits.conf\"")
  32. ##############################################################
  33. #
  34. # System Tools
  35. #
  36. ##############################################################
  37. #
  38. # Leiningen
  39. #
  40. self.__run_command("mkdir -p bin")
  41. self.__run_command("wget https://raw.github.com/technomancy/leiningen/stable/bin/lein")
  42. self.__run_command("mv lein bin/lein")
  43. self.__run_command("chmod +x bin/lein")
  44. #
  45. # Maven
  46. #
  47. self.__run_command("sudo apt-get install maven -qq")
  48. self.__run_command("mvn -version")
  49. #######################################
  50. # Languages
  51. #######################################
  52. self._install_python()
  53. #
  54. # Dart
  55. #
  56. self.__run_command("curl https://storage.googleapis.com/dart-editor-archive-integration/latest/dartsdk-linux-64.tar.gz | tar xvz")
  57. #
  58. # Erlang
  59. #
  60. self.__run_command("sudo cp ../config/erlang.list /etc/apt/sources.list.d/erlang.list")
  61. self.__run_command("wget -O - http://binaries.erlang-solutions.com/debian/erlang_solutions.asc | sudo apt-key add -")
  62. self.__run_command("sudo apt-get update")
  63. self.__run_command("sudo apt-get install esl-erlang", True)
  64. #
  65. # nodejs
  66. #
  67. self.__run_command("curl http://nodejs.org/dist/v0.10.8/node-v0.10.8-linux-x64.tar.gz | tar xvz")
  68. #
  69. # Java
  70. #
  71. self.__run_command("sudo apt-get install openjdk-7-jdk", True)
  72. self.__run_command("sudo apt-get remove --purge openjdk-6-jre openjdk-6-jre-headless", True)
  73. #
  74. # Ruby/JRuby
  75. #
  76. self.__run_command("curl -L get.rvm.io | bash -s head")
  77. self.__run_command("echo rvm_auto_reload_flag=2 >> ~/.rvmrc")
  78. self.__bash_from_string("source ~/.rvm/scripts/'rvm' && rvm install 2.0.0-p0")
  79. self.__bash_from_string("source ~/.rvm/scripts/'rvm' && rvm 2.0.0-p0 do gem install bundler")
  80. self.__bash_from_string("source ~/.rvm/scripts/'rvm' && rvm install jruby-1.7.4")
  81. self.__bash_from_string("source ~/.rvm/scripts/'rvm' && rvm jruby-1.7.4 do gem install bundler")
  82. # We need a newer version of jruby-rack
  83. self.__run_command("git clone git://github.com/jruby/jruby-rack.git")
  84. self.__bash_from_string("cd jruby-rack && source ~/.rvm/scripts/'rvm' && rvm jruby-1.7.4 do bundle install")
  85. self.__bash_from_string("cd jruby-rack && source ~/.rvm/scripts/'rvm' && rvm jruby-1.7.4 do jruby -S bundle exec rake clean gem SKIP_SPECS=true")
  86. self.__bash_from_string("cd jruby-rack/target && source ~/.rvm/scripts/'rvm' && rvm jruby-1.7.4 do gem install jruby-rack-1.2.0.SNAPSHOT.gem")
  87. #
  88. # go
  89. #
  90. self.__run_command("curl http://go.googlecode.com/files/go1.1.1.linux-amd64.tar.gz | tar xvz")
  91. #
  92. # Perl
  93. #
  94. # Sometimes this HTTP server returns 404, so retry a few times until it works, but don't retry forever
  95. tries = 0
  96. while True:
  97. self.__run_command("curl 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 | tar xvz");
  98. if os.path.exists(os.path.join('installs', 'ActivePerl-5.16.3.1603-x86_64-linux-glibc-2.3.5-296746')):
  99. break
  100. tries += 1
  101. if tries >= 30:
  102. raise Exception('Could not download ActivePerl after many retries')
  103. time.sleep(5)
  104. 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)
  105. self.__run_command("curl -L http://cpanmin.us | perl - --sudo App::cpanminus")
  106. 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")
  107. #
  108. # php
  109. #
  110. self.__run_command("wget --trust-server-names http://www.php.net/get/php-5.4.13.tar.gz/from/us1.php.net/mirror")
  111. self.__run_command("tar xvf php-5.4.13.tar.gz")
  112. 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")
  113. self.__run_command("make", cwd="php-5.4.13")
  114. self.__run_command("sudo make install", cwd="php-5.4.13")
  115. self.__run_command("printf \"\\n\" | sudo pecl install apc-beta", cwd="php-5.4.13")
  116. self.__run_command("sudo cp ../config/php.ini /usr/local/lib/php.ini")
  117. self.__run_command("sudo cp ../config/php-fpm.conf /usr/local/lib/php-fpm.conf")
  118. self.__run_command("rm php-5.4.13.tar.gz")
  119. # Composer
  120. self.__run_command("curl -sS https://getcomposer.org/installer | php -- --install-dir=bin")
  121. # Phalcon
  122. self.__run_command("git clone git://github.com/phalcon/cphalcon.git")
  123. self.__run_command("sudo ./install", cwd="cphalcon/build")
  124. # YAF
  125. self.__run_command("sudo pecl install yaf")
  126. #
  127. # Haskell
  128. #
  129. self.__run_command("sudo apt-get install ghc cabal-install", True)
  130. #
  131. # RingoJs
  132. #
  133. self.__run_command("wget http://www.ringojs.org/downloads/ringojs_0.9-1_all.deb")
  134. self.__run_command("sudo apt-get install jsvc", True)
  135. self.__run_command("sudo dpkg -i ringojs_0.9-1_all.deb", True)
  136. self.__run_command("rm ringojs_0.9-1_all.deb")
  137. #
  138. # Mono
  139. #
  140. self.__run_command("git clone git://github.com/mono/mono")
  141. self.__run_command("git checkout mono-3.0.10", cwd="mono")
  142. self.__run_command("./autogen.sh --prefix=/usr/local", cwd="mono")
  143. self.__run_command("make get-monolite-latest", cwd="mono")
  144. self.__run_command("make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe", cwd="mono")
  145. self.__run_command("sudo make install", cwd="mono")
  146. self.__run_command("mozroots --import --sync")
  147. self.__run_command("git clone git://github.com/mono/xsp")
  148. self.__run_command("git checkout 3.0", cwd="xsp")
  149. self.__run_command("./autogen.sh --prefix=/usr/local", cwd="xsp")
  150. self.__run_command("make", cwd="xsp")
  151. self.__run_command("sudo make install", cwd="xsp")
  152. #
  153. # Nimrod
  154. #
  155. self.__run_command("wget http://www.nimrod-code.org/download/nimrod_0.9.2.zip")
  156. self.__run_command("unzip nimrod_0.9.2.zip")
  157. self.__run_command("chmod +x build.sh", cwd="nimrod")
  158. self.__run_command("./build.sh", cwd="nimrod")
  159. self.__run_command("chmod +x install.sh", cwd="nimrod")
  160. self.__run_command("sudo ./install.sh /usr/bin", cwd="nimrod")
  161. #######################################
  162. # Webservers
  163. #######################################
  164. #
  165. # Nginx
  166. #
  167. self.__run_command("curl http://nginx.org/download/nginx-1.4.1.tar.gz | tar xvz")
  168. self.__run_command("./configure", cwd="nginx-1.4.1")
  169. self.__run_command("make", cwd="nginx-1.4.1")
  170. self.__run_command("sudo make install", cwd="nginx-1.4.1")
  171. #
  172. # Openresty (nginx with openresty stuff)
  173. #
  174. self.__run_command("curl http://openresty.org/download/ngx_openresty-1.2.7.5.tar.gz | tar xvz")
  175. self.__run_command("./configure --with-luajit", cwd="ngx_openresty-1.2.7.5")
  176. self.__run_command("make", cwd="ngx_openresty-1.2.7.5")
  177. self.__run_command("sudo make install", cwd="ngx_openresty-1.2.7.5")
  178. #
  179. # Resin
  180. #
  181. self.__run_command("sudo cp -r /usr/lib/jvm/java-1.7.0-openjdk-amd64/include /usr/lib/jvm/java-1.7.0-openjdk-amd64/jre/bin/")
  182. self.__run_command("curl http://www.caucho.com/download/resin-4.0.36.tar.gz | tar xz")
  183. self.__run_command("./configure --prefix=`pwd`", cwd="resin-4.0.36")
  184. self.__run_command("make", cwd="resin-4.0.36")
  185. self.__run_command("make install", cwd="resin-4.0.36")
  186. self.__run_command("mv conf/resin.properties conf/resin.properties.orig", cwd="resin-4.0.36")
  187. self.__run_command("cat ../config/resin.properties > resin-4.0.36/conf/resin.properties")
  188. self.__run_command("mv conf/resin.xml conf/resin.xml.orig", cwd="resin-4.0.36")
  189. self.__run_command("cat ../config/resin.xml > resin-4.0.36/conf/resin.xml")
  190. ##############################################################
  191. #
  192. # Frameworks
  193. #
  194. ##############################################################
  195. ##############################
  196. # Grails
  197. ##############################
  198. self.__run_command("wget http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-2.1.1.zip")
  199. self.__run_command("unzip -o grails-2.1.1.zip")
  200. self.__run_command("rm grails-2.1.1.zip")
  201. ##############################
  202. # Play 2
  203. ##############################
  204. self.__run_command("wget http://downloads.typesafe.com/play/2.1.2-RC1/play-2.1.2-RC1.zip")
  205. self.__run_command("unzip -o play-2.1.2-RC1.zip")
  206. self.__run_command("rm play-2.1.2-RC1.zip")
  207. ##############################
  208. # Play 1
  209. ##############################
  210. self.__run_command("wget http://downloads.typesafe.com/releases/play-1.2.5.zip")
  211. self.__run_command("unzip -o play-1.2.5.zip")
  212. self.__run_command("rm play-1.2.5.zip")
  213. self.__run_command("mv play-1.2.5/play play-1.2.5/play1")
  214. # siena
  215. self.__run_command("play-1.2.5/play1 install siena", send_yes=True)
  216. ##############################
  217. # TreeFrog Framework
  218. ##############################
  219. self.__run_command("sudo apt-get install qt4-qmake libqt4-dev libqt4-sql-mysql g++", True)
  220. self.__run_command("wget http://downloads.sourceforge.net/project/treefrog/src/treefrog-1.6.tar.gz")
  221. self.__run_command("tar xzf treefrog-1.6.tar.gz")
  222. self.__run_command("rm treefrog-1.6.tar.gz")
  223. self.__run_command("./configure --enable-mongo", cwd="treefrog-1.6")
  224. self.__run_command("make", cwd="treefrog-1.6/src")
  225. self.__run_command("sudo make install", cwd="treefrog-1.6/src")
  226. self.__run_command("make", cwd="treefrog-1.6/tools")
  227. self.__run_command("sudo make install", cwd="treefrog-1.6/tools")
  228. ##############################
  229. # Vert.x
  230. ##############################
  231. self.__run_command("curl http://vert-x.github.io/vertx-downloads/downloads/vert.x-1.3.1.final.tar.gz | tar xvz")
  232. ##############################
  233. # Yesod
  234. ##############################
  235. self.__run_command("cabal update")
  236. self.__run_command("cabal install yesod persistent-mysql")
  237. ##############################
  238. # Jester
  239. ##############################
  240. self.__run_command("git clone git://github.com/dom96/jester.git jester/jester")
  241. ############################################################
  242. # End __install_server_software
  243. ############################################################
  244. def _install_python(self):
  245. # .profile is not loaded yet. So we should use full path.
  246. pypy_bin = "~/FrameworkBenchmarks/installs/pypy/bin"
  247. python_bin = "~/FrameworkBenchmarks/installs/py2/bin"
  248. python3_bin= "~/FrameworkBenchmarks/installs/py3/bin"
  249. def easy_install(pkg, two=True, three=False, pypy=False):
  250. cmd = "/easy_install -ZU '" + pkg + "'"
  251. if two: self.__run_command(python_bin + cmd)
  252. if three: self.__run_command(python3_bin + cmd)
  253. if pypy: self.__run_command(pypy_bin + cmd)
  254. self.__run_command("curl -L http://bitbucket.org/pypy/pypy/downloads/pypy-2.0.2-linux64.tar.bz2 | tar xj")
  255. self.__run_command('ln -sf pypy-2.0.2 pypy')
  256. self.__run_command("curl -L http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz | tar xz")
  257. self.__run_command("curl -L http://www.python.org/ftp/python/3.3.2/Python-3.3.2.tar.xz | tar xJ")
  258. self.__run_command("./configure --prefix=$HOME/FrameworkBenchmarks/installs/py2 --disable-shared CC=gcc-4.8", cwd="Python-2.7.5")
  259. self.__run_command("./configure --prefix=$HOME/FrameworkBenchmarks/installs/py3 --disable-shared CC=gcc-4.8", cwd="Python-3.3.2")
  260. self.__run_command("make -j", cwd="Python-2.7.5")
  261. self.__run_command("make install", cwd="Python-2.7.5")
  262. self.__run_command("make -j", cwd="Python-3.3.2")
  263. self.__run_command("make install", cwd="Python-3.3.2")
  264. self.__run_command("wget https://bitbucket.org/pypa/setuptools/downloads/ez_setup.py")
  265. self.__run_command(pypy_bin + "/pypy ez_setup.py")
  266. self.__run_command(python_bin + "/python ez_setup.py")
  267. self.__run_command(python3_bin + "/python3 ez_setup.py")
  268. easy_install('pip==1.3.1', two=True, three=True, pypy=True)
  269. easy_install('MySQL-python==1.2.4', two=True, three=False, pypy=True)
  270. easy_install('https://github.com/clelland/MySQL-for-Python-3/archive/master.zip',
  271. two=False, three=True, pypy=False)
  272. easy_install('PyMySQL==0.5', pypy=True)
  273. easy_install('PyMySQL3==0.5', two=False, three=True)
  274. easy_install('simplejson==3.3.0', two=True, three=True, pypy=False)
  275. easy_install('psycopg2==2.5.1', three=True)
  276. easy_install('ujson==1.33', three=True)
  277. easy_install('https://github.com/downloads/surfly/gevent/gevent-1.0rc2.tar.gz', three=True)
  278. easy_install('uwsgi', three=True) # uwsgi is released too often to stick on single version.
  279. # Gunicorn
  280. easy_install('gunicorn==17.5', two=True, three=True, pypy=True)
  281. # meinheld HEAD supports gunicorn worker on Python 3
  282. easy_install('https://github.com/mopemope/meinheld/archive/master.zip',
  283. two=True, three=True, pypy=True)
  284. # Tornado
  285. easy_install('tornado==3.1', two=True, three=True, pypy=True)
  286. easy_install('motor==0.1.1', two=True, three=True, pypy=True)
  287. easy_install('pymongo==2.5.2', two=True, three=True, pypy=True)
  288. # Django
  289. easy_install("https://www.djangoproject.com/download/1.6b1/tarball/", two=True, three=True, pypy=True)
  290. # Flask
  291. easy_install('Werkzeug==0.9.2', two=True, three=True, pypy=True)
  292. easy_install('flask==0.10.1', two=True, three=True, pypy=True)
  293. easy_install('sqlalchemy==0.8.2', two=True, three=True, pypy=True)
  294. easy_install('Jinja2==2.7', two=True, three=True, pypy=True)
  295. easy_install('Flask-SQLAlchemy==1.0', two=True, three=True, pypy=True)
  296. # Bottle
  297. easy_install('bottle==0.11.6', two=True, three=True, pypy=True)
  298. easy_install('bottle-sqlalchemy==0.4', two=True, three=True, pypy=True)
  299. ############################################################
  300. # __install_error
  301. ############################################################
  302. def __install_error(self, message):
  303. print("\nINSTALL ERROR: %s\n" % message)
  304. if self.benchmarker.install_error_action == 'abort':
  305. sys.exit("Installation aborted.")
  306. ############################################################
  307. # End __install_error
  308. ############################################################
  309. ############################################################
  310. # __install_client_software
  311. ############################################################
  312. def __install_client_software(self):
  313. self.__run_command(self.benchmarker.sftp_string(batch_file="config/client_sftp_batch"), True)
  314. remote_script = """
  315. ##############################
  316. # Prerequisites
  317. ##############################
  318. yes | sudo apt-get update
  319. yes | sudo apt-get install build-essential git libev-dev libpq-dev libreadline6-dev postgresql
  320. sudo sh -c "echo '* - nofile 16384' >> /etc/security/limits.conf"
  321. sudo mkdir -p /ssd
  322. sudo mkdir -p /ssd/log
  323. ##############################
  324. # MySQL
  325. ##############################
  326. sudo sh -c "echo mysql-server mysql-server/root_password_again select secret | debconf-set-selections"
  327. sudo sh -c "echo mysql-server mysql-server/root_password select secret | debconf-set-selections"
  328. yes | sudo apt-get install mysql-server
  329. sudo stop mysql
  330. # use the my.cnf file to overwrite /etc/mysql/my.cnf
  331. sudo mv /etc/mysql/my.cnf /etc/mysql/my.cnf.orig
  332. sudo mv my.cnf /etc/mysql/my.cnf
  333. sudo cp -R -p /var/lib/mysql /ssd/
  334. sudo cp -R -p /var/log/mysql /ssd/log
  335. sudo cp usr.sbin.mysqld /etc/apparmor.d/
  336. sudo /etc/init.d/apparmor reload
  337. sudo start mysql
  338. # Insert data
  339. mysql -uroot -psecret < create.sql
  340. ##############################
  341. # Postgres
  342. ##############################
  343. sudo useradd benchmarkdbuser -p benchmarkdbpass
  344. sudo -u postgres psql template1 < create-postgres-database.sql
  345. sudo -u benchmarkdbuser psql hello_world < create-postgres.sql
  346. sudo -u postgres -H /etc/init.d/postgresql stop
  347. sudo mv postgresql.conf /etc/postgresql/9.1/main/postgresql.conf
  348. sudo mv pg_hba.conf /etc/postgresql/9.1/main/pg_hba.conf
  349. sudo cp -R -p /var/lib/postgresql/9.1/main /ssd/postgresql
  350. sudo -u postgres -H /etc/init.d/postgresql start
  351. ##############################
  352. # wrk
  353. ##############################
  354. git clone https://github.com/wg/wrk.git
  355. cd wrk
  356. make
  357. sudo cp wrk /usr/local/bin
  358. cd ~
  359. git clone https://github.com/wg/wrk.git wrk-pipeline
  360. cd wrk-pipeline
  361. git checkout pipeline
  362. make
  363. sudo cp wrk /usr/local/bin/wrk-pipeline
  364. cd ~
  365. ##############################
  366. # MongoDB
  367. ##############################
  368. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
  369. sudo cp 10gen.list /etc/apt/sources.list.d/10gen.list
  370. sudo apt-get update
  371. yes | sudo apt-get install mongodb-10gen
  372. sudo stop mongodb
  373. sudo mv /etc/mongodb.conf /etc/mongodb.conf.orig
  374. sudo mv mongodb.conf /etc/mongodb.conf
  375. sudo cp -R -p /var/lib/mongodb /ssd/
  376. sudo cp -R -p /var/log/mongodb /ssd/log/
  377. sudo start mongodb
  378. """
  379. print "Installing client software"
  380. p = subprocess.Popen(self.benchmarker.ssh_string.split(" "), stdin=subprocess.PIPE)
  381. p.communicate(remote_script)
  382. returncode = p.returncode
  383. if returncode != 0:
  384. self.__install_error("Subprocess failed with status code %s." % returncode)
  385. ############################################################
  386. # End __install_client_software
  387. ############################################################
  388. ############################################################
  389. # __run_command
  390. ############################################################
  391. def __run_command(self, command, send_yes=False, cwd=None):
  392. try:
  393. cwd = os.path.join(self.install_dir, cwd)
  394. except AttributeError:
  395. cwd = self.install_dir
  396. print("\nINSTALL: Running '%s' in %s" % (command, cwd))
  397. if send_yes:
  398. process = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE, cwd=cwd)
  399. process.communicate("yes")
  400. returncode = process.returncode
  401. else:
  402. returncode = subprocess.call(command, shell=True, cwd=cwd)
  403. if returncode != 0:
  404. self.__install_error("Call to '%s' in directory '%s' returned with status code %s." % (command, cwd, returncode))
  405. ############################################################
  406. # End __run_command
  407. ############################################################
  408. ############################################################
  409. # __bash_from_string
  410. # Runs bash -c "command" in install_dir.
  411. ############################################################
  412. def __bash_from_string(self, command):
  413. self.__run_command('bash -c "%s"' % command)
  414. ############################################################
  415. # End __bash_from_string
  416. ############################################################
  417. ############################################################
  418. # __init__(benchmarker)
  419. ############################################################
  420. def __init__(self, benchmarker):
  421. self.benchmarker = benchmarker
  422. self.install_dir = "installs"
  423. try:
  424. os.mkdir(self.install_dir)
  425. except OSError:
  426. pass
  427. ############################################################
  428. # End __init__
  429. ############################################################
  430. # vim: sw=2