whenAllInstalled: Execute a block of commands when all resources have reached the INSTALLED state

This command is a "Task Description" command of OEDL. It is one of the available commands, which allows the definition of the experiment execution's state machine.

This command allows the experimenter to define a block of commands to execute when all the resources in the experiments have reached the INSTALLED states. This state is reached when:

  • a resource (e.g. a node) has its Resource Controller (aka Node Agent) successfully checked in with the Experiment Controller (aka Node Handler)
  • AND, this Resource Controller reports to the Experiment Controller that all the applications associated to this resource have been installed successfully.

Of course, for this to happen the node has to be powered-on, and successfully booted into its OS.

This 'whenAllInstalled' command will check if all the resources are in the INSTALLED state every 5 sec.

Syntax


whenAllInstalled(&block)

where:

  • &block = the code-block to execute/evaluate against the resources when they all have reached the INSTALLED state.

Usage

In this example of 'whenAllInstalled', when all the nodes have reached the INSTALLED state, the block of commands is being executed. Here in this block of commands, we wait 10 sec, then we request that all the nodes in all the defined groups start all of their associated applications and prototypes. Then we wait another 10 sec, before terminating the experiment.

Please refer to the other manual pages for more details on the 'wait', 'allGroups', and 'startApplications' commands.

1  whenAllInstalled() {|node|
2 
3        wait 10
4        allGroups.startApplications
5        wait 10 
6        Experiment.done
7  }
8 

Under the Hood:

'whenAllInstalled' is a syntactic sugar. Indeed, it is just a shortcut to a specific call of the OEDL command 'whenAll()':

1  whenAllInstalled() {|node|
2 
3        wait 10
4 
5  }

is equivalent to:

1  whenAll("*", "apps/app/status/@value", 5, "INSTALLED.OK") {|node|
2 
3        wait 10
4 
5  }

In this call to 'whenAll', we test that all the nodes in all the defined groups have all their associated applications in the INSTALLED.OK state.

  • "*" is the 'whenAll' groupSelector argument, which here is the wild-card referring to all the defined groups in this experiment.
  • "apps/app/status/@value" is the the 'whenAll' nodeTest argument, which here is an XPath that indicates that we are searching the state of each node for an XML element that is equal to <apps><app ...><status value='SomethingHere'>...</status></app></apps>
  • 5 is the 'whenAll' interval argument, thus here the test will be repeated with the default interval of 5 sec.
  • "INSTALLED.OK" is the 'whenAll' triggerValue argument, which here is set to "STARTED". Thus the periodic tests performed by this 'whenAll' command will only stop when all the nodes in the all the groups, which have an XML element equal to <apps><app ...><status value='SomethingHere'>...</status></app></apps>, have the 'SomethingHere' value equal to 'INSTALLED.OK'. In other words, nodes that do not have such XML element are not taken into account for the test.

Please refer to the 'whenAll' reference page for more details on its syntax and usage.