A. Steps to Create an rpm Development Tree (if it does not exist)
1. Go to home directory of user (Example : /root)
2. mkdir rpmbuild
3. cd rpmbuild
4. mkdir BUILD BUILDROOT RPMS SOURCES SPECS SRPMS
B. Installing Dependencies
Below is the list of dependencies specified in the "pbspro.spec" file:
gcc
autoconf
automake
hwloc-devel
libX11-devel
libXt-devel
libedit-devel
libical-devel
ncurses-devel
perl
postgresql-devel
python-devel >= 2.6
python-devel < 3.0
tcl-devel
tk-devel
swig
expat-devel (if suse then libexpat-devel)
openssl-devel (if suse then libopenssl-devel)
We can install the dependencies specified in the "pbspro.spec" file using the command below:
yum-builddep pbspro.spec
or
yum -y install gcc autoconf automake hwloc-devel libX11-devel libXt-devel libedit-devel libical-devel ncurses-devel perl postgresql-devel python-devel tcl-devel tk-devel swig expat-devel openssl-devel
Note: If there is any error in installing any dependency, we can try installing dependencies individually using the command below:
yum install "dependency name"
example : yum install postgresql
C. How to build rpm package for PBS Pro 14.1.0 (Source cloned from github)
1. Go to pbspro directory which we have cloned (git clone https://github.com/PBSPro/pbspro)
2. Change directory to src/pbs
[user@hostname pbspro]# cd src/pbs
[user@hostname pbs]# ls
autogen.sh configure.ac doc LICENSE Makefile.am pbspro-rpmlintrc README src win_configure
buildutils COPYRIGHT INSTALL m4 PBS_License.txt pbspro.spec README.md test
3. Run autogen.sh script to generate configure script and makefile
./autogen.sh
(generates configure script and makefile templates)
4. Run ./configure
5. Run the below command
make dist
make dist generates .tar.gz (pbspro-<pbs_version>.tar.gz) file in the same directory.
6. Move the pbspro-<pbs_version>.tar.gz file to ~/rpmbuild/SOURCES
7. Move pbspro/src/pbspro.spec file to ~/rpmbuild/SPECS
8. Change directory to ~/rpmbuild/SPECS
9. Run the below command
rpmbuild -ba pbspro.spec ( This command will generate below rpm packages in ~/rpmbuild/RPMS dirctory)
a) pbspro-client-<pbs_version>-0.x86_64.rpm
b) pbspro-debuginfo-<pbs_version>-0.x86_64.rpm
c) pbspro-execution-<pbs_version>-0.x86_64.rpm
d) pbspro-server-<pbs_version>-0.x86_64.rpm
Note: <pbs_version> specified at pbspro/src/pbspro.spec
D. How to build rpm package for pbspro-<pbs_version>.src.rpm (Download from http://download.opensuse.org/repositories/home:/pbsproci/)
1. Install the pbspro-<pbs_version>.src.rpm, this will install 1) pbspro-14.1.0.tar.gz and 2) pbspro.spec in respective directories under rpmbuild dev tree.
rpm -i pbspro-<pbs_version>.src.rpm
2. Run the below command
rpmbuild -ba pbspro.spec ( This command will generate below rpm packages in ~/rpmbuild/RPMS dirctory)
a) pbspro-client-<pbs_version>-0.x86_64.rpm
b) pbspro-debuginfo-<pbs_version>-0.x86_64.rpm
c) pbspro-execution-<pbs_version>-0.x86_64.rpm
d) pbspro-server-<pbs_version>-0.x86_64.rpm
E. Installing and Testing an rpm package locally on CentOS7
- Change directory to ~/rpmbuild/RPMS
- yum -y install /root/rpmbuild/RPMS/x86_64/pbspro-server-*.x86_64.rpm
- Need to enable mom “PBS_START_MOM=1” in /etc/pbs.conf file
- Start the PBSPro daemons using /etc/init.d/pbs start.
- Need to validate by submitting job and verifying the state.
- yum -y install python-pip sudo which net-tools
- cd test/fw
- pip install -r requirements.txt .
- Need to install PTL(PBS test Lab) by executing “python setup.py install”
- Need to create users needed by PTL by executing "pbs_config --make-ug"
- cd ../tests
- pbs_benchpress -l INFOCLI2 -o ptl.txt
- Once pbs_benchpress completes, you can find the PTL log in ptl.txt.
F. Installing and Testing an rpm package locally on openSUSE 13.2
Use the following steps to build the open source PBS Pro on your local machine (running openSUSE 13.2):
1. get pbs/pbspro
2. cd pbs/pbspro
3. zypper -n ar -f -G http://download.opensuse.org/repositories/devel:/tools/openSUSE_13.2/devel:tools.repo
4. zypper -n ref
5. zypper -n install rpmdevtools python-xml (NOTE: without python-xml PBS compilation will fail while generating *.c from *.xml for all attr of PBS)
6. rpmdev-setuptree
7. zypper -n install $(rpmspec --buildrequires -q pbspro.spec) (NOTE: ignore any warning)
8. cd pbs
9. ./autogen.sh
10. ./configure
11. make dist
12. cp pbspro-*.tar.gz ~/rpmbuild/SOURCES/
13. cp ../pbspro.spec ~/rpmbuild/SPECS/
14. rpmbuild -bb ../pbspro.spec (Build is complete on these step You can find RPMs in ~/rpmbuild/RPMS/x86_64/)
The following steps are to run PTL:
15. zypper -n install /root/rpmbuild/RPMS/x86_64/pbspro-server-*.x86_64.rpm
16. /etc/init.d/pbs start
17. zypper -n install python-pip sudo which net-tools
18. cd test/fw
19. pip install -r requirements.txt .
20. pbs_config --make-ug
21. cd ../tests
22. pbs_benchpress -l INFOCLI2 -o ptl.txt
Once pbs_benchpress completes, you can find the PTL log in ptl.txt.