UniCluster Express Qlogin

From UniCluster

Contents

Integrating Grid Engine qlogin with UniCluster Express

Grid Engine provides a utility called qlogin that submits an interactive login session to a Grid Engine install. This way you get a shell that is running in a queue and is subject to all of the queue policies and restrictions. By default Grid Engine is configured to use telnet for the interactive login session, but since we have a nice integrated GSI based security set-up in UniCluster Express, we can use the included GSI enabled ssh client and daemon to provide a secure passwordless login.

Creating SSH Wrapper Scripts

The first step is creating ssh wrapper scripts. Since sgeexecd is started at boot without a complete ucluster environment, the ssh daemon script needs to source "<install_dir>/unicluster-user-env.sh" before calling sshd. Here is an example of the sshd/qlogind script with an <install_dir> of /usr/local/unicluster:

#!/bin/sh
source /usr/local/unicluster/unicluster-user-env.sh
sshd -i

Place this script in <install_dir>/sbin and name it qlogind.sh.

The ssh/qlogin client doesn't need a wrapper script to source the unicluster environment as it runs in the environment of the submitting user but it does need a wrapper to handle the arguments that Grid Engine passes to the client. Grid Engine assumes telnet and passes <hostname> <port> to the client. The ssh binary does not understand naked ports. To handle this argument issue create the following script in /usr/local/unicluster/sbin/ named qlogin.sh (assuming that <install_dir> is /usr/local/unicluster):

#!/bin/sh
gsissh -p $2 $1

With these scripts configured we can now go on to making the changes to the Grid Engine configuration.

Configuring Grid Engine

First we need to modify the global Grid Engine configuration with:

[root@cbrunner unicluster]# qconf -mconf

and modify the the qlogin_command, qlogin_daemon, and rlogin_daemon to look like (assuming <install_dir> is /usr/local/unicluster):

qlogin_command               /usr/local/unicluster/sbin/qlogin.sh
qlogin_daemon                /usr/local/unicluster/sbin/qlogind.sh
rlogin_daemon                /usr/local/unicluster/sbin/qlogind.sh

Now we need to modify the host configurations. For each existing host in you system do a:

[root@cbrunner unicluster]# qconf -mconf <hostname>

and modify the the qlogin_daemon and rlogin_daemon to look like (assming <install_dir> is /usr/local/unicluster):

qlogin_daemon                /usr/local/unicluster/sbin/qlogind.sh
rlogin_daemon                /usr/local/unicluster/sbin/qlogind.sh

Testing it Out

Now it should all be set up, so simply do a:

[cbrunner@cbrunner unicluster]$ unicluster-grid-logon
[cbrunner@cbrunner unicluster]$ qlogin

and you should see something like:

Your job 15 ("QLOGIN") has been submitted
waiting for interactive job to be scheduled ...
Your interactive job 15 has been successfully scheduled.
Establishing /usr/local/unicluster/sbin/qlogin.sh session to host cbrunner.univa.com ...
Last login: Tue Jan  8 07:37:18 2008 from 172.16.1.27
[cbrunner@cbrunner ~]$ 

if you run qstat from this prompt you can see the running job:

[cbrunner@cbrunner ~]$ source /usr/local/unicluster/ucluster-user-env.sh 
[cbrunner@cbrunner ~]$ qstat -f
queuename                qtype used/tot. load_avg  arch   states
---------------------------------------------------------------------------------------
all.q@cbrunner.univa.com  BIP   1/1       0.14    lx24-x86  15 0.55500 QLOGIN cbrunner  r  01/08/2008 09:43:08  1        
[cbrunner@cbrunner ~]$ 

and then simply type "exit" to end the session:

[cbrunner@cbrunner ~]$ exit
logout

Connection to cbrunner.univa.com closed.
/usr/local/unicluster/sbin/qlogin.sh exited with exit code 0
[cbrunner@cbrunner unicluster]$ 

Now if you run qstat again the job should be gone:

[cbrunner@cbrunner unicluster]$ qstat -f
queuename                   qtype used/tot. load_avg   arch       states
--------------------------------------------------------------------------
all.q@cbrunner.univa.com    BIP     0/1       0.17    lx24-x86      
[cbrunner@cbrunner express]$


Back to Administrative How Tos