Bloss+GeoGrid

From PRAGMA wiki
Jump to: navigation, search

Introduction

  • The VM image, http://www.apgrid.org/frontend-0-0-9.pywps_kvm.hda.gz, is a Rocks VM image, created by AIST. It includes 2 applications and ready to be deployed to 2 VM platforms.
    • Applications
      • Bloss
      • Geogrid
    • VM platforms:
      • Xen
      • KVM
  • The VM deployment has been tested among 3 sites: SDSC, AIST and NCHC.
    • Rocks/Xen:
      • SDSC: Phil Papadopoulos, Cindy Zheng
      • AIST: Yoshio Tanaka, Akihiko Ota
    • Ubuntu/KVM:
      • NCHC: Weicheng Huang, Serena Pan
  • The deployment notes below can serve as a guide. We encourage all sites who deploy this VM image to contribute their notes/tips into this document.
  • After you deploy the VM image to the VM hosting server at your site, or if you have questions and need any help, please inform/contact Cindy.

Sample deployment notes

Deploy to a Rocks VM hosting server

Note: Different setups exist at different sites. If the procedure resulted a hang when you boot the vm, it's probably due to network interface setup. You can try an alternative method: create a new VM with "rocks add cluster" command - specify FQDN and IP, then skip the network interface setup steps and change eth0 to eth1 for the rest of the procedure. Some sites have found the alternative method is earier.

  • Create a new VM
[root@fiji ~]# rocks add host vm fiji.rocksclusters.org membership="Hosted VM" name=geobloss
  • Setup the new VM network interface
[root@fiji ~]# rocks set host interface subnet geobloss eth0 public
[root@fiji ~]# rocks list host interface geobloss
SUBNET IFACE MAC               IP NETMASK MODULE NAME    VLAN OPTIONS CHANNEL
public eth0  b6:58:ca:00:00:65 -- ------- ------ geobloss ---- ------- -------
[root@fiji ~]# rocks set host interface ip geobloss eth0 198.202.88.205
[root@fiji ~]# rocks list host interface geobloss
SUBNET IFACE MAC               IP             NETMASK       MODULE NAME     VLAN
 OPTIONS CHANNEL
public eth0  b6:58:ca:00:00:65 198.202.88.205 255.255.255.0 ------ geobloss ---- ------- -------
  • Find the VM image file path
[root@fiji ~]# rocks list host vm geobloss showdisks=y
SLICE MEM   CPUS MAC               HOST DISK                                               DISKSIZE
13    1024  1    b6:58:ca:00:00:65 fiji file:/state/partition1/xen/disks/geobloss.hda,hda,w 36
  • Copy disk image file to new VM file location.
[root@fiji ~]# cd /state/partition1/xen/disks/
[root@fiji disks]# wget http://www.apgrid.org/frontend-0-0-9.pywps_kvm.hda.gz
[root@fiji disks]# mv frontend-0-0-9.pywps_kvm.hda.gz geobloss.hda.gz
[root@fiji disks]# gunzip geobloss.hda.gz
  • Modify the VM image
[root@fiji disks]# lomount -diskimage geobloss.hda -partition 1 /media
[root@fiji disks]# vi /media/boot/grub/grub.conf
[root@fiji disks]# grep default /media/boot/grub/grub.conf
default=1
(default=1 xen kernel; default=0 for kvm kernel)
[root@fiji disks]# vi /media/etc/sysconfig/network-scripts/ifcfg-eth0
[root@fiji disks]# cat /media/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=b6:58:ca:00:00:65
IPADDR=198.202.88.203
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes
MTU=1500
[root@fiji disks]# vi /media/etc/sysconfig/network
[root@fiji disks]# cat /media/etc/sysconfig/network | grep GATEWAY
GATEWAY=198.202.88.20
[root@fiji disks]# vi /media/etc/resolv.conf
[root@fiji disks]# cat /media/etc/resolv.conf | grep nameserver
nameserver 127.0.0.1
nameserver 198.202.75.26
[root@fiji disks]# vi /media/root/.ssh/authorized_keys
(add your ssh public key)
[root@fiji disks]# umount /media
  • Start the new VM
