SmartExecutor

From Gcube Wiki
Revision as of 11:58, 19 October 2015 by Luca.frosini (Talk | contribs) (The Service)

Jump to: navigation, search

The SmartExecutor service allows to execute "gCube Tasks". Each instance of the SmartExecutor service can run the "gCube Tasks" related to the plugins available on such an instance.

Each instance of the SmartExecutor service publishes descriptive information about the co-deployed plugins.

Clients may interact with the Executor service through a library of high-level facilities that subsumes standard service stubs to simplify the discovery of available tasks in those instances. Each client can request to execute a Task or getting informations about the state of their execution.

The Service

SmartExecutor service allows tasks execution through the use of co-deployed plugins.

The service allows to pass inputs parameter to the plugin requested to run.

SmartExecutor service can run the tasks in two mode:

  • Run and Die
  • Scheduled

In the Run and Die mode the requested plugin has been run just one time using the input parameters contained in the invocation request. When the execution finish, is stopped or stop due to exception in the execution terminate and a new execution can be run only is explicitly requested.

In Scheduled mode, the way to schedule the plugin execution is indicated in the invocation parameters. The execution is invoked every time it match the scheduling parameters.


The invocation parameters are:

  • the name of the plugin to be instantiated and run.
  • the name of

Plugins

At startup time the SmartExecutor discover the available plugins (using java.util.ServiceLoader) The SmartExecutor uses a ServiceEndpoint with Category: VREManagement and Name: SmartExecutor to publish information regarding the co-deployed plugins and their own information.



SmartExecutor interaction

The SmartExecutor service provides a client library to simplify the following procedures:

  • discover service instances that can execute the target task. This requires interaction with the Information System.
  • launch the execution of the task with one the discovered instances.
  • monitor the execution of the running task.

Instance Discovery

Launching Tasks

Task Inputs

Monitor Task Execution

Plugin Development

SmartExecutor plugins may have arbitrary size and dependencies but must include the following components:


Tasks

Note: Plugins are instantiated by the Executor and thus must have have a zero-argument constructor.


Development Environment and Testing

This [Eclipse project] may be used to kick-off plugin development and testing.