Giter VIP home page Giter VIP logo

testildo's Introduction

* For js/ part you need NPM 1.0+, Mongoose 1.0+, Node.js 0.6+
* For java/ part you need Java 1.6+, Sbt, Spring 3.1+ and Play 2.0+ 

---
Preparing Mongo DB instance for the test:

Registered Database on https://mongolab.com/home

URI: mongodb://testildouser:[email protected]:31637/testildodb
Database: testildodb
User: testildouser
Password: testildopwd

During the tests I find this very helpful:

$ mongo ds031637.mongolab.com:31637/testildodb -u testildouser -p testildopwd
MongoDB shell version: 2.0.2
connecting to: ds031637.mongolab.com:31637/testildodb
> db.testjavarecords.remove({});
> db.testjsrecords.remove({});

And to verify that there are no survivors:

> db.testjsrecords.count({});
0
> db.testjavarecords.count({});
0

---
** Running new EC2 instance:

Make sure you have installed http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip and:

$ export EC2_HOME=/opt/local/ec2-api-tools-1.5.2.5
$ export PATH=$PATH:$EC2_HOME/bin

$ export EC2_PRIVATE_KEY=`ls ~/.ec2/pk-*.pem`
$ export EC2_CERT=`ls ~/.ec2/cert-*.pem`

check with:

$ echo $EC2_CERT
$ echo $EC2_PRIVATE_KEY

$ ssh-keygen -I testildo-ec2 -f ~/Dropbox/_keys/alexeypro/testildo-ec2
$ ec2-import-keypair testildo-ec2 -f /Users/alexey/Dropbox/_keys/alexeypro/testildo-ec2.pub
$ ec2-describe-keypairs
$ chmod 700 ~/Dropbox/_keys/alexeypro/testildo-ec2.pub
$ ec2-describe-images -o amazon | grep ami-31814f58
$ ec2-run-instances ami-31814f58 -k testildo-ec2

write down the i-XXXXXX so we can tag it:

$ ec2-create-tags i-10230b74 --tag Name=testildo

Enabling ssh port, and ports for our servers
$ ec2-authorize default -p 22
$ ec2-authorize default -p 9000
$ ec2-authorize default -p 9191
$ ec2-authorize default -p 8000
$ ec2-authorize default -p 8181

$ ec2-describe-instances

write down the IP address (first one) and let's go:

$ ssh -v -i ~/Dropbox/_keys/alexeypro/testildo-ec2 [email protected]

---
** Installing Git

$ sudo yum install git 

---
** Node.js, NPM, Express and Mongoose on EC2:

Pretty straightforward, just using this instruction: https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager

$ sudo yum localinstall --nogpgcheck http://nodejs.tchol.org/repocfg/amzn1/nodejs-stable-release.noarch.rpm
$ sudo yum install nodejs-compat-symlinks npm
$ node --version
v0.6.13

$ cd /tmp && sudo bash

$ curl http://npmjs.org/install.sh | sh
$ npm install mongoose
$ npm install express
$ npm install async

---
** Java, Sbt, Play on EC2:

$ sudo bash

$ mkdir -p /opt/local
$ cd /opt/local

$ wget http://download.oracle.com/otn-pub/java/jdk/7u1-b08/jdk-7u1-linux-i586.rpm
$ rpm -i jdk-7u1-linux-i586.rpm

Default Java is OpenJDK 1.6:

$ java -version
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.6) (amazon-52.1.10.6.41.amzn1-i386)
OpenJDK Client VM (build 20.0-b11, mixed mode)

Change it to the new one:

$ /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_01/bin/java 20000
$ /usr/sbin/alternatives --config java

Just double checking we are good to go:L

$ java -version
java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
Java HotSpot(TM) Client VM (build 21.1-b02, mixed mode, sharing)

Installing Play Framework now:

