Note: This document provided for informational purposes
We recommend that users download the PEcAn (pecan.ova) or ED (ed.ova) VM instead of creating from one from scratch.
Then install VirtualBox or VMware and follow instructions on the page Using VM's.
First create virtual machine
# ---------------------------------------------------------------------- # CREATE VM USING FOLLOWING: # - CPU = 1 # - MEMORY = 1GB # - DISK = 50GB # - PACKAGE = openssh # ----------------------------------------------------------------------
Make sure machine is up to date.
# ---------------------------------------------------------------------- # Update VM sudo apt-get update sudo apt-get dist-upgrade reboot
Install compiler and other packages needed.
# ---------------------------------------------------------------------- # install build environment sudo apt-get -y install build-essential
Install tools for virtual environment, either VMWare or VirtualBox
# ---------------------------------------------------------------------- # install vmware tools (if running in VMWare) sudo apt-get -y install --no-install-recommends open-vm-dkms open-vm-tools
# ---------------------------------------------------------------------- # install virtual box tools (if running in virtual box) #sudo apt-get --no-install-recommends -y install virtualbox-ose-dkms virtualbox-ose-guest-utils sudo mount /dev/cdrom /mnt sudo /mnt/VBoxLinuxAdditions.run sudo umount /mnt sudo addgroup pecan vboxsf
Make sure machine has SSH keys (rc.local)
sudo wget -O /etc/rc.local http://isda.ncsa.illinois.edu/~kooper/EBI/rc.local
# ---------------------------------------------------------------------- # install build environment sudo apt-get -y install dkms build-essential bzr gfortran openmpi-bin libhdf5-openmpi-dev
Pull code for ED from ebi-cluster
# ---------------------------------------------------------------------- # Get latest code from David #bzr branch sftp://kooper@ebi-forecast.igb.uiuc.edu/home/kooper/src/EDBRAMS # PECAN 1.0 wget http://isda.ncsa.illinois.edu/~kooper/EBI/EDBRAMS.tgz tar zxf EDBRAMS.tgz rm EDBRAMS.tgz
Following fixes have been checked into this version of ED:
# ---------------------------------------------------------------------- # fix some compile errors vi +118 EDBRAMS/ED/src/utils/rsys.F90 real :: etime vi +37 EDBRAMS/ED/src/io/h5_output.F90 ,globdims,plist_id
Create configuration file for ubuntu (this is already in bazaar, include.mk.opt.ubuntu)
Update paths.mk file to point to install location of the source code and create symlink.
# ----------------------------------------------------------------------
# configure and compile ed
cd EDBRAMS/ED/build/bin
# set path in paths.mk
sed -i -e "s#^ED_ROOT.*#ED_ROOT=${HOME}/EDBRAMS/ED#" paths.mk
ln -s include.mk.opt.ubuntu include.mk.opt
Can now compile ED and install the binary as ed2 in /usr/local/bin
# compile ed and install as ed2 in /usr/local/bin bash ./install.sh sudo cp ../ed_2.1-opt /usr/local/bin/ed2 cd
# ----------------------------------------------------------------------
# Get data
wget http://isda.ncsa.illinois.edu/~kooper/EBI/sites.tgz
tar zxf sites.tgz
rm sites.tgz
wget http://isda.ncsa.illinois.edu/~kooper/EBI/inputs.tgz
tar zxf inputs.tgz
rm inputs.tgz
# fix metdata
sed -i -e "s#/home/kooper/projects/EBI#${HOME}#" sites/*/ED_MET_DRIVER_HEADER
# ----------------------------------------------------------------------
# Create sample run
mkdir testrun.ed
cd testrun.ed
Create the ED2IN file and config.xml files by downloading the following two attachments:
wget -O ED2IN http://isda.ncsa.illinois.edu/~kooper/EBI/ED2IN sed -i -e "s#\$HOME#$HOME#" ED2IN wget -O config.xml http://isda.ncsa.illinois.edu/~kooper/EBI/config.xml
Check out PEcAn and add alias to help build pecan
cd
# check out pecan
# latest
#bzr branch sftp://kooper@ebi-forecast.igb.uiuc.edu/home/kooper/src/pecan
# PECAN 1.0
wget http://isda.ncsa.illinois.edu/~kooper/EBI/pecan.tgz
tar zxf pecan.tgz
rm pecan.tgz
# add build alias
if ! grep buildpecan ~/.bashrc > /dev/null
then
echo "alias buildpecan='sudo /home/$USER/pecan/bash/pecanbuild.sh'" >> ~/.bashrc
fi
alias buildpecan='sudo /home/$USER/pecan/bash/pecanbuild.sh'
Install R
# add Michael Rutter's deb repository of R packages sudo apt-get install -y python-software-properties sudo add-apt-repository ppa:marutter/rrutter sudo apt-get update # install minimal R sudo apt-get --no-install-recommends -y install r-base-core # install other R packages sudo apt-get install -y default-jre libdbd-mysql libmysqlclient16-dev mysql-server mysql-client jags r-cran-rjags r-cran-xml r-cran-hdf5 r-cran-mass r-cran-rmysql liblapack-dev # have R install rest of dependencies sudo R --vanilla < ~/pecan/rscripts/install.dependencies.R
Compile PEcAn and install
sudo ~/pecan/bash/pecanbuild.sh
Create folders
mkdir testrun.pecan cd testrun.pecan
Create BETY database
# needs to be done only once mysql -u root -p -e "grant all on bety.* to bety@localhost identified by 'bety';" # download and update/install database wget http://isda.ncsa.illinois.edu/~kooper/EBI/bety.sql mysql -u bety -p"bety" -e 'drop database if exists bety; create database bety;' mysql -u bety -p"bety" bety < bety.sql rm bety.sqlCreate the files needed for a single run:
wget -O template.pavi http://isda.ncsa.uiuc.edu/~kooper/EBI/template.pavi wget -O pecan.xml http://isda.ncsa.uiuc.edu/~kooper/EBI/pecan.xml wget -O runall.sh http://isda.ncsa.uiuc.edu/~kooper/EBI/runall.sh chmod 755 runall.sh
To run the full PEcAn workflow you can simple execute:
./runall.sh
Script to create a SSH key (sshkey.sh)
Script to clean the VM and remove as much as possible history (cleanvm.sh)
wget -O ~/sshkey.sh http://isda.ncsa.uiuc.edu/~kooper/EBI/sshkey.sh wget -O ~/cleanvm.sh http://isda.ncsa.uiuc.edu/~kooper/EBI/cleanvm.sh chmod 755 ~/sshkey.sh ~/cleanvm.sh