Changes between Version 4 and Version 5 of flukes

Show
Ignore:
Timestamp:
10/24/11 16:36:25 (7 years ago)
Author:
pruth (IP: 152.54.9.28)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • flukes

    v4 v5  
    2121For added functionality, ORCA uses [http://velocity.apache.org/engine/releases/velocity-1.5/index.html velocity templates] to create the scripts.   See the [http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html user's guide] for details about Velocity.     
    2222 
    23 ORCA templates follow the Velocity syntax which can be used to replace several key pieces of data that are assigned by ORCA.     Specifically, there is are one or more arrays that contains the IP addresses of each instance.   For each group there is an array of IP addresses referenced using the name provided to Flukes.  In addition, there is a variable called $MY_ADDR_INDEX that is the index of the IP address of the current instance within its group's array of IP addresses.  All arrays of IP addresses are accessible from any post boot script in the current request. 
     23ORCA templates follow the Velocity syntax which can be used to replace several key pieces of data that are assigned by ORCA.     Specifically, there is are one or more arrays that contains the IP addresses assigned to each instance.   For each group there is an array of IP addresses referenced using the name provided to Flukes for the group.  In addition, there is a variable called $MY_ADDR_INDEX that is the index of the IP address of the current instance within its group's array of IP addresses.  All arrays of IP addresses are accessible from any post boot script in the current request. 
    2424 
    25 Template example: 
     25The following is an example post boot script that adds an entry to the /etc/hosts file for each of the instances in the request and sets the hostname of each instance to an appropriate value.  In this particular example, the first instance is assumed to be a master node named "master" while the remaining nodes are named worker1, worker2, ... The string "Group1" was used as the group name. 
    2626 
    2727{{{ 
    2828   # Test script  
    2929   echo "Hello from post boot script" 
    30    apt-get install my-favorite-app 
     30   echo $Group1.get(0) master  >> /etc/hosts  
    3131#set ( $size = $Group1.size() - 1 ) 
    3232#foreach ( $i in [1..$size] ) 
    33    echo $Group1.get($i) condor-w$i >> /etc/hosts 
     33   echo $Group1.get($i) worker$i >> /etc/hosts 
    3434#end 
    3535#if ( $MY_ADDR_INDEX == 0) 
    36    echo condor-master > /etc/hostname 
    37    cp /opt/pegasus/condor-configs/condor_config.master /etc/condor/condor_config 
     36   echo master > /etc/hostname 
    3837#else 
    39    echo condor-w$MY_ADDR_INDEX > /etc/hostname 
    40    cp /opt/pegasus/condor-configs/condor_config.worker /etc/condor/condor_config 
     38   echo condor-worker$MY_ADDR_INDEX > /etc/hostname 
    4139#end 
    4240}}}