150 likes | 245 Views
The GridPort Interface to SRB. NPACI Portals Team (SDSC). People. Stephen Mock, mock@sdsc.edu Giving this presentation Cathie Mills, mills@sdsc.edu Wrote most of the SRB Gridport Code Wrote most of this presentation. Outline. Introduction Justification Structure Usage Questions.
E N D
The GridPort Interface to SRB NPACI Portals Team (SDSC)
People • Stephen Mock, mock@sdsc.edu • Giving this presentation • Cathie Mills, mills@sdsc.edu • Wrote most of the SRB Gridport Code • Wrote most of this presentation
Outline • Introduction • Justification • Structure • Usage • Questions
Introduction Gridport is a portal toolkit written in perl that enables portal developers to use common grid tools. The Storage Resource Broker (SRB) is a data management tool that many of our users and portal developers have shown an interest and need for.
Justification • Portals need to have access to SRB for data management • Grid Portals currently use GSI authentication • GSI is the Grid Security Infrastructure, an X.509 certificate based system commonly associated with Globus • This makes use of mySRB problematic • GridPort and portals using it are written in Perl
Examples • Examples of Grid Portals using SRB: • Telescience Portal • Portal for controlling a Tomographic Electron Microscope remotely • Stores and catalogs generated data using SRB • BIRN Portal • Biomedical Informatics Research Network • Used for research on brain data (stored in SRB) • Cosmic Portal • Computational Astrophysics • Huge inputs and outputs stored in SRB (~1TB) per run
Goal:Expose the SRB API in Perl using GridPort’s authentication module with a small amount of code
Structure • Two modules: • 1 standalone exposing the API in Perl • SRB.pm • 1 within GridPort to allow for optional use of Authentication module • Gridport:SRB.pm
Module Interaction Portal GridPort Authentication SRB Perl Cog Perl SRB SRB Binaries … * Note: This diagram does not represent the whole of GridPort, but only as it pertains to the SRB interface
Usage: Getting the user logged in to the portal Use GridPort::Authentication; my $gp = new Gridport::Authentication; my $login_state = $gp->get_login_state(gsi=>'true'); if(!defined($login_state)) { $login_state = $gp->gsi_login(username=>$user,passphrase=>$pass,portal=>'gridport_test_portal'); } if(!$login_state){ print header; print start_html; print "Couldn't log you in!"; print "Error is: <pre>" . $gp->get_error() . "</pre><br>"; print end_html; }else{ ## user is logged in -> do good stuff
Usage: Once the user is logged in (verifying the login on subsequent pages) use Gridport::Authentication; my $gp = new Gridport::Authentication; my $login_state = $gp->get_login_state(gsi=>'true'); if(!defined($login_state)) { print "<br><font color=#ff0000>Must be logged in to test this functionality</font><br>"; exit; }else{ print "The user is logged into Gridport\n<br>"; }
Usage: Run an SRB function (once it has been verified that the user is logged in) Use Gridport::SRB; my $username = $gp->get_username(); my $proxy_location = $gp->get_proxy_file(); ## create an SRB object my $srb = Gridport::SRB->new(portal_username=>$username,proxy_location=>$proxy_location); ## check to see if an error was create when trying to set ENVS for srb $error = $srb->get_error(); if($error){ print "$error\n<br><br>\n"; } ## run the test my @ls_res = $srb->ls(dir=>$dir,recursive=>$recursive,long_list=>$long,meta=>$meta); print "ls: @ls_res\n<br><br>\n";
SRB API • A list of the methods available in the SRB module: • Login • createUser (admin) • Ls • Mkdir • Get • Put • Rm • Cat • File_exists • Status • Get_homedir • Dir_exists • Move • Chmod • Copy • Put_meta • Get_meta • GetColl • getD (d=data)
Links to the Documentation • GridPort Download page http://gridport.npaci.edu • GridPort API Documentation http://cvs.rocksclusters.org/viewcvs/viewcvs.cgi/portals/gridport/docs/html/index.html