Extending GCM and Fscript for the Distributed Reconfiguration of Components

35
SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS Extending GCM and Fscript for the Distributed Reconfiguration of Components Boutheina Bennour, Ludovic Henrio , Marcela Rivera {bbennour,lhenrio,mrivera}@sophia.inria.fr December 2008

description

Extending GCM and Fscript for the Distributed Reconfiguration of Components. Boutheina Bennour, Ludovic Henrio , Marcela Rivera {bbennour,lhenrio,mrivera}@sophia.inria.fr December 2008. Agenda. Context Distributed Reconfiguration Execution Context Experimentation - PowerPoint PPT Presentation

Transcript of Extending GCM and Fscript for the Distributed Reconfiguration of Components

Page 1: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis -

CNRS

Extending GCM and Fscript for the

Distributed Reconfiguration of

ComponentsBoutheina Bennour, Ludovic Henrio, Marcela Rivera

{bbennour,lhenrio,mrivera}@sophia.inria.fr

December 2008

Page 2: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Agenda

Context

Distributed Reconfiguration

Execution Context

Experimentation

Conclusion and Perspectives

2

Page 3: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Agenda

Context

Distributed Reconfiguration

Execution Context

Experimentation

Conclusion and Perspectives

3

Page 4: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Component Model

Primitive component= business code

Required interface

Provided interface

binding

Composite component

Fractal its distributed extension: GCM Component

Encapsulation Composition Hierarchical

4

Primitive component= business code

Page 5: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08

GCM/ProActive

Distributed components Deployed over several nodes Components abstract away distribution

Implementation: ProActive Active objects Asynchronous communication Futures

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS 5

Page 6: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

GCM/ProActive: Distribution and Communication JVM 1 (Host A)

JVM 2 (Host B) JVM 3 (Host B)

Asynchronous remote method invocation

6

Page 7: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Reconfiguration, adaptation

Dynamic reconfiguration Architectural modification during execution Change of functional/non-functional behaviour Adaptation to context and requirements

7

Page 8: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Component Models and reconfigurationComponent Model

Composition

Distribution

Management of non functional code

CCM Hierarchical Specified Separation of concerns

CCA Flat Specified Separation of concerns

SCA Hierarchical Non specified Implementation

Fractal Hierarchical Non specified Membrane

GCM Hierarchical Specified Membrane

8

Page 9: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

GCM API for Reconfiguration

Life-cycle controller

Binding controller

Content Controller

string getFcState ();void startFc () throws IllegalLifeCycleException;void stopFc () throws IllegalLifeCycleException;

string[] listFc ();any lookupFc (string clientItfName) throws NoSuchInterfaceException;void bindFc (string clientItfName, any serverItf) throws . . .void unbindFc (string clientItfName) throws. . .

any[] getFcInternalInterfaces ();any getFcInternalInterface (string itfName) throws . . . Component[] getFcSubComponents ();void addFcSubComponent (Component c) throws . . .void removeFcSubComponent (Component c) throws . . .

9

Page 10: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

FScript

A Scripting reconfiguration language Dedicated to Fractal components Expressions, actions, control structures

(exceptions) FPath expressions: navigate and select

elements in the components architecture One primitive by method of the Fractal API

A language dedicated to reconfiguration of Fractal components

A language dedicated to reconfiguration of Fractal components

10

Page 11: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Example

Add the component given_child to the composite given_parent

given_parent

given_child

given_parent

Add($given_parent, $given_parent/child::given_child)

try { ContentController cc = (ContentController) givenParent.getFcInterface("content-controller"); try {

cc.addFcSubComponent(givenChild); } catch (IllegalLifeCycleException ilce) { /* Handle error */ } catch (IllegalContentException ice) { /* Handle error */ }} catch (NoSuchInterfaceException nsie) { /* Handle error */ }

FScript:

Fractal API:

11

Page 12: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Objective: A distributed reconfiguration language Distributed reconfiguration

Allow a component/node to interpret a reconfiguration script

Actions can be executed in parallel Extension of the FScript language to

Trigger distributed reconfiguration Handle the distributed execution

12

Page 13: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Agenda

Context

Distributed Reconfiguration

Execution Context

Experimentation

Conclusion and Perspectives

13

Page 14: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

A Controller for Reconfigurations Manages and allows the invocation of the

script interpreter Is collocated with the component Exposes methods for reconfiguration 

setInterpreter(interpreterClassName) loadScript(scriptFileName) executeAction(actionName, arguments...)

Reconfiguration interface

Interpreter

Membrane

14

Page 15: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Triggering Distributed Reconfigurations in the Scripting LanguageA primitive for the distributed script interpretation

Triggers the action action_name by the interpreter located in target_component

Receives action arguments as parameter Precondition (Reconfigurability)

The target component must havea reconfiguration controller, i.e. it must expose the RC interface

Reconfiguration interface

action(arguments)

Inte

rpre

ter

target_component

15

remote_call(target_component, action_name, parameters, ...);

Page 16: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Example

Add the component given_child to the composite given_parent

given_parent

given_child

given_parent

remote_call($given_parent, ‘add’, ‘$given_parent’, ‘given_child’);

16

Page 17: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

definition action1

...

remote_call(C2,’action2’)

remote_call(C11,’action11’)

remote_call(C12,’action12’)

...

definition action12

...

remote_call(C121,’action121’)

... Interpreter Membrane

C2

RC 1

RC 12

RC 121

RC 2

RC 11

Reconfiguration scripts

C121

C11

C1

C12

ExampleReconfiguration interface

17

Page 18: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

definition action1

...

remote_call(C2,’action2’)

remote_call(C11,’action11’)

remote_call(C12,’action12’)

...

definition action12

...

