The PBS Plug-in can be used to submit jobs and to monitor the queues in a PBS server. It is under development and backward compatibility is not guaranteed at the moment.
In the following sections you will learn about how to install, configure and use the plug-in. We will use a Docker PBS Torque image, but the initial version of the plug-in was developed using a Vagrant box, and tested in an old PBS Torque server.
The plug-in offers a custom slave, that uses the PBS client utility commands, e.g. qsub, qstat and pbsnodes, to submit jobs and monitor the queues in PBS servers. It is still under development and there are several features from other plug-ins that are being studied to be included (e.g. restore jobs when Jenkins is restarted but the job is still running in the cluster).
// TODO simple diagram
The slave that will be responsible for communicating with the PBS server needs the qsub, qstat and other executables available from packages like torque-client on Ubuntu. If you would like to use the Docker container for testing the PBS side, you can start it with the following command:
docker run -h pbs.local -p 10022:22 --rm --name torque --privileged agaveapi/torque bash bash-4.1# /usr/bin/supervisord
Follow the instructions at http://biouno.org/jenkins-update-site.html to grab the latest release of the plug-in binary and install to your local Jenkins.
Once the plug-in is installed, you can install configuring the global settings for the plug-in, under Manage Jenkins / Configure System.
The section PBS settings contains some information used to submit jobs and to generate logs and search for job results. You may want to adjust it according to your environment.
Next you need to set up a PBS Slave. Under Manage Jenkins / Manage Nodes, you will need to create a PBS Slave. You can give it any name. But you must remember the label assigned to the node, as it will be used in the next steps.
If everything worked, you should see the PBS queues in your server now being listed in the main screen, under the default Jenkins queue.
Now that you have a PBS Slave configured with a label, you will need to use the same label in your job configuration. That way, Jenkins will know that your job needs to be handled by the slave with the torque-client (so that it can use the qsub, qstat, and other utilities).
Besides the label, the only part in the job configuration that you need to worry is the PBS script. That script is used directly by the qsub command, so you can copy and paste an existing script. Here is an example.
#!/bin/bash #PBS -l walltime=00:1:00 #PBS -l nice=19 #PBS -q debug date hostname sleep 5 date
When you schedule the job in Jenkins, a new build will start. This build will run until it finds that the server has executed the job (by parsing the job output) or until you stop the job or Jenkins is restarted. You can track the progress of the job by clicking on its link in the PBS queue used, or by searching by its status.
Search job status
Going to the main screen in Jenkins, below the PBS queue status you will find a form to query for jobs in the PBS cluster. You can pass the job ID (11.localhost is only 11) and if the job output is still available it will be displayed in a new screen.