diff --git a/buildcore.sh b/buildcore.sh index d2c935cc9..668b871a6 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -142,6 +142,20 @@ fi # echo "rpm -Uvh xCAT-UI-$SHORTVER*rpm" >> $DESTDIR/instxcat #fi +# Not quite ready to ship this yet... +#if $GREP xCAT-IBMhpc $SVNUP; then +# UPLOAD=1 +# rm -f $DESTDIR/xCAT-IBMhpc*rpm +# rm -f $SRCDIR/xCAT-IBMhpc*rpm +# ./makehpcrpm +# mv $source/RPMS/noarch/xCAT-IBMhpc-$VER*rpm $DESTDIR +# mv $source/SRPMS/xCAT-IBMhpc-$VER*rpm $SRCDIR +#fi +# Do not automatically install xCAT-IBMhpc on AIX +#if [ "$OSNAME" = "AIX" ]; then +# echo "rpm -Uvh xCAT-IBMhpc-$SHORTVER*rpm" >> $DESTDIR/instxcat +#fi + if $GREP xCAT-server $SVNUP; then UPLOAD=1 ./makeserverrpm diff --git a/makehpcrpm b/makehpcrpm new file mode 100755 index 000000000..699cbc826 --- /dev/null +++ b/makehpcrpm @@ -0,0 +1,38 @@ +#!/bin/sh + +OSNAME=$(uname) +VER=`cat Version` + +if [ "$OSNAME" = "AIX" ] +then + + #echo '.svn' > /tmp/xcat-excludes + #tar -X /tmp/xcat-excludes -cf /opt/freeware/src/packages/SOURCES/xCAT-IBMhpc-$VER.tar xCAT-IBMhpc + #gzip -f /opt/freeware/src/packages/SOURCES/xCAT-IBMhpc-$VER.tar + #cd ./xCAT-IBMhpc + #rm -f /opt/freeware/src/packages/SRPMS/xCAT-IBMhpc-$VER*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-IBMhpc-$VER*rpm + #rpm -ba xCAT-IBMhpc.spec + #rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCAT-IBMhpc-$VER*rpm + + source=/opt/freeware/src/packages + echo '.svn' > /tmp/xcat-excludes + tar -X /tmp/xcat-excludes -cf $source/SOURCES/xCAT-IBMhpc-$VER.tar xCAT-IBMhpc + gzip -f $source/SOURCES/xCAT-IBMhpc-$VER.tar + rm -f $source/SRPMS/xCAT-IBMhpc-$VER*rpm $source/RPMS/ppc/xCAT-IBMhpc-$VER*rpm + rpm -ba xCAT-server/xCAT-IBMhpc.spec + #rpm -ta $source/SOURCES/xCAT-IBMhpc-$VER.tar.gz + +else + + if [ -f /etc/redhat-release ] + then + pkg="redhat" + else + pkg="packages" + fi + + tar --exclude .svn -czf /usr/src/$pkg/SOURCES/xCAT-IBMhpc-$VER.tar.gz xCAT-IBMhpc + rm -f /usr/src/$pkg/SRPMS/xCAT-IBMhpc-$VER*rpm /usr/src/$pkg/RPMS/noarch/xCAT-IBMhpc-$VER*rpm + rpmbuild -ta /usr/src/$pkg/SOURCES/xCAT-IBMhpc-$VER.tar.gz + #rpm -Uvh /usr/src/$pkg/RPMS/noarch/xCAT-IBMhpc-$VER*rpm +fi diff --git a/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs.exlist b/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs.exlist new file mode 100644 index 000000000..e019951c7 --- /dev/null +++ b/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs.exlist @@ -0,0 +1,3 @@ +./usr/lpp/mmfs/include* +./usr/lpp/mmfs/samples* + diff --git a/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs.otherpkgs.pkglist b/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs.otherpkgs.pkglist new file mode 100644 index 000000000..1a003f014 --- /dev/null +++ b/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs.otherpkgs.pkglist @@ -0,0 +1,4 @@ +libstdc++33 +gpfs/gpfs.base +gpfs/gpfs.gpl +gpfs/gpfs.msg.en_US diff --git a/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs_mmsdrfs b/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs_mmsdrfs new file mode 100755 index 000000000..397b84779 --- /dev/null +++ b/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs_mmsdrfs @@ -0,0 +1,70 @@ +#!/bin/sh + +# Run this script to sync the GPFS mmsdrfs file into the node images +# Set the SOURCE, IMAGE, and SERVICE variables appropriately + +# Usage: gpfs_mmsdrfs [packimage|liteimage] [syncinstall] +# If packimage or liteimage specified, will run that command for the image +# if rsync updated any destination files +# If syncinstall specified, and if site.install_loc is blank, +# sync the /install directory to the SERVICE noderange +# if rysnc updated any destination files +# +# To keep your diskless images current with any GPFS changes, run this +# script periodically from cron using the packimage/liteimage and +# syncinstall options as required by your cluster +# + +# The source server:location of the mmsdrfs file. Default is this xCAT MN. +#SOURCE=gpfsmgr:/var/mmfs/gen/mmsdrfs +SOURCE=/var/mmfs/gen/mmsdrfs + +# The images to be updated (list as many as needed) +IMAGE[1]=sles11-ppc64-netboot-service2 +IMAGE[2]=sles11-ppc64-netboot-compute + +# The noderange for service nodes +SERVICE=service + + +# If $installroot is set, then this script was called from genimage +# Ignore all IMAGE variables and only rsync to $installroot +if [ ! -z "$installroot" ]; then + rsync -i -t $SOURCE $installroot/var/mmfs/gen/mmsdrfs + exit +fi + +packcmd="" +syncinstall="" +if [ "$1" == "packimage" ] || [ "$1" == "liteimage" ]; then + packcmd=$1 + if [ "$2" == "syncinstall" ]; then + installloc=`/opt/xcat/bin/gettab key=installloc site.value` + if [ -z "$installloc" ]; then + syncinstall="yes" + fi + fi +fi + +updates="" +for syncimage in ${IMAGE[@]}; do + dest=`/opt/xcat/bin/gettab imagename=$syncimage linuximage.rootimgdir` + dest=$dest/rootimg/var/mmfs/gen/mmsdrfs + #echo "rsync cmd: rsync -i -t $SOURCE $dest " + result=`rsync -i -t $SOURCE $dest` + #echo "rsync result=$result" + r1=`echo $result | cut -c1` + if [ "$r1" == ">" ]; then + date + echo "mmsdrfs updated in image $syncimage" + if [ ! -z $packcmd ]; then + updates="yes" + /opt/xcat/sbin/$packcmd $syncimage + fi + fi +done + +if [ ! -z "$updates" ] && [ ! -z "$syncinstall" ]; then + xdcp $SERVICE -r /usr/bin/rsync -o '-e ssh -craz' /install/netboot /install/netboot +fi + diff --git a/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs_start b/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs_start new file mode 100755 index 000000000..21f50dd00 --- /dev/null +++ b/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs_start @@ -0,0 +1,12 @@ +#!/bin/sh + +# Run this script as a postscript on any node (stateless, statefull, +# full-disk install, AIX, Linux) to start the GPFS daemon +# + +# If you have any special network dependencies, you may want to add code +# to check them first + +/usr/lpp/mmfs/bin/mmsdrrestore +/usr/lpp/mmfs/bin/mmstartup + diff --git a/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs_updates b/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs_updates new file mode 100755 index 000000000..89313ec65 --- /dev/null +++ b/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs_updates @@ -0,0 +1,101 @@ +#!/bin/sh + +# +# Sample script to install and configure GPFS +# For AIX: +# Assumes the GPFS filesets and updates were installed using +# xCAT bundle files or some other mechanism. This script does not +# install additional software. +# It will do the following: +# - create /var/mmfs/etc/nsddevices that simply returns 0 +# - add GPFS paths to profile +# For Linux: +# Assumes the base GPFS rpms were installed with the xCAT 'otherpkgs' +# postscript (stateful install) or with the otherpkgs processing of +# genimage (stateless/statelite install). This script will install any +# gpfs update rpms that exist on the xCAT management node in the +# /install/post/gpfs_updates directory. +# This is necessary because the GPFS updates can ONLY be installed +# after the base rpms have been installed, and the update rpms cannot +# exist in any rpm repositories used by xCAT otherpkgs processing +# since they will confuse rpm tools such as zypper and yum. +# This script will also do the following: +# - create /var/mmfs/etc/nsddevices that simply returns 0 +# - add GPFS paths to profile + + +OS=`uname` +INSTALL_DIR='/install' +UPDATES_DIR='post/otherpkgs/gpfs_updates' + +if [ $OS != "AIX" ]; then + if [ $NODESETSTATE == "install" ]; then + # Being run from a stateful install postscript + # Copy rpms directly from the xCAT management node and install + mkdir -p /tmp/gpfs_updates + rm -f -R /tmp/gpfs_updates/* + cd /tmp/gpfs_updates + wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 0 -T 60 -nH --cut-dirs=3 ftp://$SITEMASTER/$UPDATES_DIR/*.rpm 2> /tmp/wget.log + rpm -Uvh *.rpm + + fi + + if [ $NODESETSTATE == "genimage" ]; then + # Being called from .postinstall script + # Assume we are on the same machine + if [[ $OS = sles* ]] || [[ $OS = suse* ]] || [[ -f /etc/SuSE-release ]]; then + # For SLES, assume zypper is available on the system running genimage + zypper -R $installroot ar file:$INSTALL_DIR/$UPDATES_DIR gpfs_updates + # zypper -R $installroot install gpfs.gplbin* + zypper -R $installroot update gpfs* + zypper -R $installroot rr gpfs_updates + else + # For Redhat, etc., assume yum is available on the system running genimage + yum --installroot $installroot --nogpgcheck localupdate $INSTALL_DIR/$UPDATES_DIR/*.rpm + fi + + fi +fi + + +# Create an empty nsddevices script for GPFS +# This assumes that the node is NOT an NSD server +if [ $OS == "AIX" ]; then + # Create the script on the node + echo 'return 0' > /var/mmfs/etc/nsddevices + chmod 744 /var/mmfs/etc/nsddevices +else # assume Linux + if [ $NODESETSTATE == "genimage" ]; then + # Create the script in the image + echo 'return 0' > $installroot/var/mmfs/etc/nsddevices + chmod 744 $installroot/var/mmfs/etc/nsddevices + else + # Create the script on the node + echo 'return 0' > /var/mmfs/etc/nsddevices + chmod 744 /var/mmfs/etc/nsddevices + fi +fi + + +# Add GPFS path to profile +if [ $OS == "AIX" ]; then + # add to /etc/profile + if ! grep 'mmfs' /etc/profile >& /dev/null; then + echo 'PATH=$PATH:/usr/lpp/mmfs/bin' >> /etc/profile + fi +else # assume Linux + if [ $NODESETSTATE == "genimage" ]; then + gpfsprofile=$installroot/etc/profile.d/gpfs + else + gpfsprofile=/etc/profile.d/gpfs + fi + if [ ! -e $gpfsprofile.sh ]; then + echo 'PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh + echo 'PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh + chmod 744 $gpfsprofile.sh + chmod 744 $gpfsprofile.csh + fi +fi + + + diff --git a/xCAT-IBMhpc/xCAT-IBMhpc.spec b/xCAT-IBMhpc/xCAT-IBMhpc.spec new file mode 100644 index 000000000..a5586105a --- /dev/null +++ b/xCAT-IBMhpc/xCAT-IBMhpc.spec @@ -0,0 +1,68 @@ +Summary: Install and configuration utilities for IBM HPC products in an xCAT cluster +Name: xCAT-IBMhpc +Version: %(cat Version) +Release: snap%(date +"%Y%m%d%H%M") +Epoch: 4 +License: EPL +Group: Applications/System +Source: xCAT-IBMhpc-%(cat Version).tar.gz +Packager: IBM Corp. +Vendor: IBM Corp. +Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} +Prefix: /opt/xcat +BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root + +%ifnos linux +AutoReqProv: no +%endif + +# AIX will build with an arch of "ppc" +# also need to fix Requires for AIX +%ifos linux +BuildArch: noarch +#Requires: +%endif + +Requires: perl-xCAT >= %{epoch}:%(cat Version|cut -d. -f 1,2) +Requires: xCAT-client >= %{epoch}:%(cat Version|cut -d. -f 1,2) + +Provides: xCAT-IBMhpc = %{epoch}:%{version} + +%description +xCAT-IBMhpc provides sample installation and configuration scripts for running the IBM HPC software stack in an xCAT cluser. Support for the following IBM products is provided: GPFS, LoadLeveler, Parallel Environment, ESSL and Parallel ESSL libraries, some compilers (vac, xlC, xlf). + +%prep +%setup -q -n xCAT-IBMhpc +%build +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/IBMhpc/gpfs + +set +x +cp share/xcat/IBMhpc/gpfs/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/IBMhpc/gpfs/ +chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/IBMhpc/gpfs/* + +set -x + +mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-IBMhpc +cp LICENSE.html $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-IBMhpc +chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-IBMhpc/* +#echo $RPM_BUILD_ROOT %{prefix} + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +#%doc LICENSE.html +%{prefix} + +%changelog + +%post + +%preun + + + +