remote_call(C121,’action121’)

... Interpreter

RC 1

RC 12

RC 121

RC 2

RC 11

C121

C11

C1

C12

Example

action1( )

Reconfiguration interface

Membrane

C2Reconfiguration scripts

18

Page 19: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

definition action1

...

remote_call(C2,’action2’)

remote_call(C11,’action11’)

remote_call(C12,’action12’)

...

definition action12

...

remote_call(C121,’action121’)

... Interpreter

RC 1

RC 12

RC 121

RC 2

RC 11

C121

C11

C1

C12

Example

action1( )

action11( )

action2( )

action12( )

Reconfiguration interface

Membrane

C2Reconfiguration scripts

19

Page 20: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

definition action1

...

remote_call(C2,’action2’)

remote_call(C11,’action11’)

remote_call(C12,’action12’)

...

definition action12

...

remote_call(C121,’action121’)

... Interpreter

RC 1

RC 12

RC 121

RC 2

RC 11

C121

C11

C1

C12

Example

action1( )

action11( )

action2( )

action12( )

action121( )

Reconfiguration interface

Membrane

C2Reconfiguration scripts

20

Page 21: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

definition action1

...

remote_call(C2,’action2’)

remote_call(C11,’action11’)

remote_call(C12,’action12’)

...

definition action12

...

remote_call(C121,’action121’)

... Interpreter

RC 1

RC 12

RC 121

RC 2

RC 11

C121

C11

C1

C12

Example

action1( )

action11( )

action2( )

action12( )

action121( )

Conclusion: The interpretation is parallel and distributed

Reconfiguration interface

Membrane

C2Reconfiguration scripts

21

Page 22: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Agenda

Context

Distributed Reconfiguration

Execution Context

Experimentation

Conclusion and Perspectives

22

Page 23: Extending GCM and Fscript for the Distributed Reconfiguration of Components

Adaptation of FScript to Distributed Interpretation

Provide an access point for the component architecture Add a global variable in the interpreter Holds a reference to the component that owns the

interpreter

Managing action’s parameters Arguments passed to the target interpreter are serialised Make usual arguments (mainly FPath) serializable

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

void createGlobalVariable(String name, Object reference)

23

Page 24: Extending GCM and Fscript for the Distributed Reconfiguration of Components

Managing Execution Contexts Arguments are evaluated by the source interpreter by

default It might be more adequate to evaluate them in the target

evaluation context especially for Fpath expressions

Transmit the FPath expression as a string Add a primitive for the evaluation of Fpath expressions

This primitive can then be called by the action, and evaluated in the target interpreter

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

argument2 = ’$$C11_name/parent::C1_name/interface::interface_name’ ; remote_call($$C1_name/child::C11_name,’action11’, argument2) ;

. . . . .evaluate(argument2) ;

24

Page 25: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Agenda

Context

Distributed Reconfiguration

Execution Context

Experimentation

Conclusion and Perspectives

25

Page 26: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Implementation

ProActive Add the reconfiguration controller interface in

GCM/ProActive components ProActive allows the configuration of provided control

interfaces when creating a component

FScript Definition of the distributed interpretation primitive

Experimentation Reconfiguration of GCM components

26

Page 27: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Experience

Interpreter Membrane

Reconfiguration interface

Client

ClientServer

Server

ServerClient

Root

r r

r r s

s s

s

27

Page 28: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Experience

Interpreter Membrane

Reconfiguration interface

Client

ClientServer

Server

ServerClient

Root

r r

r r s

s s

s

28

Page 29: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Experience: Reconfiguration script action change_client(root) {

client = $root/child::Client; intf-root-r = $root/interface::r; unbind($client/interface::s); unbind($intf-root-r); client2 = new('ClientImpl'); set-name($client2,"Client2"); add($root,$client2); intf-client2-r = $client2/interface::r; intf-client2-s = $client2/interface::s; bind($intf-client2-s,$root/child::Server/interface::s); bind($intf-root-r,$intf-client2-r);}

action reconfigure_root(root){ change_client($root); remote_call($root/child::Server,'change_client',$root/child::ClientServer); remote_call($root/child::ClientServer/child::Server,'echo','Hello World'); start($root);}

29

Page 30: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Result

Successfully reconfigured components New clients connected and working We check the new configuration thanks to FPath expressions

Evaluated to True

bound($root/child::Client2/interface::r) and bound($root/child::Client2/interface::s) and not(bound($root/child::Client/interface::r)) and not(bound($root/child::Client/interface::s))

Feasibility of our approach and distributed reconfigurability of GCM

components

Feasibility of our approach and distributed reconfigurability of GCM

components

30

Page 31: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Agenda

Context

Distributed Reconfiguration

Execution Context

Experimentation

Conclusion and Perspectives

31

Page 32: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Conclusion

Extend FScript reconfiguration language

Better reconfigurability of distributed components

Introduced a reconfiguration controller

New primitive for distributed script evaluation

New primitives for better managing the distributed nature of the execution context

Prototype and experimentation

32

Page 33: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Perspectives (1)

Type reconfiguration scripts to validate script relatively to a component structure

Reconfiguration atomicity Provided by FScript Difficult to implement efficiently in a distributed

manner Could provide primitives to choose if a

reconfiguration is atomic or tools to know if a reconfiguration succeeded

and take adequate decisions

33

Page 34: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Perspectives (2)Reconfiguration Primitives

Primitives for structural changes Duplicate a component Replace a component Migrate a component (of node, or to another

composite) Suppress a component Auto-connection

34

Page 35: Extending GCM and Fscript for the Distributed Reconfiguration of Components

SAFA’ 08INRIA – Univ Nice Sophia Antipolis

- CNRS

Thanks!

35