thanhleviet
7/6/2015 - 8:15 AM

setup.md

  • TODO: need to check block device mapping flags

  • crank up an instance

      ec2-run-instances --key ec2-keypair ami-aa30c7c3 --instance-type=cg1.4xlarge \
      --block-device-mapping '/dev/sdb=ephemeral0' \
      --block-device-mapping '/dev/sdc=ephemeral1'
    
  • check for instance status and to get ip address for ssh

      ec2-describe-instances
    
  • if you haven't, allow ssh to default group (need this once)

      ec2-authorize default -p 22
    
  • connect over ssh

      ssh -i ec2-keypair root@ec2-xx-yy-zz-qqq.compute-1.amazonaws.com
    
  • get subversion client and some other items (can run as single command)

      yum install subversion
      yum install screen
      yum install automake
      yum install libtool
      yum install java-1.6.0-openjdk-devel.x86_64
      yum install gcc-c++
      yum install ant # to build beast
    
  • add a user if you want

      useradd whoever
      passwd whoever
    
  • get the newest CUDA toolkit

      cd /usr/local/src
      wget http://developer.download.nvidia.com/compute/cuda/3_2_prod/toolkit/cudatoolkit_3.2.16_linux_64_rhel5.5. run
      chmod 0755 cudatoolkit_3.2.16_linux_64_rhel5.5.run
      ./cudatoolkit_3.2.16_linux_64_rhel5.5.run
    
  • update .bash_profile PATH and LD_LIBRARY_PATH to add CUDA goodies (filled these in from memory, may be wrong)

      export PATH=/usr/local/cuda/bin:$PATH
      export LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH
    
  • get the beagle library

      cd /usr/local/src && svn checkout http://beagle-lib.googlecode.com/svn/trunk/ beagle-lib
      cd beagle-lib
      ./autogen.sh # if you get an error here you may need to install libtool
      ./configure
      make
      sudo make install
      make check # tests passed
    
  • go ahead and get BEAST

      cd /usr/local/src
      svn co http://beast-mcmc.googlecode.com/svn/trunk/ beast-mcmc
      cd beast-mcmc
      ant
    
  • mount up some space (if not mounted; whoever is your user)

      mount /dev/sdc /mnt/data
      chown root:whoever /mnt/data
      chmod 0775 /mnt/data
    
  • get data from somewhere

      wget http://my.data.from.somewhere/my_data.xml
    
  • run beast-beagle with your data (or using $BEAST_HOME/examples/benchmark*.xml)

      screen # to start a session from which you can detach
      java -Xmx18000m -Djava.library.path=/usr/local/lib \
          -cp /usr/local/src/beast-mcmc/build/dist/beast.jar:/usr/local/src/beast-mcmc/lib/beagle.jar \
          dr.app.beast.BeastMain -beagle -beagle_GPU data.from.somewhere.xml
    
  • detach from the session w/

      <ctrl><a><d>
    

Bonus Round

Assuming you have setup Amazon SES for your account, you can download the Amazon SES scripts (http://docs.amazonwebservices.com/ses/latest/GettingStartedGuide/) and email yourself that way ("normal" emails usually fail to arrive). You'll need to install openssl and openssl-devel, and perhaps some other thigns (can't remember):

    yum install openssl openssl-devel
    perl -MCPAN -e 'install Digest::SHA'
    perl -MCPAN -e 'install URI::Escape'
    perl -MCPAN -e 'install Bundle::LWP'
    perl -MCPAN -e 'install MIME::Base64'
    perl -MCPAN -e 'install Crypt::SSLeay'
    perl -MCPAN -e 'install XML::LibXML'
  • Per the GettingStartedGuide, put your credentials somewhere (I put them on the ephemeral share)

      nano /mnt/data/aws-access.txt
      # paste in your credentials
    
  • Per the user guide, give some access to your email addresses, and verify via the amazon email

  • Now, start your run. The ses-send-email.pl runs on completion of the run.

      screen # to start a session from which you can detach
      java -Xmx18000m -Djava.library.path=/usr/local/lib \
      -cp /usr/local/src/beast-mcmc/build/dist/beast.jar:/usr/local/src/beast-mcmc/lib/beagle.jar \
      dr.app.beast.BeastMain -beagle -beagle_GPU -beagle_order 1,2,0 data.from.somewhere.xml \
      && perl -I/mnt/data/bin /mnt/data/bin/ses-send-email.pl \
      -k /mnt/data/aws-access.txt -s "Run Completed" -f your.email@domain.com xxxxxxxxxx@txt.att.net
    
  • The above assumes you use ATT. Some other service providers:

    • Alltel [10-digit phone number]@message.alltel.com
    • Boost Mobile [10-digit phone number]@myboostmobile.com
    • Sprint [10-digit phone number]@messaging.sprintpcs.com
    • T-Mobile [10-digit phone number]@tmomail.net
    • Verizon [10-digit phone number]@vtext.com
    • Virgin Mobile USA [10-digit phone number]@vmobl.com