[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

announce: PelicanHPC



OK, here's a version that works. After the first build, the tftpboot part
should be commented out, as should the line that says rm -R -f $LIVECDDIR in
the frontend section. Otherwise, things get downloaded again. Sorry for the
confusion. M.

#!/bin/sh# Copyright 2007, 2008 Michael Creel <michael.creel at uab.es>#
This program is free software: you can redistribute it and/or modify#
it under the terms of the GNU General Public License as published by#
the Free Software Foundation, either version 3 of the License, or# (at
your option) any later version.## This program is distributed in the
hope that it will be useful,# but WITHOUT ANY WARRANTY; without even
the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.  See the# GNU General Public License for more details.## You
should have received a copy of the GNU General Public License# along
with this program.  If not, see <http://www.gnu.org/licenses/>.# set
this to the network you'd like to use for the cluster
PELICAN_NETWORK=" 10.11.12"ARCHITECTURE="amd64"
############## tftpboot stuff for nodes: uncomment as needed
##########LIVECDDIR="nodes/"rm -R -f $LIVECDDIRmkdir $LIVECDDIRcd
$LIVECDDIRlh_config \-a $ARCHITECTURE \-b net \--net-root-server
"$PELICAN_NETWORK.1" \--net-root-path "/live/image"
\--syslinux-timeout 20lh_cleanlh_buildcd ../mv $LIVECDDIR/tftpboot
./rm -R -f $LIVECDDIR############## end of tftpboot stuff
###################
# frontendLIVECDDIR="frontend/"rm -R -f $LIVECDDIRmkdir $LIVECDDIRcd
$LIVECDDIRlh_config \--syslinux-timeout 20 \-a $ARCHITECTURE
\--hostname pelican \--iso-volume PelicanHPC \--syslinux-splash
'config/binary_syslinux/splash.rle'lh_clean
# syslinux splash screencp ../splash.rle config/binary_syslinux/splash.rle

############ packages to add ####################cat <<PACKAGELIST >
config/chroot_local-packageslists/addlist# basic network stuffssh
dhcp3-server nfs-kernel-server tftpd-hpa# configuration and toolswget
bzip2 dialog less net-tools rsyncfping screen make# MPIlam4c2
lam-runtime lam4-dev openmpi-bin openmpi-dev# Octaveoctave2.9
octave2.9-headers gnuplot
# X stuffxorgfluxboxbbpagerfbdeskfbpagerfluxconfroxkonquerorksysguardksysguarddkatekdelibsPACKAGELIST##################
END OF PACKAGELIST ################
######### hacks on the chroot ##############cat <<HACKS >
config/chroot_local-hooks/hook01.shecho "$PELICAN_NETWORK.1:/home
/home nfs defaults 0 0" > /etc/fstabecho "" > /etc/motdecho
"StrictHostKeyChecking no" >> /etc/ssh/ssh_configHACKSchmod +x
config/chroot_local-hooks/hook01.sh

