Version 4 (modified by pruth, 8 years ago)

--

Using Flukes

Overview

Post Boot Scripts

Flukes allows a post boot script to be associated with each node or node group. Post boot scripts are the preferred way to create customized instances from a shared image. Specifically, a post boot script can contain an arbitrary script that is a executed immediately after the instance has booted.

Simple example:

   echo "Hello from post boot script script"
   apt-get install my-favorite-app
   echo node1 > /etc/hostname

For added functionality, ORCA uses velocity templates to create the scripts. See the user's guide for details about Velocity.

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.

Template example:

   # Test script 
   echo "Hello from post boot script"
   apt-get install my-favorite-app
#set ( $size = $Group1.size() - 1 )
#foreach ( $i in [1..$size] )
   echo $Group1.get($i) condor-w$i >> /etc/hosts
#end
#if ( $MY_ADDR_INDEX == 0)
   echo condor-master > /etc/hostname
   cp /opt/pegasus/condor-configs/condor_config.master /etc/condor/condor_config
#else
   echo condor-w$MY_ADDR_INDEX > /etc/hostname
   cp /opt/pegasus/condor-configs/condor_config.worker /etc/condor/condor_config
#end

Attachments