Skip to end of metadata
Go to start of metadata

A. Create rpm Development Tree (if it does not exist)

Create the tree by hand, or use "rpmdev-setuptree" to create necessary directories.  To create by hand:

1. Go to your home directory; you don't need to be root

2. mkdir            rpmbuild

3. cd                 rpmbuild

4. mkdir            BUILD  BUILDROOT  RPMS  SOURCES  SPECS  SRPMS

 


B. Install Dependencies

Below is the list of prerequisite packages.  (These are also 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)

1. Install dependencies for building PBS Pro:

For CentOS systems, run the following command as root:

yum install -y gcc make rpm-build libtool 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 libXext libXft

For openSUSE systems, run the following command as root:

zypper install gcc make rpm-build libtool hwloc-devel libX11-devel libXt-devel libedit-devel libical-devel ncurses-devel perl postgresql-devel python-devel tcl-devel tk-devel swig libexpat-devel libopenssl-devel libXext-devel libXft-devel fontconfig

2. Install prerequisite packages for running PBS Pro:

In addition to the commands below, you should also install a text editor of your choosing (vim, emacs, gedit, etc.).

For CentOS systems, run the following command as root:

yum install -y expat libedit postgresql-server python sendmail sudo tcl tk libical

For openSUSE systems, run the following command as root:

zypper install expat libedit postgresql-server python sendmail sudo tcl tk libical1

3. Install prerequisite packages for testing PBS Pro:

Make sure you have the following on your local system:

the pip command

the sudo command

the which command

the net-tools package


C. Build the rpm Package for PBS Pro <pbs_version>

You can either build from source cloned from GitHub, or build from source rpm (srpm).

To Build from source cloned from GitHub:

        Note: <pbs_version> specified at pbspro/src/pbspro.spec

