Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

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". There is an example of the XML data representation at the end of this page.

API

Service WSDL

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.

...

Defines a node mapping for a resource, usually a . This is usually the name of a physical "head node" . As stated above, these can have independent specifications for interactive, batch and file movement protocolswith a specific IP address, but a logical name is also possible, provided the protocol contacts actually point to physical nodes. The node is thus a way for specifying independent configurations of interactive, batch and file movement protocols available on the resource.

Code Block
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 );
}

...

Maps user to home directory on the hostresource, and provides any specific environment variables needed to run the user's jobs there.

Code Block
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 );
}

...

Defines protocols for job submission and file movement that are available on the given noderesource. Associated properties for optimal performance can also be stored for reference by the submission unit of the Brokerconfiguration purposes. The ranking is an indexed position used in conjunction with the orderProtocols() method on the NodeInfo object; thus for instance, a ranking of '0' puts the protocol at the head of the list in front of any alternates with a higher ranking value.

...

Code Block
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 );
}

...

Note on Implementation

Updates to the service are achieved by diff'ing the current representation of the object against the new one. In order for this to work with a given bean, a special interface must be implemented:

Code Block

public interface Updateable extends UserFacing
{   
   public static final String ID_NAMESPACE = "ncsa.updateable.id";
   public static final String NEW_NAMESPACE = "ncsa.updateable.new";
   public static final String DELETED_NAMESPACE = "ncsa.updateable.deleted";
   
   /**
    * The contract is that this method should be called inside the
    * asElement() method to return the top-level element
    * with an ID_NAMESPACE whose value is equal to whatever 
    * distinguishes this object from any siblings of the same type.
    */
   public Element createUpdateableElement();
}

As can be seen, special XML namespaces for adding and deleting are used in the diff'ing process. The code responsible for merging the XML is in the UserFacingUtils class of the ncsa.tools.common plugin. Siege's HostInfoAdmin view handles the namespace semantics required by those methods.

...

HostInfo XML Example

Code Block
xml
xml

