You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 21 Next »

Purpose

In order to be able to stage jobs to resources and launch them there on behalf of a user, host-dependent information must be obtained dynamically by the Workflow Broker after scheduling the node to run. While it would be optimal if every Grid resource exposed this information consistently and through a uniform set of APIs, that is unfortunately not (yet?) the case. Hence we have developed a small information service with an administrative interface to store this data and make it readily available both for viewing and for workflow configuration. This is once again a GSI web service requiring authentication and authorization via certificate.

Mode of Usage

In most cases, the user, if administrator, will interact with this service through a specially designed Siege view (refer to the tutorial for specifics). The programmatic interactions, such as those accomplished by the broker, take place via the web service ports. The sections which follow thus are only of interest to potential developers wishing to gain understanding of what lies "under the hood".

API

Repository

Info be obtained through its retrieve ports; updated or modified through its add, update and remove ports. In addition, the find calls can be used to do simple listings.

public interface HostInfoRepository
{
   /*
    * Add a new root element.
    */
   public void addHost( String hostInfoXml );
   
   /*
    *  Diff'd update of the root.
    */
   public void updateHost( String hostId, String hostInfoXml );
   
   /*
    *  Diff'd update of the root.
    */
   public void updateNode( String hostId, String nodeId, String nodeInfoXml );
   
   /*
    *  Diff'd update of the root.
    */
   public void updateUser( String hostId, String userName, String userInfoXml );
   
   /*
    * Remove can be called anywhere on the HostInfo tree.
    */
   public void removeHost( String hostId );
   public void removeUserFromHost( String hostId, String user );
   public void removeUserFromAllHosts( String user );
   public void removeHostEnvironmentVariable( String hostId, String name );
   public void removeUserEnvironmentVariable( String hostId, String user, String name );
   public void removeNodeFromHost( String hostId, String nodeId );
   public void removeProtocol( String nodeId, String protocolType, String protocolName );
   public void removeOptimizationProperty( String nodeId, String protocolType, String protocolName, String propertyName );
   public void removeSoftEnv( String nodeId );
   
   /*
    *  List queries.
    */
   public String[] findHosts();
   public String[] findUsers( String hostId );
   public String[] findNodes( String hostId );
   
   /*
    *  These return the serialized object.
    */
   public String retrieveHostInfo( String hostId ); 
   public String retrieveNodeInfo( String nodeId ); 
   public String retrieveUserInfoWithHostEnv( String nodeId, String user ); 
   public String retrieveUserInfoEntry( String hostId, String user );
}

HostInfo

Defines an entire resource. Aside from a generic name for the entire resource tree, architecture and OS, a host can have a set of environment properties applicable to all users, a set of user accounts, and a set of node names which can define their own protocols for job submission and file movement.

public class HostInfo implements Updateable
{
   /*
    *  Updateable
    */
   public Element asElement();
   public Element createUpdateableElement();
   public void initializeFromElement( Element element );

   /*
    *  Hibernate
    */
   public Integer getId();
   public void setId( Integer id );

   public void addEnvVariable( String name, String value );
   public void addUserInfo( UserOnHostInfo info );
   public void addNodeInfo( NodeInfo info );
   
   public String getHostId();
   public void setHostId( String hostId );
   public String getArchitecture();
   public void setArchitecture( String architecture );
   public String getOsName();
   public void setOsName( String osName );
   public String getOsVersion();
   public void setOsVersion( String osVersion );
   public Map getEnvironment();
   public void setEnvironment( Map environment );
   public Map getNodeInfo();
   public void setNodeInfo( Map nodeInfo );
   public Map getUserInfo();
   public void setUserInfo( Map userInfo );
}

NodeInfo

Defines a node mapping for a resource, usually a "head node". As stated above, these can have independent specifications for interactive, batch and file movement protocols.

public class NodeInfo implements Updateable
{
   /*
    *  Updateable
    */
   public Element asElement();
   public Element createUpdateableElement();
   public void initializeFromElement( Element element );

   /*
    *  Hibernate
    */
   public Integer getId();
   public void setId( Integer id );

   public void addFileProtocol( ProtocolInfo info );
   public void addInteractiveProtocol( ProtocolInfo info );
   public void addBatchProtocol( ProtocolInfo info );

   public String getNodeId();
   public void setNodeId( String nodeId );
   public String getSoftEnvScript();
   public void setSoftEnvScript( String softEnvScript );
   public Map getBatchProtocols();
   public void setBatchProtocols( Map batchProtocols );
   public Map getFileProtocols();
   public void setFileProtocols( Map fileProtocols );
   public Map getInteractiveProtocols();
   public void setInteractiveProtocols( Map interactiveProtocols );
   public ProtocolInfo[] orderProtocols( String type );
}

UserInfo

public class UserOnHostInfo implements Updateable
{ 
   /*
    *  Updateable
    */
   public Element asElement();
   public Element createUpdateableElement();
   public void initializeFromElement( Element element );

   /*
    *  Hibernate
    */
   public Integer getId();
   public void setId( Integer id );

   public void addEnvVariable( String name, String value );

   public Map getEnvironment();
   public void setEnvironment( Map environment );
   public String getUserHome();
   public void setUserHome( String userHome );
   public String getUserName();
   public void setUserName( String userName );
}

ProtocolInfo

public class ProtocolInfo implements Updateable
{
   /*
    *  Updateable
    */
   public Element asElement();
   public Element createUpdateableElement();
   public void initializeFromElement( Element element );

   /*
    *  Hibernate
    */
   public Integer getId();
   public void setId( Integer id );

   public void addOptimization( String name, String value );
   public void addOptimization( Property property );

   public String getContact();
   public void setContact( String contact );
   public String getName();
   public void setName( String name );
   public String getType();
   public void setType( String type );
   public Map getOptimizations();
   public void setOptimizations( Map optimizations );
   public Integer getRanking();
   public void setRanking( Integer ranking );
}
  • No labels