1.    Go to pbspro directory which you have cloned (git clone https://github.com/PBSPro/pbspro)
2.    Run the autogen.sh script to generate the configure script and Makefile.in files
                ./autogen.sh
                (generates configure script and Makefile.in templates)
3.    Run ./configure
4.    Generate the source tar that will use to build the rpm
                make dist
                make dist generates .tar.gz (pbspro-<pbs_version>.tar.gz) file in the same directory.
5.    Move the pbspro-<pbs_version>.tar.gz file to ~/rpmbuild/SOURCES
6.    Move pbspro/pbspro.spec file to  ~/rpmbuild/SPECS
7.    Change directory to ~/rpmbuild/SPECS
8.    Run the below command
                  rpmbuild -ba pbspro.spec         (This command will generate the 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

 


To Build the rpm Package from pbspro-<pbs_version>.src.rpm:

  1. Download from http://download.opensuse.org/repositories/home:/pbsproci/

2. You can either use the –rebuild option, or you can build the rpm yourself.

To use the --rebuild option:

Do an rpmbuild –rebuild pbspro-<pbs_version>.src.rpm

 

To build the rpm yourself:

Install the pbspro-<pbs_version>.src.rpm

rpm -i pbspro-<pbs_version>.src.rpm    

This installs pbspro-<pbs_version>.tar.gz and pbspro.spec in their respective directories under the rpmbuild dev tree.

Change directory to ~/rpmbuild/SPECS and run the below command

rpmbuild -ba pbspro.spec               (This command generates the 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


D. Install and Test Your rpm Package Locally

Installing and Testing Locally on CentOS7:

  1.  Log in as root
  2.  Change directory to ~/rpmbuild/RPMS
  3.  Install the package: yum -y install /root/rpmbuild/RPMS/x86_64/pbspro-server-<pbs_version>.x86_64.rpm
  4.  Enable MoM via “PBS_START_MOM=1” in /etc/pbs.conf file
  5.  Start the PBS Pro daemons using /etc/init.d/pbs start
  6.  From a non-root account, make sure that PBS works by running a job
  7.  Continue as root
  8.  cd test/fw
  9.  Install PTL and dependencies: pip install -r requirements.txt .
  10.  Create user accounts and groups required by PTL:  pbs_config --make-ug
  11.  cd ../tests
  12.  Run PTL tests: pbs_benchpress -l INFOCLI2 -o ptl.txt
  13.  Once pbs_benchpress completes, you can find the PTL log in ptl.txt

Installing and Testing Locally on openSUSE 13.2:

  1.  Log in as root
  2.  Change directory to ~/rpmbuild/RPMS 
  3.  Install the package: zypper -n install /root/rpmbuild/RPMS/x86_64/pbspro-server-<pbs_version>.x86_64.rpm
  4.  Enable MoM via “PBS_START_MOM=1” in /etc/pbs.conf file
  5.  Start the PBS Pro daemons using /etc/init.d/pbs start 
  6.  From a non-root account, make sure that PBS works by running a job
  7.  Continue as root
  8.  cd test/fw
  9.  Install PTL and dependencies: pip install -r requirements.txt .
  10.  Create user accounts and groups required by PTL: pbs_config --make-ug
  11.  cd ../tests
  12.  Run PTL tests: pbs_benchpress -l INFOCLI2 -o ptl.txt
  13.  Once pbs_benchpress completes, you can find the PTL log in ptl.txt



Site Map



 

15 Comments

  1. How to build pbs pro  for windows use vs2008

    1. For windows, we have a vs2008 solution file. You can double click this file: https://github.com/PBSPro/pbspro/blob/master/win_configure/pbs_windows_VS2008.sln to open it in vs2008 and build. The build however requires all the dependencies to be first manually installed under c:\Program Files. Please see the vs2008 project files for the list of dependencies. (We will shortly create a small write up about how to compile on Windows) However presently, a Windows installer is not available.

  2. Nice description, thanks.

    It warrants a single comment, though, based on my experience building on CentOS 7.2: CentOS 7 uses postfix rather than sendmail.

    > yum install -y ... sendmail ...

    For build on CentOS, I do not recommend installing sendmail unless you really want it. Sendmail is considered deprecated on CentOS7, and the default mail transport agent (MTA) is postfix. To have the build work with any of the MTAs, then modify the spec file slightly to require MTA rather than sendmail, like eg:

     perl -pi -e 's/^Requires: sendmail$/Requires: MTA/' pbspro.spec

    If no MTA is already installed, then I would opt for postfix rather than sendmail, ie. to do

    > yum install -y ... postfix ...

    See also http://community.pbspro.org/t/centos7-install-issues/83/4

    /Bjarne

  3. In order to do the test part (actually get any job to run), I had to define the server as a node (in qmgr). Just starting the MOM was not enough, as the server does not want to talk to the mom (I guess).

    So, likely(?) something like this is missing in the steps (Section D after step 5 or so):

    sudo qmgr -c "create node $(hostname -s)"

    Then, probably we also need to restart both server and mom to get the config right, ie. do something like

    sudo /etc/init.d/pbs restart

    Can somebody confirm this?

    /Bjarne

    PS: I use systemctl rather than the init scripts directly, but that is a different story.

     

    1. Yes, I can confirm it - I just went through this today for a brand new CentOS7 VM and got the same (negative) result when following the github INSTALL instructions.  Has a bug report already been filed for it?

  4. Further comments on the test part (this is for centos72, but could have impact on other flavours as well):

    A: The use of pip to install python-packages system-wide is likely not a good choice, as pip will modify the package-maintained (yum/rpm) python installation. If you later upgrade the underlying python libs (with yum), then lots of stuff could go wrong(?)

    The three packages in requirements.txt could be installed from standard RPMs with something like:

      sudo yum install -y python-nose python-beautifulsoup4 pexpect

    (This of course assumes that the standard packages are "new enough" for the tests to run.)

    B: I cant find pbs_config as part of my installation/compiled rpm. I do not see it in the pre-complied rpm either (pbspro-server-14.1.0-13.1.x86_64.rpm). Did I do something wrong, or??

    C: What exactly is "pbs_config --make-ug" supposed to do? I prefer not to have it modify (automagically) say, my users and groups. I'd much rather do that manually. 
    As part of other mentioned pre-prequisites (eg. section 3.5.2 in the installation and upgrade guide for pbspro 13.1) I created a user and group named pbsdata. Has it anything to do with that? 

    I much prefer to have identical UIDs and GIDs across machines, which is why I try to always define the necessary users and groups prior to the package installation. Comments?

    D: Would it be possible to run these tests as a standard user? Or at least define some pbs manager/operator, such that they do not have to run as root? Running test/build scripts as root is not a secure way to do stuff. 

    Thanks - I hope someone can follow up on these issues.

    /Bjarne

    1. A)

      I agree with you that use of pip to install system wide is not good choice. But here while installing PTL you can pass either '-–user' or '–-prefix' option to pip which will not install PTL system wide.
      or you can manually install those dependencies using yum install and then pip will not install those dependencies.
      NOTE: if you install ptl in user specified directory then please update PYTHONPATH and PATH variable with user specified directory.

      B)
      since pbs_config is part of PTL, you will get that command only after you install PTL. This is because not all PTL commands (except pbs_loganalyzer and pbs_stat) is included in PBS rpm package. So, what you are seeing is correct and you are not doing anything wrong.

      C)
      "pbs_config --make-ug" creates users and groups required for PTL as per pre-defined (as written below) configuration.
      However it is not mandatory to run "pbs_config --make-ug" before running tests, if you have created users and groups manually then you can ignore this step.
      Pre-defined configuration for users and groups:
      Groups:
      group_name=tstgrp00 gid=1900
      group_name=tstgrp01 gid=1901
      group_name=tstgrp02 gid=1902
      group_name=tstgrp03 gid=1903
      group_name=tstgrp04 gid=1904
      group_name=tstgrp05 gid=1905
      group_name=tstgrp06 gid=1906
      group_name=tstgrp07 gid=1907
      group_name=pbs gid=901
      Users:
      username=pbstest uid=4355 gid=tstgrp00 groups=tstgrp02,pbs home_dir=/home/pbstest shell=/bin/bash
      username=pbsoper uid=4356 gid=tstgrp00 groups=tstgrp02,pbs home_dir=/home/pbsoper shell=/bin/bash
      username=pbsadmin uid=4357 gid=tstgrp00 groups=tstgrp02,pbs home_dir=/home/pbsadmin shell=/bin/bash
      username=pbsroot uid=4371 gid=tstgrp00 groups=tstgrp02,pbs home_dir=/home/pbsroot shell=/bin/bash
      username=pbsmgr uid=4367 gid=tstgrp00 groups=tstgrp02,pbs home_dir=/home/pbsmgr shell=/bin/bash
      username=pbsother uid=4358 gid=tstgrp00 groups=tstgrp02,pbs home_dir=/home/pbsother shell=/bin/bash
      username=pbsuser uid=4359 gid=tstgrp00 home_dir=/home/pbsuser shell=/bin/bash
      username=pbsuser1 uid=4361 gid=tstgrp00 groups=tstgrp01,tstgrp02 home_dir=/home/pbsuser1 shell=/bin/bash
      username=pbsuser2 uid=4362 gid=tstgrp00 groups=tstgrp01,tstgrp03 home_dir=/home/pbsuser2 shell=/bin/bash
      username=pbsuser3 uid=4363 gid=tstgrp00 groups=tstgrp01,tstgrp04 home_dir=/home/pbsuser3 shell=/bin/bash
      username=pbsuser4 uid=4364 gid=tstgrp01 groups=tstgrp04,tstgrp05 home_dir=/home/pbsuser4 shell=/bin/bash
      username=pbsuser5 uid=4365 gid=tstgrp02 groups=tstgrp04,tstgrp06 home_dir=/home/pbsuser5 shell=/bin/bash
      username=pbsuser6 uid=4366 gid=tstgrp03 groups=tstgrp03,tstgrp07 home_dir=/home/pbsuser6 shell=/bin/bash
      username=tstusr00 uid=11000 gid=tstgrp00 home_dir=/home/tstusr00 shell=/bin/bash
      username=tstusr01 uid=11001 gid=tstgrp00 home_dir=/home/tstusr01 shell=/bin/bash

      D)
      Yes, you can run tests as a standard user but for that you have to setup sudoers file such a way that standard user can do operation without password as another user or as root using sudo command.
      However we can't totally eliminate use of root as there are some PBS operation which only root can do like:
      reading and parsing accounting logs
      changing PBS configuration files
      running qmgr command with operation like create node/queue
      setting queue/node/server attributes
      start/stop/restart/status of PBS daemons
      etc...

       

      1. Thank you, Hiren, for the in-depth explanations. I do have more questions and comments (yes, I know - I query a lot).

        Regarding pnt A:

        The "pip-instruction" reads (for centos):

        > Install PTL and dependencies: pip install -r requirements.txt.

        Hiren adds:

        > But here while installing PTL you can pass either '-–user' or '–-prefix' option to pip which will not install PTL system wide

        In fact, I am still unsure about what "PTL" (likely a pbs/python/something lib - Pbs Test Lib?). I guess the pip line will install it based on what is in the actual test/fw dir (and particularly the ptl subdir), but I am still not in a position to actually want to try this command on my system. Too much unknown stuff going around. (Also see below).

        Regarding pnts C+D:

        Adding 15 new users and 7 new groups just to run a test suite seems excessive. Also, adding these to wheel/sudoers is not really different from running under root, so it is not an option for me. 

        >However we can't totally eliminate use of root as there are some PBS operation which only root can do like:
        >reading and parsing accounting logs
        >running qmgr command with operation like create node/queue
        >setting queue/node/server attributes

        All the above may be done by a pbs manager, right? No sudo/root access required. So, presumably adding a few of the new users as pbs managers and/or operators should do the trick - at least for the above commands.

        >start/stop/restart/status of PBS daemons

        Obviously, this will need some OS access. But if we know that this is all we need, then we can limit it to a few explicit commands, which will be OK for a system like ours. It's the granting full access to everything, which disturbs me.

        >changing PBS configuration files

        Which files need to be changed? Stuff /etc/pbs.conf or stuff under PBSHOME? Is there a way to do what you need without full root access? Could the files be owned by a "pbs admin" group (eg pbsdata?) and then modified by pbs users, which is member of that group?

        > etc...

        Really, there is more? (Yes, presumably adding jobs as different users, and such I guess).

        Full root/OS access for a test suite is still no-go in my view. (Probably a lot of other sys admins would feel the same).

        I'd love to install PTL and run the test suite, but I cannot in good conscience follow the instructions as they are laid out.

        If some of these issues are ironed out, then presumably the test suite could be added as an RPM - depending on the requirements (as RPMs) as well as on the particular pbs RPM version as well. It still should be done in a way such that the test suite can run without sudo access, though. These are just random thoughts, and I don't know it it will happen.

        Best

        Bjarne

        1. Hi Bjarne,

           

          You have brought forth a great point, and this had been something many of us had been thinking on for a while now. PTL (PBS Test lab) really needs to be made to execute as much as possible without needing root (sure allowing sudo for everything is not an option). In fact we had been discussing the same even about the product itself, ie, PBSPro ceasing to need to be root. (The fact that PTL currently needs root or a very permissive sudoers file is already a problem in executing this inhouse for us)

          Now, since the entire PTL sources are open, as community members, we can contribute towards eliminating these restrictions from PTL (and even PBS) step by step. Currently, I think, there are a few ways to trust the PTL code and execute it:

          a) The PTL sources are open, so you can figure out exactly what it would do if you executed it. (still too much hassle I guess)

          b) Create a container with PTL and use that to run tests instead of doing it on your host (we, the community could even create a container image with PTL and all the users etc preconfigured in it for others to safely use)

          c) Exercise PTL via our automatic CI test runs on the Travis cloud (via github): When you submit a PBS code change (or even submit a new PTL test) Travis will execute those tests automatically on a cloud instance.

           

          Thanks and Regards,

          Subhasis

          1. If I understand correctly, the PBS Test Lab would be something to be run on a dedicated test machine - especially if one is to modify the PBS code base, and want to make sure that the whole shebang still works. As I have installed just the vanilla 14.1.0, I (likely?) do not need to run those tests at all - for sure not on our production systems.

            I thought that the tests were more in line of checking if we got the installations right. Executing in a container - or on an external host system - will for sure not help me in that regard,

            Anyway, for now I will skip these tests. 

            I would suggest to move the sections regarding tests to a completely different page / howto - dedicated to developers, who really need to modify code etc. However, maybe a simpler test suite could be set up - to just test simple functionality of a created system after install...?

            Best,

            Bjarne

            1. You are right. The PTL tests are to test the functionality of the software. This is not an installation check. You would only need to run PTL if you changed code and wanted to check whether you might have broken some existing functionality (ie caused regressions). 

              So, for your case, you can just go ahead with 14.1.0 downloaded version and run it. 

              Your suggestion about testing the installation itself sounds like great advise - we do have a tool called pbs_probe that we are coming up with which will check that required files are installed and permissions are all in place. Maybe we can extend the functionality of that tool to be more useful.

              Also, I do agree we need to move the pages to reflect the content better towards the target user/reader. We hope to make it better organized soon (Anne Urban - lets chat about this shortly)

               

              Thanks for all the inputs.

              Regards,

              Subhasis

  5. Anonymous

    pbs_password failed: not compiled with PBS_PASS_CREDENTIALS!

  6. where can i find the netlibtoc.lib file for windows compile

  7. netlibtoc is the licensing related file which should not be required. Kindly remove referneces to that from the windows project files. You can also create a bug to this extent and submit a code fix for the same.

  8. Also, kindly post your queries in the pbspro developer/user community forums where community members can respond faster. The comments here are not notified to everybody automatically.