350 likes | 520 Views
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
E N D
Extending GCM and Fscript for the Distributed Reconfiguration of Components Boutheina Bennour, Ludovic Henrio, Marcela Rivera {bbennour,lhenrio,mrivera}@sophia.inria.fr December 2008 INRIA – Univ Nice Sophia Antipolis - CNRS
Agenda • Context • Distributed Reconfiguration • Execution Context • Experimentation • Conclusion and Perspectives INRIA – Univ Nice Sophia Antipolis - CNRS
Agenda • Context • Distributed Reconfiguration • Execution Context • Experimentation • Conclusion and Perspectives INRIA – Univ Nice Sophia Antipolis - CNRS
Component Model • Fractal its distributed extension: GCM • Component • Encapsulation • Composition • Hierarchical Provided interface binding Required interface Primitive component = business code Primitive component = business code Composite component INRIA – Univ Nice Sophia Antipolis - CNRS
GCM/ProActive Distributed components Deployed over several nodes Components abstract away distribution Implementation: ProActive Active objects Asynchronous communication Futures INRIA – Univ Nice Sophia Antipolis - CNRS SAFA’ 08
JVM 1 (Host A) JVM 2 (Host B) JVM 3 (Host B) GCM/ProActive: Distribution and Communication Asynchronous remote method invocation INRIA – Univ Nice Sophia Antipolis - CNRS
Reconfiguration, adaptation • Dynamic reconfiguration • Architectural modification during execution • Change of functional/non-functional behaviour • Adaptation to context and requirements INRIA – Univ Nice Sophia Antipolis - CNRS
Component Models and reconfiguration INRIA – 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 . . . INRIA – 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 INRIA – Univ Nice Sophia Antipolis - CNRS
Example • Add the component given_child to the composite given_parent given_parent given_parent given_child FScript: Fractal API: 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 */ } INRIA – 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 INRIA – Univ Nice Sophia Antipolis - CNRS
Agenda • Context • Distributed Reconfiguration • Execution Context • Experimentation • Conclusion and Perspectives INRIA – Univ Nice Sophia Antipolis - CNRS
Reconfiguration interface Interpreter Membrane 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...) INRIA – Univ Nice Sophia Antipolis - CNRS
Triggering Distributed Reconfigurations in the Scripting Language A 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 remote_call(target_component, action_name, parameters, ...); Reconfiguration interface action(arguments) Interpreter target_component INRIA – Univ Nice Sophia Antipolis - CNRS
given_parent given_parent given_child Example • Add the component given_child to the composite given_parent remote_call($given_parent, ‘add’, ‘$given_parent’, ‘given_child’); INRIA – Univ Nice Sophia Antipolis - CNRS
Example Reconfiguration interface RC 2 definition action1 ... remote_call(C2,’action2’) remote_call(C11,’action11’) remote_call(C12,’action12’) ... Reconfiguration scripts C2 definition action12 ... remote_call(C121,’action121’) ... RC 1 Interpreter Membrane RC 12 RC 11 C11 RC 121 C121 C12 C1 INRIA – Univ Nice Sophia Antipolis - CNRS
Example Reconfiguration interface RC 2 definition action1 ... remote_call(C2,’action2’) remote_call(C11,’action11’) remote_call(C12,’action12’) ... Reconfiguration scripts C2 action1( ) definition action12 ... remote_call(C121,’action121’) ... RC 1 Interpreter Membrane RC 12 RC 11 C11 RC 121 C121 C12 C1 INRIA – Univ Nice Sophia Antipolis - CNRS
Example Reconfiguration interface RC 2 definition action1 ... remote_call(C2,’action2’) remote_call(C11,’action11’) remote_call(C12,’action12’) ... Reconfiguration scripts C2 action1( ) action2( ) definition action12 ... remote_call(C121,’action121’) ... RC 1 Interpreter Membrane action11( ) action12( ) RC 12 RC 11 C11 RC 121 C121 C12 C1 INRIA – Univ Nice Sophia Antipolis - CNRS
Example Reconfiguration interface RC 2 definition action1 ... remote_call(C2,’action2’) remote_call(C11,’action11’) remote_call(C12,’action12’) ... Reconfiguration scripts C2 action1( ) action2( ) definition action12 ... remote_call(C121,’action121’) ... RC 1 Interpreter Membrane action11( ) action12( ) RC 12 RC 11 action121( ) C11 RC 121 C121 C12 C1 INRIA – Univ Nice Sophia Antipolis - CNRS
Example Reconfiguration interface RC 2 definition action1 ... remote_call(C2,’action2’) remote_call(C11,’action11’) remote_call(C12,’action12’) ... Reconfiguration scripts C2 action1( ) action2( ) definition action12 ... remote_call(C121,’action121’) ... RC 1 Interpreter Membrane action11( ) action12( ) RC 12 RC 11 action121( ) C11 RC 121 C121 Conclusion: The interpretation is parallel and distributed C12 C1 INRIA – Univ Nice Sophia Antipolis - CNRS
Agenda • Context • Distributed Reconfiguration • Execution Context • Experimentation • Conclusion and Perspectives INRIA – Univ Nice Sophia Antipolis - CNRS
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 void createGlobalVariable(String name, Object reference) INRIA – Univ Nice Sophia Antipolis - CNRS
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 argument2 = ’$$C11_name/parent::C1_name/interface::interface_name’ ; remote_call($$C1_name/child::C11_name,’action11’, argument2) ; . . . . . evaluate(argument2) ; INRIA – Univ Nice Sophia Antipolis - CNRS
Agenda • Context • Distributed Reconfiguration • Execution Context • Experimentation • Conclusion and Perspectives INRIA – 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 INRIA – Univ Nice Sophia Antipolis - CNRS
Experience Reconfiguration interface Interpreter Membrane Root r r s s Client Server ClientServer r r s s Client Server INRIA – Univ Nice Sophia Antipolis - CNRS
Experience Reconfiguration interface Interpreter Membrane Root r r s s Client Server ClientServer r r s s Client Server INRIA – 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); } INRIA – 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 INRIA – Univ Nice Sophia Antipolis - CNRS
Agenda • Context • Distributed Reconfiguration • Execution Context • Experimentation • Conclusion and Perspectives INRIA – 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 INRIA – 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 INRIA – 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 INRIA – Univ Nice Sophia Antipolis - CNRS
Thanks! INRIA – Univ Nice Sophia Antipolis - CNRS