Skip to content

Commit

Permalink
setup.sh fixes, added yesod back in
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Mar 17, 2011
1 parent e16bfa1 commit d1a15dd
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 14 deletions.
5 changes: 5 additions & 0 deletions pong/pong.cabal
Expand Up @@ -25,3 +25,8 @@ Executable happstack
Main-is: happstack.hs Main-is: happstack.hs
Build-depends: base > 4, happstack-server Build-depends: base > 4, happstack-server
Ghc-options: -O2 -threaded -rtsopts Ghc-options: -O2 -threaded -rtsopts

Executable yesod
Main-is: yesod.hs
Build-depends: base > 4, yesod-core, bytestring
Ghc-options: -O2 -threaded -rtsopts
3 changes: 2 additions & 1 deletion pong/runall.sh
Expand Up @@ -4,7 +4,8 @@ mkdir -p results
./snap.sh $* ./snap.sh $*
./warp.sh $* ./warp.sh $*
./happstack.sh $* ./happstack.sh $*
./php.sh sudo ./php.sh
./tornado.sh ./tornado.sh
./node.sh ./node.sh
./goliath.sh ./goliath.sh
./winstone.sh
19 changes: 19 additions & 0 deletions pong/yesod.hs
@@ -0,0 +1,19 @@
{-# LANGUAGE OverloadedStrings, QuasiQuotes, TypeFamilies, TemplateHaskell, MultiParamTypeClasses #-}
import Yesod.Dispatch
import Yesod.Core
import Yesod.Content
import Data.ByteString (ByteString)
import Network.Wai.Handler.Warp (run)

data Pong = Pong
mkYesod "Pong" [$parseRoutes|
/ PongR GET
|]

instance Yesod Pong where
approot _ = ""
encryptKey _ = return Nothing

getPongR = return $ RepPlain $ toContent ("PONG" :: ByteString)

main = toWaiAppPlain Pong >>= run 3000
8 changes: 8 additions & 0 deletions pong/yesod.sh
@@ -0,0 +1,8 @@
#!/bin/bash -x
DIR="$( cd "$( dirname "$0" )" && pwd )"
d=$(readlink -f $DIR)
source lib.sh

./dist/build/yesod/yesod $* &

benchmark
40 changes: 27 additions & 13 deletions setup.sh
@@ -1,14 +1,23 @@
apt-get install -y build-essential libgmp3-dev zlib1g-dev git-core curl httperf libbsd-dev #!/bin/bash

# This script is intended to be run on a 64-bit Ubuntu server install or a
# 64-bit Ubuntu EC2 instance. The command I use to create that instance is:

# ec2-run-instances ami-cef405a7 -k ec2-keypair -t c1.xlarge

sudo apt-get update

sudo apt-get install -y build-essential libgmp3-dev zlib1g-dev git-core curl httperf libbsd-dev


# Haskell # Haskell


## GHC ## GHC
cd ~ cd ~
wget http://haskell.org/ghc/dist/7.0.2/ghc-7.0.2-i386-unknown-linux.tar.bz2 wget http://haskell.org/ghc/dist/7.0.2/ghc-7.0.2-x86_64-unknown-linux.tar.bz2
tar jxfv ghc-7.0.2-i386-unknown-linux.tar.bz2 tar jxfv ghc-7.0.2-x86_64-unknown-linux.tar.bz2
cd ghc-7.0.2 cd ghc-7.0.2
./configure ./configure
make install sudo make install


## cabal ## cabal
cd ~ cd ~
Expand All @@ -18,23 +27,26 @@ cd cabal-install-0.10.2
sh bootstrap.sh sh bootstrap.sh


# nginx (for PHP) # nginx (for PHP)
cd ~
sudo apt-get install -y libprce3-dev libssl-dev sudo apt-get install -y libprce3-dev libssl-dev
wget http://sysoev.ru/nginx/nginx-0.8.54.tar.gz wget http://sysoev.ru/nginx/nginx-0.8.54.tar.gz
tar zxfv nginx-0.8.54.tar.gz tar zxfv nginx-0.8.54.tar.gz
cd nginx-0.8.54 cd nginx-0.8.54
./configure ./configure
make make
make install sudo make install


# PHP # PHP
apt-get install -y libxml2-dev cd ~
sudo apt-get install -y libxml2-dev
wget http://www.php.net/get/php-5.3.5.tar.bz2/from/de.php.net/mirror wget http://www.php.net/get/php-5.3.5.tar.bz2/from/de.php.net/mirror
mv mirror php-5.3.5.tar.bz2 mv mirror php-5.3.5.tar.bz2
tar jxfv php-5.3.5.tar.bz2 tar jxfv php-5.3.5.tar.bz2
cd php-5.3.5 cd php-5.3.5
./configure --enable-fpm ./configure --enable-fpm
make all make all
sudo groupadd nobody sudo make install
sudo sudo groupadd nobody


# Ruby # Ruby


Expand All @@ -49,12 +61,14 @@ rvm use 1.9.2
gem install goliath gem install goliath


# Python # Python
apt-get install -y python-setuptools python-pycurl sudo apt-get install -y python-setuptools python-pycurl


## Tornado ## Tornado
cd ~ cd ~
wget --no-check-certficate http://github.com/downloads/facebook/tornado/tornado-1.2.1.tar.gz wget http://github.com/downloads/facebook/tornado/tornado-1.2.1.tar.gz --no-check-certficate
tar zxfv tornado-1.2.1.tar.gz tar zxfv tornado-1.2.1.tar.gz
cd tornado-1.2.1
sudo python setup.py install


# node.js # node.js
cd ~ cd ~
Expand All @@ -63,10 +77,10 @@ tar zxfv node-v0.4.2.tar.gz
cd node-v0.4.2 cd node-v0.4.2
./configure --without-ssl ./configure --without-ssl
make make
make install sudo make install


# Java # Java
apt-get install -y openjdk-6-jre-headless sudo apt-get install -y openjdk-6-jre-headless


# libev for Snap # libev for Snap
cd ~ cd ~
Expand All @@ -75,8 +89,8 @@ tar zxfv libev-4.04.tar.gz
cd libev-4.04 cd libev-4.04
./configure ./configure
make make
make install sudo make install
ldconfig sudo ldconfig


# Run the benchmarks themselves # Run the benchmarks themselves


Expand Down

0 comments on commit d1a15dd

Please sign in to comment.