Skip to content

centos 5.4 cluster compute

Justin Riley edited this page Jul 11, 2011 · 2 revisions

StarCluster Cluster Compute AMI Cookbook CentOS 5.4

This cookbook will work with the Generic Amazon HVM and the Rightscale HVM images. It is based on the Ubuntu 9.10 AMI Cookbook and the CentOS 5 AMI Cookbook

Launch AMI and Install Packages

  1. Update package list:

    yum update
  2. Remove g77 if installed:

    yum -y remove g77

3. Set up the repositories to safely install packages missing from Centos repositories:

yum -y install yum-priorities yum-utils
cd /etc/yum.repos.d
wget http://s3tools.org/repo/CentOS_5/s3tools.repo
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
  1. Check and install rpmforge rpms:

    rpm -K rpmforge-release-0.5.1-1.el5.rf.*.rpm
    rpm -i rpmforge-release-0.5.1-1.el5.rf.*.rpm
    rm -f rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
  2. Setup Python 2.6 repositories:

    wget http://dagobah.ftphosting.net/yum/smartfile.repo -O /etc/yum.repos.d/smartfile.repo

6. Set the priority of each entry in each repo file in /etc/yum.repos.d by adding a line “priority = 1” for each of the entries in the Centos repo files and “priority = 2” for each of the entries in the other repo files.

  1. Install s3cmd:

    yum -y install s3cmd

Development tools and libraries

  1. Install build essential tools:

    yum -y groupinstall "Development Tools" "Development Libraries" "X Software Development"
  2. Install Python-related packages:

    yum -y install python26 python26-devel python26-libs \
    python26-setuptools python26-setuptools-devel python26-simplejson \
    python26-imaging python26-imaging-devel python-curl python26-docutils \
    python26-lxml python26-memcached python26-Django
    
    easy_install26 pyyaml boto dnspython pip virtualenv pssh multiprocessing ctypes nose pyrex
  3. Install other tools and libraries:

    yum -y install nfs-utils-lib-devel java-1.6.0-openjdk-devel zsh ksh csh \
    tcsh unzip mysql screen httpd emacs ntsysv bz2 curses sqlite zlib keychain tmux \
    git mercurial encfs libyaml-devel rxvt

OpenMPI

  1. Install OpenMPI development package:

    yum -y install openmpi-devel
  2. Configure mpi via mpi-selector:

    mpi-selector --set openmpi-1.4-gcc-x86_64 --yes --system
  3. Logout and login to get the updated mpi environment
  4. Test the grid engine. This show give:

    ompi_info | grep -i grid
            # MCA ras: gridengine (MCA v2.0, API v2.0, Component v1.4.1)
  5. Install mpi4py:

    easy_install26 mpi4py
  6. Test mpi4py installation:

    mpi4py_version="mpi4py-1.2.1"
    wget http://mpi4py.googlecode.com/files/$mpi4py_version.tar.gz
    tar xzvf $mpi4py_version.tar.gz
    cd $mpi4py_version/test
    python26 runalltest.py

Configure Sun Grid Engine

  1. Launch one of the 32bit or 64bit StarCluster AMI's and copy /opt/sge6-fresh to /opt/sge6-fresh on your new image host.
  2. Install DRMAA-python:

    wget http://drmaa-python.googlecode.com/files/DRMAA-python-0.2.tar.gz
    tar xzvf DRMAA-python-0.2.tar.gz
    cd DRMAA-python-0.2
    nano setup.py # set SGE6_ROOT='/opt/sge6-fresh' and save
    python26 setup.py install
    cd ..
    rm -f  DRMAA-python-0.2.tar.gz
    ln -s /opt/sge6-fresh/lib/lx24-amd64/libdrmaa.so.1.0 /usr/lib64/libdrmaa.so.1.0
    ln -s /usr/lib64/libdrmaa.so.1.0 /usr/lib64/libdrmaa.so
  3. Test:

    python26 -c "import DRMAA"
    python26 -c "import drmaa"

Configure BLAS/LAPACK/NumPy/SciPY/etc

Please follow the same instructions listed in the StarCluster Ubuntu 10.10 Guide

Build PETSc (OPTIONAL)

This section is purely optional and was documented because the original author of the guide needed PETSc. Please ignore if you have no interest in PETSc.

  1. Download the sources:

    petsc_version="petsc-3.1-p4"
    DEV_HOME=/usr/local/src
    mkdir /usr/lib/petsc
    cd /usr/lib/petsc
    wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/$petsc_version.tar.gz
    tar xzvf $petsc_version.tar.gz
    cd $petsc_version
  2. Configure PETSc:

    ./config/configure.py --configModules=PETSc.Configure --optionsModule=PETSc.compilerOptions \
    --with-x=1 --with-debugging=0  --with-shared --useThreads 0 \
    --with-mpi-dir=/usr/lib64/openmpi/1.4-gcc \
    --with-blas-lib="[/usr/lib/libcblas.so,/usr/lib/libf77blas.so,/usr/lib/libatlas.so]" \
    --with-lapack-lib="[/usr/lib/liblapack.so,/usr/lib/libatlas.so]" \
    --with-umfpack=1 --with-umfpack-include=/usr/include \
    --with-umfpack-lib="[/usr/lib/libumfpack.so,/usr/lib/libamd.a]" \
    --download-plapack
  3. Build PETSc:

    export PETSC_DIR=$PWD
    export PETSC_ARCH=linux-gnu-c-opt
    make all test
  4. Cleanup tar.gz files:

    cd ../
    rm -f $petsc_version.tar.gz
    cd ~
    rm -f $DEV_HOME/PLAPACKR32.tgz
  5. Install petsc4py:

    easy_install26 petsc4py
  6. Test the installation:

    wget http://petsc4py.googlecode.com/files/petsc4py-1.1.tar.gz
    tar xzvf petsc4py-1.1.tar.gz
    cd petsc4py-1.1/test
    python26 runtests.py
    cd ~
    rm -f petsc4py-1.1.tar.gz
    rm -Rf petsc4py-1.1

Build the NLTK (OPTIONAL)

This section is purely optional and was documented because the original author of the guide needed NLTK. Please ignore if you have no interest in NLTK.

  1. Download sources:

    nltk_version="nltk-2.0b9"
    easy_install26 nltk
    wget http://nltk.googlecode.com/files/$nltk_version.zip
    unzip $nltk_version.zip
    cd $nltk_version
  2. Install ntlk:

    python26 setup.py install
  3. Cleanup:

    cd ../
    rm -f $nltk_version.zip
    rm -Rf $nltk_version
  4. Download nltk download (can take a while!):

    python26 -m nltk.downloader -d /usr/share/nltk_data all

Creating the AMI

In a local terminal:

starcluster ebsimage <id> <name>