$ wget -c http://download.playframework.org/releases/play-2.0.zip
$ unzip play-2.0.zip
$ export PATH=$PATH:/opt/local/play-2.0

---
** Checking out source code from GitHub:

$ pwd
/home/ec2-user

$ git clone https://github.com/alexeypro/testildo.git

---
** Installing LT software on other instance:

Let's stop current so we don't waste money:

$ ec2-describe-instances
$ ec2-stop-instances i-10230b74
$ ec2-describe-instance-status i-10230b74

Need to create new box for the client and install "httperf" http://www.hpl.hp.com/research/linux/httperf and "autobench" https://github.com/menavaur/Autobench
Autobench's config you can get from https://github.com/menavaur/Autobench/blob/master/autobench.conf
I got AMI from http://alestic.com/, which is Ubuntu 11.10 Oneiric EBS boot 64 bit (us-east-1)

$ ec2-run-instances ami-baba68d3 -k testildo-ec2
$ ec2-create-tags i-b1c029d6 --tag Name=testildo_client
$ ec2-describe-instances
$ ssh -v -i ~/Dropbox/_keys/alexeypro/testildo-ec2 [email protected]
$ sudo apt-get -y install git-core
$ sudo apt-get install apache2-utils
$ sudo apt-get install httperf
$ sudo apt-get install make
$ git clone https://github.com/menavaur/Autobench.git

Need out conf file :-)
$ sudo cp autobench.conf /home/ubuntu/.autobench.conf

$ ec2-stop-instances i-b1c029d6

Just in case -- on Mac OS X it's just as simple as:
$ brew install autobench
$ brew install httperf
$ brew install gnuplot

Copy config and run uncommenting specific URI:

$ cp conf/autobench.conf ~/.autobench.conf

We want to clone this server instance so we run JS and Java side by side:

$ ec2-create-tags i-10230b74 --tag Name=testildo_js
$ ec2-create-image i-10230b74 -n testildo_server_ami

Then wait... wait.. wait.. (Take a while, huh?) Basically I think we a looking at 30-45 minutes before it'll be done.

$ ec2-run-instances ami-39b96050 -k testildo-ec2
$ ec2-create-tags i-35ef0452 --tag Name=testildo_java

Now we should be good to go. Start both (js, and java) and client:

$ ec2-start-instances i-10230b74
$ ec2-start-instances i-35ef0452
$ ec2-start-instances i-b1c029d6

$ alias ssh_testjs="ssh -v -i ~/Dropbox/_keys/alexeypro/testildo-ec2 [email protected]"
$ alias ssh_testjava="ssh -v -i ~/Dropbox/_keys/alexeypro/testildo-ec2 [email protected]"
$ alias ssh_testclient="ssh -v -i ~/Dropbox/_keys/alexeypro/testildo-ec2 [email protected]"

Log in, launch Java and Node stuff with run.sh's.
Ready to go back to the client and run autobench :-)

./autobench --host1 ec2-23-20-136-73.compute-1.amazonaws.com --host2 ec2-174-129-116-151.compute-1.amazonaws.com --file ~/.sample1.tsv

Getting results back:

$ scp -v -i ~/Dropbox/_keys/alexeypro/testildo-ec2 [email protected]:/home/ubuntu/TEST* ./results/

Converting to CSV from TSV:

$ tr '\t' ',' < ~/code/alexeypro/testildo/results/TEST-find.tsv > TEST-find.csv 
$ tr '\t' ',' < ~/code/alexeypro/testildo/results/TEST-helloworld.tsv > TEST-helloworld.csv 
$ tr '\t' ',' < ~/code/alexeypro/testildo/results/TEST-save.tsv > TEST-save.csv 
$ tr '\t' ',' < ~/code/alexeypro/testildo/results/TEST-saveasync.tsv > TEST-saveasync.csv 

Use anything like http://home.gna.org/veusz/downloads/ to build graphs

testildo's People

Watchers

James Cloos avatar Tim Spann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.