[root@fiji disks]# rocks set host boot action=os geobloss
[root@fiji disks]# rocks list host boot geobloss
ACTION
os
[root@fiji disks]# rocks start host vm geobloss
[root@fiji disks]# rocks list host vm geobloss status=y
SLICE MEM   CPUS MAC               HOST STATUS
13    1024  1    b6:58:ca:00:00:5f fiji active
  • Login to the new VM
[root@fiji ~]# ssh 198.202.88.203
Last login: Wed Feb 16 14:24:14 2011 from 198.202.88.180
Rocks 5.3 (Rolled Tacos)
Profile built 09:25 03-Feb-2011

Kickstarted 18:55 03-Feb-2011
  • Change hostname
[root@wpsvm ~]# hostname rocks-203
[root@wpsvm ~]# vi /etc/sysconfig/network
[root@wpsvm ~]# grep HOSTNAME /etc/sysconfig/network
HOSTNAME=rocks-203.sdsc.edu
[root@wpsvm ~]# vi /etc/hosts
[root@wpsvm ~]# cat /etc/hosts
127.0.0.1       localhost.localdomain   localhost
#10.1.1.1       wpsvm.local wpsvm # originally frontend-0-0
198.202.88.203  rocks-203.sdsc.edu
[root@wpsvm ~]# vi /etc/auto.home
[root@wpsvm ~]# cat /etc/auto.home
John     rocks-203.local:/export/home/john
tom      rocks-203.local:/export/home/tom
jane     rocks-203.local:/export/home/jane
  • Modify PyWPS config files
[root@wpsvm ~]# vi /usr/local/pywps-3.1.0/pywps/etc/pywps.cfg
[root@wpsvm ~]# grep rocks-203 /usr/local/pywps-3.1.0/pywps/etc/pywps.cfg
serveraddress=http://rocks-203.sdsc.edu/pywps/wps
outputUrl=http://rocks-203.sdsc.edu/wps/wpsoutputs
[root@wpsvm ~]# vi /srv/pywps/sfi/pywps.cfg 
[root@wpsvm ~]# grep rocks-203 /srv/pywps/sfi/pywps.cfg
serveraddress=http://rocks-203.sdsc.edu/pywps/sfi/wps
outputUrl=http://rocks-203.sdsc.edu/wps/wpsoutputs
  • Modify HTTP config file
[root@wpsvm ~]# vi /etc/httpd/conf/httpd.conf 
[root@wpsvm ~]# grep sdsc /etc/httpd/conf/httpd.conf
ServerAdmin supporter@sdsc.edu
ServerName rocks-203.sdsc.edu:80
[root@wpsvm ~]# /sbin/chkconfig httpd on
[root@wpsvm ~]# /etc/init.d/httpd start
  • Modify iptables
[root@wpsvm ~]# vi /etc/sysconfig/iptables
(Change these 3 lines:
-A INPUT -m state --state NEW -p tcp --dport https --source 198.202.88.0/255.255.255.0 -j ACCEPT
-A INPUT -m state --state NEW -p tcp --dport www --source 198.202.88.0/255.255.255.0 -j ACCEPT
-A INPUT -m state --state NEW -p tcp --dport www -j ACCEPT)
[root@wpsvm ~]# /etc/init.d/iptables restart
  • Reboot
# reboot
  • Test run BLOSS application
[root@rocks-203 ~]# useradd -c "Cindy Zheng" cindy
[root@rocks-203 ~]# su - cindy
[cindy@rocks-203 ~]$ tar xvzpf /state/partition1/home/ota/bloss_test.tar.gz
bloss_test/
bloss_test/dsy500_a.mat
bloss_test/dsy_rr_lapack
bloss_test/dsy500_b.mat
bloss_test/dsy2000_a.mat
bloss_test/libgfortran.so.1
bloss_test/dsy100_a.mat
bloss_test/dsy1000_b.mat
bloss_test/dsy1000_a.mat
bloss_test/dsy100_b.mat
bloss_test/bench.sh
bloss_test/dsy2000_b.mat
[cindy@rocks-203 ~]$ cd bloss_test/
[cindy@rocks-203 bloss_test]$ source /usr/lib64/openmpi/1.4-gcc/etc/mpivars.sh
[cindy@rocks-203 bloss_test]$ ./bench.sh