<?xml version="1.0" encoding="UTF-8"?>
<host xmlns:ncsa.updateable.id="TUNGSTEN" hostId="TUNGSTEN" architecture="i686 SMP" osName="Linux" osVersion="2.4.21-32.0.1.ELsmp-perfctr-lustre">
      
  <!-- common environment -->
  <property xmlns:ncsa.updateable.id="JAVA_HOME" name="JAVA_HOME" category="environment">
    <value xmlns:ncsa.updateable.id="value">/u/ncsa/jalameda/j2sdk1.4.2_04</value>
  </property>
  <property xmlns:ncsa.updateable.id="SCR" name="SCR" type="int" category="workdirEnvironment">
    <value xmlns:ncsa.updateable.id="value">0</value>
  </property>
  <property xmlns:ncsa.updateable.id="TG_CLUSTER_SCRATCH" name="TG_CLUSTER_SCRATCH" type="int" category="workdirEnvironment">
    <value xmlns:ncsa.updateable.id="value">1</value>
  </property>
  <property xmlns:ncsa.updateable.id="TG_CLUSTER_PFS" name="TG_CLUSTER_PFS" type="int" category="workdirEnvironment">
    <value xmlns:ncsa.updateable.id="value">2</value>
  </property>
  <property xmlns:ncsa.updateable.id="scr" name="scr" type="int" category="workdirEnvironment">
    <value xmlns:ncsa.updateable.id="value">3</value>
  </property>
  <property xmlns:ncsa.updateable.id="PWD" name="PWD" type="int" category="workdirEnvironment">
    <value xmlns:ncsa.updateable.id="value">4</value>
  </property>
  
  <!-- users -->
  <user xmlns:ncsa.updateable.id="arossi" userName="arossi" userHome="/u/ncsa/arossi"/>
  <user xmlns:ncsa.updateable.id="bbaker" userName="bbaker" userHome="/u/ncsa/bbaker"/>
  <user xmlns:ncsa.updateable.id="daues" userName="daues" userHome="/u/ncsa/daues"/>
  <user xmlns:ncsa.updateable.id="shawn" userName="shawn" userHome="/u/ncsa/shawn"/>
  <user xmlns:ncsa.updateable.id="jalameda" userName="jalameda" userHome="/u/ncsa/jalameda"/>
  <user xmlns:ncsa.updateable.id="bjewett" userName="bjewett" userHome="/u/ncsa/bjewett"/>
  <user xmlns:ncsa.updateable.id="scottp" userName="scottp" userHome="/u/ncsa/scottp"/>
  <user xmlns:ncsa.updateable.id="tbaltzer" userName="tbaltzer" userHome="/u/ac/tbaltzer"/>
  <user xmlns:ncsa.updateable.id="kathla" userName="kathla" userHome="/u/ac/kathla"/>
  <user xmlns:ncsa.updateable.id="danielw" userName="danielw" userHome="/u/ac/danielw"/>
  <user xmlns:ncsa.updateable.id="govett" userName="govett" userHome="/u/ac/govett"/>
  <user xmlns:ncsa.updateable.id="akulkar3" userName="akulkar3" userHome="/u/ac/akulkar3"/>
  
  <!-- head nodes -->
  <node xmlns:ncsa.updateable.id="tunc.ncsa.uiuc.edu" nodeId="tunc.ncsa.uiuc.edu">
    <file-protocol xmlns:ncsa.updateable.id="gridftp" name="gridftp" ranking="0">
      <contact xmlns:ncsa.updateable.id="contact">gridftp://gridftp-w.ncsa.teragrid.org:2811</contact>
    </file-protocol>
    <file-protocol xmlns:ncsa.updateable.id="gsiscp" name="gsiscp" ranking="1">
      <contact xmlns:ncsa.updateable.id="contact">gsiscp://grid-w.ncsa.teragrid.org</contact>
    </file-protocol>
    <interactive-protocol xmlns:ncsa.updateable.id="GRAM" name="GRAM" ranking="0">
      <contact xmlns:ncsa.updateable.id="contact">jobmanager://grid-w.ncsa.teragrid.org:2119</contact>
    </interactive-protocol>
    <interactive-protocol xmlns:ncsa.updateable.id="GSISSH" name="GSISSH" ranking="1">
      <contact xmlns:ncsa.updateable.id="contact">gsissh://grid-w.ncsa.teragrid.org</contact>
    </interactive-protocol>
    <batch-protocol xmlns:ncsa.updateable.id="MOAB" name="MOAB" ranking="0">
      <contact xmlns:ncsa.updateable.id="contact">msub://localhost</contact>
    </batch-protocol>
  </node>
  <node xmlns:ncsa.updateable.id="tund.ncsa.uiuc.edu" nodeId="tund.ncsa.uiuc.edu">
    <file-protocol xmlns:ncsa.updateable.id="gridftp" name="gridftp" ranking="0">
      <contact xmlns:ncsa.updateable.id="contact">gridftp://gridftp-w.ncsa.teragrid.org:2811</contact>
    </file-protocol>
    <file-protocol xmlns:ncsa.updateable.id="gsiscp" name="gsiscp" ranking="1">
      <contact xmlns:ncsa.updateable.id="contact">gsiscp://grid-w.ncsa.teragrid.org</contact>
    </file-protocol>
    <interactive-protocol xmlns:ncsa.updateable.id="GRAM" name="GRAM" ranking="0">
      <contact xmlns:ncsa.updateable.id="contact">jobmanager://grid-w.ncsa.teragrid.org:2119</contact>
    </interactive-protocol>
    <interactive-protocol xmlns:ncsa.updateable.id="GSISSH" name="GSISSH" ranking="1">
      <contact xmlns:ncsa.updateable.id="contact">gsissh://grid-w.ncsa.teragrid.org</contact>
    </interactive-protocol>
    <batch-protocol xmlns:ncsa.updateable.id="GRAM" name="GRAM" ranking="0">
      <contact xmlns:ncsa.updateable.id="contact">jobmanager-lsf://grid-w.ncsa.teragrid.org:2119</contact>
    </batch-protocol>
  </node>
  <node xmlns:ncsa.updateable.id="grid-w.ncsa.teragrid.org" nodeId="grid-w.ncsa.teragrid.org">
    <file-protocol xmlns:ncsa.updateable.id="gridftp" name="gridftp" ranking="0">
      <contact xmlns:ncsa.updateable.id="contact">gridftp://gridftp-w.ncsa.teragrid.org:2811</contact>
    </file-protocol>
    <file-protocol xmlns:ncsa.updateable.id="gsiscp" name="gsiscp" ranking="1">
      <contact xmlns:ncsa.updateable.id="contact">gsiscp://grid-w.ncsa.teragrid.org</contact>
    </file-protocol>
    <interactive-protocol xmlns:ncsa.updateable.id="GRAM" name="GRAM" ranking="0">
      <contact xmlns:ncsa.updateable.id="contact">jobmanager://grid-w.ncsa.teragrid.org:2119</contact>
    </interactive-protocol>
    <interactive-protocol xmlns:ncsa.updateable.id="GSISSH" name="GSISSH" ranking="1">
      <contact xmlns:ncsa.updateable.id="contact">gsissh://grid-w.ncsa.teragrid.org</contact>
    </interactive-protocol>
    <batch-protocol xmlns:ncsa.updateable.id="GRAM" name="GRAM" ranking="0">
      <contact xmlns:ncsa.updateable.id="contact">jobmanager-lsf://grid-w.ncsa.teragrid.org:2119</contact>
    </batch-protocol>
   </node>
</host>