########## make directories on chroot #########mkdir
config/chroot_local-includes/usrmkdir
config/chroot_local-includes/usr/binmkdir
config/chroot_local-includes/usr/sharemkdir
config/chroot_local-includes/usr/share/pelicanmkdir
config/chroot_local-includes/usr/share/pelican/tftpboot
######## WRITE THE PELICAN SETUP SCRIPTS #############cat <<01SETUP >
config/chroot_local-includes/usr/bin/pelican_setup#!/bin/bashbailout(){exit
\$1}DIALOG="dialog"TITLE="Pelican Setup"MESSAGE="Welcome to Pelican. A
short setup routine is needed. Continue?"\$DIALOG --title "\$TITLE"
--yesno "\$MESSAGE" 10 50 || bailoutcd
/pelican_setup_frontendpelican_setup_userpelican_setup_netdevicepelican_terminalserverpelican_restart_hpccd
/home/userbailout01SETUP
cat <<02FRONTEND >
config/chroot_local-includes/usr/bin/pelican_setup_frontend#!/bin/bashPATH="/bin:/sbin:/usr/bin:/usr/sbin"export
PATHDIALOG="dialog"[ "\`id -u\`" != "0" ] && exec sudo "\$0"
"\$@"bailout(){exit \$1}# make home dircd /rm -R -f /homemkdir
/homemkfs.ext2 -q -m 0 /dev/ram1mount /dev/ram1 /homemkdir
/home/userchown user.user /home/usersync# start ssh/etc/init.d/ssh
start# make xorg.confdpkg-reconfigure --priority=high
xserver-xorgbailout02FRONTEND
cat <<03USER > config/chroot_local-includes/usr/bin/pelican_setup_user#!/bin/bashbailout(){exit
\$1}cd /home/userHOME="/home/user"PKTMP="\$HOME/tmp"echo "Creating
temporary directory"rm -R -f \$PKTMPmkdir \$PKTMPchown user.user
\$PKTMPchmod 777 \$PKTMP# regenerate keysecho "Generating new RSA
keys"rm -f \$HOME/.ssh/id_rsa*ssh-keygen  -q -t rsa -N "" -f
"\$HOME/.ssh/id_rsa"cp \$HOME/.ssh/id_rsa.pub
\$HOME/.ssh/authorized_keyschmod 600 \$HOME/.ssh/authorized_keys# copy
examplesrsync -avz /usr/share/pelican/CopyToHome/* \$HOMEcat <<FPING >
\$HOME/fpinghosts$PELICAN_NETWORK.2$PELICAN_NETWORK.3$PELICAN_NETWORK.4$PELICAN_NETWORK.5$PELICAN_NETWORK.6$PELICAN_NETWORK.7$PELICAN_NETWORK.8$PELICAN_NETWORK.9$PELICAN_NETWORK.10$PELICAN_NETWORK.11$PELICAN_NETWORK.12$PELICAN_NETWORK.13$PELICAN_NETWORK.14$PELICAN_NETWORK.15$PELICAN_NETWORK.16$PELICAN_NETWORK.17$PELICAN_NETWORK.18$PELICAN_NETWORK.19$PELICAN_NETWORK.20$PELICAN_NETWORK.21$PELICAN_NETWORK.22$PELICAN_NETWORK.23$PELICAN_NETWORK.24$PELICAN_NETWORK.25$PELICAN_NETWORK.26$PELICAN_NETWORK.27$PELICAN_NETWORK.28$PELICAN_NETWORK.29$PELICAN_NETWORK.30$PELICAN_NETWORK.31$PELICAN_NETWORK.32$PELICAN_NETWORK.33$PELICAN_NETWORK.34$PELICAN_NETWORK.35$PELICAN_NETWORK.36$PELICAN_NETWORK.37$PELICAN_NETWORK.38$PELICAN_NETWORK.39$PELICAN_NETWORK.40$PELICAN_NETWORK.41$PELICAN_NETWORK.42$PELICAN_NETWORK.43$PELICAN_NETWORK.44$PELICAN_NETWORK.45$PELICAN_NETWORK.46$PELICAN_NETWORK.47$PELICAN_NETWORK.48$PELICAN_NETWORK.49$PELICAN_NETWORK.50$PELICAN_NETWORK.51$PELICAN_NETWORK.52$PELICAN_NETWORK.53$PELICAN_NETWORK.54$PELICAN_NETWORK.55$PELICAN_NETWORK.56$PELICAN_NETWORK.57$PELICAN_NETWORK.58$PELICAN_NETWORK.59$PELICAN_NETWORK.60$PELICAN_NETWORK.61$PELICAN_NETWORK.62$PELICAN_NETWORK.63$PELICAN_NETWORK.64$PELICAN_NETWORK.65$PELICAN_NETWORK.66$PELICAN_NETWORK.67$PELICAN_NETWORK.68$PELICAN_NETWORK.69$PELICAN_NETWORK.70$PELICAN_NETWORK.71$PELICAN_NETWORK.72$PELICAN_NETWORK.73$PELICAN_NETWORK.74$PELICAN_NETWORK.75$PELICAN_NETWORK.76$PELICAN_NETWORK.77$PELICAN_NETWORK.78$PELICAN_NETWORK.79$PELICAN_NETWORK.80$PELICAN_NETWORK.81$PELICAN_NETWORK.82$PELICAN_NETWORK.83$PELICAN_NETWORK.84$PELICAN_NETWORK.85$PELICAN_NETWORK.86$PELICAN_NETWORK.87$PELICAN_NETWORK.88$PELICAN_NETWORK.89$PELICAN_NETWORK.90$PELICAN_NETWORK.91$PELICAN_NETWORK.92$PELICAN_NETWORK.93$PELICAN_NETWORK.94$PELICAN_NETWORK.95$PELICAN_NETWORK.96$PELICAN_NETWORK.97$PELICAN_NETWORK.98$PELICAN_NETWORK.99$PELICAN_NETWORK.100FPINGbailout03USER

cat <<04NETDEVICE >
config/chroot_local-includes/usr/bin/pelican_setup_netdevice#!/bin/bash#
modification of netcardconfig from
Knoppix.PATH="/bin:/sbin:/usr/bin:/usr/sbin"export
PATHDIALOG="dialog"[ "\`id -u\`" != "0" ] && exec sudo "\$0"
"\$@"TMP="/tmp/netconfig.tmp\$\$"bailout(){rm -f "\$TMP"exit
\$1}TITLE="Pelican Setup"MESSAGE0="No supported network cards
found."MESSAGE1="Please select the network device that connects to the
cluster."NETDEVICES="\$(cat /proc/net/dev | awk -F:
'/eth.:|br.:|tr.:|wlan.:/{print \$1}')"if [ -z "\$NETDEVICES" ];
then\$DIALOG --title "\$TITLE" --msgbox
"\$MESSAGE0"bailoutficount="\$(echo "\$NETDEVICES" | wc -w)"if [
"\$count" -gt 1 ]; thenDEVICELIST=""for DEVICE in \$NETDEVICES; do
DEVICELIST="\$DEVICELIST \${DEVICE} network_device_\${DEVICE}"; donerm
-f "\$TMP"echo "Hints about your net devices"dmesg|grep ethrm -f
"\$TMP"\$DIALOG --menu "\$MESSAGE1" 18 45 12 \$DEVICELIST 2>"\$TMP" ||
bailoutread DV <"\$TMP" ; rm -f "\$TMP"else# Remove additional
spacesDV="\$(echo
\$NETDEVICES)"fiIP="$PELICAN_NETWORK.1"NM="255.255.255.0
"BC="$PELICAN_NETWORK.255"DG="$PELICAN_NETWORK.254"NS=\$DGifdown
\$DVsleep 4rm /etc/network/interfacesCMD="ifconfig \$DV \$IP netmask
\$NM broadcast \$BC up"\$CMDbailout04NETDEVICE

cat <<05TERMINALSERVER >
config/chroot_local-includes/usr/bin/pelican_terminalserver#!/bin/shPATH="/bin:/sbin:/usr/bin:/usr/sbin"export
PATH[ "\`id -u\`" != "0" ] && exec sudo "\$0" "\$@"bailout(){exit
\$1}cp -a /usr/share/pelican/tftpboot/* /var/lib/tftpboot/# configure
dhcpcat <<DHCP > /etc/dhcp3/dhcpd.conf# global settingsallow
booting;allow bootp;default-lease-time 600;max-lease-time 7200;subnet
$PELICAN_NETWORK.0 netmask 255.255.255.0 {  next-server
$PELICAN_NETWORK.1;  filename "pxelinux.0";  option subnet-mask
255.255.255.0;  range $PELICAN_NETWORK.2 $PELICAN_NETWORK.100;}DHCP#
configure tftpd-hpacat <<TFTP > /etc/default/tftpd-hpa#Defaults for
tftpd-hpaRUN_DAEMON="yes"OPTIONS="-l -s /var/lib/tftpboot"TFTP#
generate /etc/exportscat <<EXPORTS > /etc/exports/live/image
*(ro,async,no_subtree_check,no_root_squash,fsid=12345)/home
$PELICAN_NETWORK.0/255.255.255.0(rw,root_squash,async,no_subtree_check)EXPORTS#
start servicessync/etc/init.d/tftpd-hpa start/etc/init.d/dhcp3-server
start/etc/init.d/nfs-kernel-server startbailout05TERMINALSERVER
cat <<06HPC > config/chroot_local-includes/usr/bin/pelican_restart_hpc#!/bin/shPKTMP="/home/user/tmp"PATH="/bin:/sbin:/usr/bin:/usr/sbin"export
PATHDIALOG="dialog"bailout(){exit 0}# check which nodes are
upchecknodes(){rm \$PKTMP/bhostssudo fping -a -q -r0 -f
/home/user/fpinghosts >
\$PKTMP/bhosts}retry(){checknodesNNODES="\$(grep -c ""
\$PKTMP/bhosts)"MESSAGENODES="\nGo turn on your compute nodes now.
\n\nAt the moment \$NNODES compute nodes (not counting this frontend
node) are available. \n\nClick no to rescan the available nodes. Click
yes when the desired number of nodes are available. You might want to
wait a bit if some nodes are still finishing booting up."\$DIALOG
--title "\$TITLE" --yesno "\$MESSAGENODES" 20 50 || retry}trap bailout
1 2 3 15TITLE="Restart Pelican HPC"MESSAGE="\nWe now set up the
cluster by finding which nodes are available. If you are doing initial
setup, click on yes. If you are resizing a running cluster, be aware
that continuing will interrupt any running MPI jobs. Click no abort
resizing."\$DIALOG --title "\$TITLE" --yesno "\$MESSAGE" 15 50 ||
bailoutretry# master must be last in the listecho "$PELICAN_NETWORK.1"
| cat >> \$PKTMP/bhosts# lamboot 2X to generate known_hosts (end
error) the first timelamwipelamboot \$PKTMP/bhostslamwipelamboot
\$PKTMP/bhostslamnodessleep 5# display success messageNNODES="\$(grep
-c "" \$PKTMP/bhosts)"# final reportSUCCESS="\nYour cluster of
\$NNODES nodes is (probably) lambooted. If there was a problem, just
re-run the script.\nThe nodes in the cluster are listed in the file
~/tmp/bhosts. If you add or remove compute nodes, re-run this script
(pelican_restart_hpc) whenever you like."\$DIALOG --title "\$TITLE"
--msgbox "\$SUCCESS" 15 50bailout06HPC
######## END OF PELICAN SETUP SCRIPTS #############
# make the scripts in /usr/bin executablechmod +x
config/chroot_local-includes/usr/bin/*# copy the setup scriptsrsync
-avz ../pelican_includes/*
config/chroot_local-includes/usr/share/pelican# copy the PXE
stuffrsync -avz ../tftpboot/*
config/chroot_local-includes/usr/share/pelican/tftpboot
lh_build
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/debian-live-devel/attachments/20080102/e9efc7e4/attachment-0001.htm 


Reply to: