# Copyright (C) 2007 Platform Computing Inc # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # %define _name platform-hpc Summary: Platform HPC Kit Name: kit-%{_name} Version: 1.0 Release: 6 License: GPL/BSD Group: System Environment/Base Vendor: Platform Computing Corporation BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot URL: http://www.platform.com BuildArch: noarch %define comp1 component-benchmarking-tools %define comp2 component-hpc-libraries %define comp3 component-mpich1-libraries %define comp4 component-mpich2-libraries %define comp5 component-mvapich1-libraries %define comp6 component-mvapich2-libraries %define comp7 component-openmpi-libraries %define comp8 component-hpc-source-code %define SQLRUNNER /opt/kusu/sbin/sqlrunner %description This package is destined for the installer node and serves as an information container for the database. %prep %build %install rm -rf $RPM_BUILD_ROOT docdir=$RPM_BUILD_ROOT/depot/www/kits/%{_name}/%{version} /usr/bin/install -d $docdir/kit_hpc_doc_source /usr/bin/install -m 444 %{_topdir}/docs/index.html $docdir /usr/bin/install -m 444 %{_topdir}/docs/readme.html $docdir /usr/bin/install -m 444 %{_topdir}/docs/kit_hpc_doc_source/* -t $docdir/kit_hpc_doc_source # Plugins? #/usr/bin/install -p $plugdir/genconfig #/usr/bin/install -m 444 %{_topdir}/plugins/ngedit/*.py $plugdir/ngedit %clean rm -rf $RPM_BUILD_ROOT %files # documentation /depot/www/kits/%{_name}/%{version}/index.html /depot/www/kits/%{_name}/%{version}/readme.html /depot/www/kits/%{_name}/%{version}/kit_hpc_doc_source/* # Plugins? # /opt/kusu/lib/plugins/addhost/*.py* %post if [ -e /var/lock/subsys/kusu-installer ]; then exit 0; fi PATH=$PATH:/opt/kusu/sbin export PATH if [ -d /opt/kusu/lib ]; then PYTHONPATH=/opt/kusu/lib64/python:/opt/kusu/lib/python export PYTHONPATH fi logfile=/var/log/kusu/%{_name}.log # include Node group creation and component association echo "POST Start" > $logfile KID=`%{SQLRUNNER} -q "SELECT kid FROM kits WHERE rname='%{_name}' and version='%{version}'"` if [ $? -ne 0 ]; then exit 0 fi echo "KID = $KID" >> $logfile # Setup the components %{SQLRUNNER} -q "DELETE FROM components WHERE kid=$KID" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp1}', 'Platform HPC benchmarking tool packages', 'rhel-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp2}', 'Platform HPC core library packages', 'rhel-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp3}', 'Platform HPC MPICH1 library packages', 'rhel-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp4}', 'Platform HPC MPICH2 library packages', 'rhel-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp5}', 'Platform HPC MVAPICH1 library packages', 'rhel-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp6}', 'Platform HPC MVAPICH2 library packages', 'rhel-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp7}', 'Platform HPC Open MPI library packages', 'rhel-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp8}', 'Platform HPC source packages', 'rhel-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp1}', 'Platform HPC benchmarking tool packages', 'centos-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp2}', 'Platform HPC core library packages', 'centos-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp3}', 'Platform HPC MPICH1 library packages', 'centos-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp4}', 'Platform HPC MPICH2 library packages', 'centos-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp5}', 'Platform HPC MVAPICH1 library packages', 'centos-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp6}', 'Platform HPC MVAPICH2 library packages', 'centos-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp7}', 'Platform HPC Open MPI library packages', 'centos-5-x86_64', $KID)" >> $logfile %{SQLRUNNER} -q "INSERT INTO components (cname, cdesc, os, kid) VALUES ('%{comp8}', 'Platform HPC source packages', 'centos-5-x86_64', $KID)" >> $logfile # Associate Ethernet-based components to installer and # compute node groups CID1=`%{SQLRUNNER} -q "SELECT cid from components where kid=$KID and cname='%{comp1}' and os=(select repos.ostype from repos, nodegroups WHERE nodegroups.ngid=1 AND nodegroups.repoid=repos.repoid)"` CID2=`%{SQLRUNNER} -q "SELECT cid from components where kid=$KID and cname='%{comp2}' and os=(select repos.ostype from repos, nodegroups WHERE nodegroups.ngid=1 AND nodegroups.repoid=repos.repoid)"` CID3=`%{SQLRUNNER} -q "SELECT cid from components where kid=$KID and cname='%{comp3}' and os=(select repos.ostype from repos, nodegroups WHERE nodegroups.ngid=1 AND nodegroups.repoid=repos.repoid)"` CID4=`%{SQLRUNNER} -q "SELECT cid from components where kid=$KID and cname='%{comp4}' and os=(select repos.ostype from repos, nodegroups WHERE nodegroups.ngid=1 AND nodegroups.repoid=repos.repoid)"` CID5=`%{SQLRUNNER} -q "SELECT cid from components where kid=$KID and cname='%{comp5}' and os=(select repos.ostype from repos, nodegroups WHERE nodegroups.ngid=1 AND nodegroups.repoid=repos.repoid)"` CID6=`%{SQLRUNNER} -q "SELECT cid from components where kid=$KID and cname='%{comp6}' and os=(select repos.ostype from repos, nodegroups WHERE nodegroups.ngid=1 AND nodegroups.repoid=repos.repoid)"` CID7=`%{SQLRUNNER} -q "SELECT cid from components where kid=$KID and cname='%{comp7}' and os=(select repos.ostype from repos, nodegroups WHERE nodegroups.ngid=1 AND nodegroups.repoid=repos.repoid)"` %{SQLRUNNER} -q "INSERT into ng_has_comp (ngid, cid) VALUES (1, $CID1)" >> $logfile %{SQLRUNNER} -q "INSERT into ng_has_comp (ngid, cid) VALUES (2, $CID1)" >> $logfile %{SQLRUNNER} -q "INSERT into ng_has_comp (ngid, cid) VALUES (1, $CID2)" >> $logfile %{SQLRUNNER} -q "INSERT into ng_has_comp (ngid, cid) VALUES (2, $CID2)" >> $logfile %{SQLRUNNER} -q "INSERT into ng_has_comp (ngid, cid) VALUES (1, $CID3)" >> $logfile %{SQLRUNNER} -q "INSERT into ng_has_comp (ngid, cid) VALUES (2, $CID3)" >> $logfile %{SQLRUNNER} -q "INSERT into ng_has_comp (ngid, cid) VALUES (1, $CID4)" >> $logfile %{SQLRUNNER} -q "INSERT into ng_has_comp (ngid, cid) VALUES (2, $CID4)" >> $logfile %{SQLRUNNER} -q "INSERT into ng_has_comp (ngid, cid) VALUES (1, $CID5)" >> $logfile %{SQLRUNNER} -q "INSERT into ng_has_comp (ngid, cid) VALUES (2, $CID5)" >> $logfile %{SQLRUNNER} -q "INSERT into ng_has_comp (ngid, cid) VALUES (1, $CID6)" >> $logfile %{SQLRUNNER} -q "INSERT into ng_has_comp (ngid, cid) VALUES (2, $CID6)" >> $logfile %{SQLRUNNER} -q "INSERT into ng_has_comp (ngid, cid) VALUES (1, $CID7)" >> $logfile %{SQLRUNNER} -q "INSERT into ng_has_comp (ngid, cid) VALUES (2, $CID7)" >> $logfile # End post # Put other stuff here.... echo "Stop post" >> $logfile %postun PATH=$PATH:/opt/kusu/sbin export PATH if [ -d /opt/kusu/lib ]; then PYTHONPATH=/opt/kusu/lib64/python:/opt/kusu/lib/python: export PYTHONPATH fi KID=`%{SQLRUNNER} -q "SELECT kid FROM kits WHERE rname='%{_name}' and version='%{version}'"` if [ $? -ne 0 ]; then echo "Database is down. Unable to remove kit." exit 1 fi logfile=/var/log/kusu/%{_name}.log touch $logfile echo "Start postun" >> $logfile # Remove all kit component associations if [ ! -z $KID ]; then %{SQLRUNNER} -q "DELETE from ng_has_comp WHERE cid in (select cid from components where kid=$KID)" fi exit 0 %changelog * Thu Jul 31 2008 Mike Frisch 1.0-6 - Remove duplicate INSERT (#110723) * Tue Jul 29 2008 Mike Frisch 1.0-5 - Do not log to /tmp/platform_hpc.log (#112897) * Tue May 20 2008 Mike Frisch 1.0-4 - Fixed dependency problem with mvapich1 (#109012) * Thu Mar 27 2008 Mike Frisch 1.0-2 - Remove AutoReq tag at the request of Red Hat * Thu Mar 20 2008 Mike Frisch 1.0-1 - Change location of Kusu installer lock file