It will take a few minutes to run. Then check output files.

[cindy@rocks-203 bloss_test]$ ls out*_mono.out
out1000_mono.out  out100_mono.out  out2000_mono.out  out500_mono.out 
[cindy@rocks-203 bloss_test]$$ less out100_mono.out 
[cindy@rocks-203 bloss_test]$$ less out500_mono.out 
[cindy@rocks-203 bloss_test]$$ less out1000_mono.out 
[cindy@rocks-203 bloss_test]$$ less out2000_mono.out
  • Test PyWPS and Apache

Point your browser to http://rocks-203.sdsc.edu/pywps/wpstest?service=WPS&request=GetCapabilities, http://rocks-203.sdsc.edu/pywps/wpstest?service=WPS&request=DescribeProcess&version=1.0.0&Identifier=exampleBufferProcess. You should see XML pages.

  • Congratulations for the success! But don't forget to inform Cindy and Yoshio the VM hostname/IP, so AIST team can test and add this VM instance to their application runs.

Deploy to a KVM hosting server

The deployment procedure for KVM is similar to the procedure for Xen above, EXCEPT

  • In the /boot/grub/grub.conf in the new VM image, default should be set to 0 (default=0)
  • Boot this image by KVM as follows:
% sudo /opt/qemu-kvm/bin/qemu-system-x86_64 \
-m 1024 \
-net nic,model=virtio,macaddr=00:16:3e:1d:ff:0f \
-net tap,ifname=tap0,script=no,downscript=no \
-vnc :0 \
-serial stdio \
-drive file=./frontend-0-0-9.pywps.hda,boot=on 

Please refer to section 2.1 for the rest of procedure, replace the Rocks/Xen commands with corresponding KVM commands.
Note: This example is using qemu-kvm version 0.13.50 compiled from source of git repository.

Other notes

  • Update route is not necessary in this case. But if needed, here is an route update example - rocks-207 was created from rocks-201's disk image:
[root@rocks-207 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
198.202.88.201  10.1.1.1        255.255.255.255 UGH   0      0        0 eth0
255.255.255.255 0.0.0.0         255.255.255.255 UH    0      0        0 eth0
198.202.88.0    0.0.0.0         255.255.255.0   U     0      0        0 eth1
224.0.0.0       0.0.0.0         255.255.255.0   U     0      0        0 eth0
10.1.0.0        0.0.0.0         255.255.0.0     U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
0.0.0.0         198.202.88.20   0.0.0.0         UG    0      0        0 eth1
[root@rocks-207 ~]# route add -net 198.202.88.207 netmask 255.255.255.255 gw 10.1.1.1 eth0
[root@rocks-207 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
198.202.88.201  10.1.1.1        255.255.255.255 UGH   0      0        0 eth0
255.255.255.255 0.0.0.0         255.255.255.255 UH    0      0        0 eth0
198.202.88.207  10.1.1.1        255.255.255.255 UGH   0      0        0 eth0
198.202.88.0    0.0.0.0         255.255.255.0   U     0      0        0 eth1
224.0.0.0       0.0.0.0         255.255.255.0   U     0      0        0 eth0
10.1.0.0        0.0.0.0         255.255.0.0     U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
0.0.0.0         198.202.88.20   0.0.0.0         UG    0      0        0 eth1
[root@rocks-207 ~]# route del -net 198.202.88.201 netmask 255.255.255.255 gw 10.1.1.1 eth0
[root@rocks-207 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
255.255.255.255 0.0.0.0         255.255.255.255 UH    0      0        0 eth0
198.202.88.207  10.1.1.1        255.255.255.255 UGH   0      0        0 eth0
198.202.88.0    0.0.0.0         255.255.255.0   U     0      0        0 eth1
224.0.0.0       0.0.0.0         255.255.255.0   U     0      0        0 eth0
10.1.0.0        0.0.0.0         255.255.0.0     U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
0.0.0.0         198.202.88.20   0.0.0.0         UG    0      0        0 eth1