Models at Runtime for Self-Adaptive Software

morisia_235x85

In this project, we investigate the role of Models at Runtime for Self-Adaptive Software (MORISIA), i.e., models that are used in feedback loops to enable self-adaptation. This has resulted in a model-driven framework that follows the concepts of the external approach, MAPE-K, and runtime models.

Concepts

The so called external approach (cf. Figure 1) splits the software into the domain and adaptation logic, respectively, the adaptable software and the adaptation engine, which promotes separation of concerns. The domain logic implements the domain functionality for the end users, while the adaptation logic implements a feedback loop that controls the runtime adaptation of the domain logic. Both logics are integrated by well-defined sensors and effectors.

As shown in Figure 1, the adaptation engine is refined by a blueprint for self-adaptive systems, called MAPE-K, that has been proposed by Kephart and Chess [1]. The blueprint considers four adaptation activities that monitor and analyze the adaptable software, and if needed, plan and execute adaptations to the adaptable software while sharing some knowledge.

FeedbackLoopsAndModels

Figure 1: External Approach (left), MAPE-K (middle), Runtime Models (right)
Figure taken from [3]

In the scope of this project, we refined the knowledge to a set of runtime models that are used in the feedback loop. We investigated which kind of runtime models are required to reflect the adaptable software as well as to specify the adaptation logic, i.e., the four MAPE activities. This has resulted in a categorization of runtime models [2] that is shown in Figure 1. As stated in [3]:

"Reflection Models reflect the adaptable software and its environment, and they are updated by monitoring the software and environment. Thereby, Monitoring Models map system-level observations to the abstraction level of reflection models. The reflection models are analyzed to identify adaptation needs by applying Evaluation Models that, e.g., define constraints on reflection models. If adaptation needs have been identified, the planning activity devises a plan prescribing the adaptation on the reflection models. Planning is specified by Change Models describing the adaptable software’s variability space. Evaluation models such as utility preferences guide the exploration of this space to find an appropriate adaptation. Finally, the execute activity enacts the planned adaptation on the adaptable software based on Execution Models that refine model-level adaptation to system-level adaptation.
Evaluation and change models do not have to be strictly separate models, which is exemplified by event-condition-action rules that address the analyze (evaluating the condition) and the plan (applying the actions) activities in one step. Thus, we combine them to Adaptation Models [4]. Monitoring and execution models are concerned with the synchronization of the adaptable software and the reflection models. This is known as the causal connection such that we consider them as Causal Connection Models."

Based on the ideas of the external approach, MAPE-K, and runtime models used in feedback loops, we develop a model-driven framework for engineering self-adaptive software.

Framework Overview

The following figure taken from [5] depicts an overview on the framework.

Figure 2: Overview on the Models@run.time Framework for Self-Adaptive Software Systems
Figure taken from [5]

The Managed System is the adaptable subsystem/software that contains the domain logic. It can be monitored and adapted through Sensors and Effectors that maintain a so called Source Model. This model is a causally connected self-representation to the managed system, i.e., changes of the managed system are reflected in the model, and changes of the model are reflected to the managed system.  To ease this causal connection, the source model is at the same abstraction level as the sensors and effectors, which makes the source model complex, detailed, and platform-specific as it covers multiple concerns and it is rather related to the solution space of the managed systems. This makes the source model laborious and difficult to use by autonomic managers. However, the source model enables the application of model-driven engineering techniques on top of it.
Therefore, multiple Target Models are derived and incrementally synchronized with the source model. With respect to the source model, a target model is less complex, at a higher level of abstraction, and platform-independent as it focuses on a specific concern such as performance or failures and it is related to problem space of the managed system. Thus, target models provide problem space oriented views on the managed system, i.e., knowledge that is  used by autonomic managers/adaptation engines to perform the feedback loop's adaptation activities (MAPE).

Source and target models are synchronized with each other in both directions:

  • source model changes reflecting changes of the managed systems are synchronized to the target models. This supports the monitoring [6].
  • target model changes reflecting planned adaptations performed by autonomic managers are synchronized to the source model and afterwards enacted to the managed system. This supports the execution of adaptation [7].

In our framework, the incremental and bidirectional synchronization of source and target models is realized by a Model Synchronization Engine based on Triple Graph Grammars (TGGs), in particular by MoTE (though the framework is not restricted to this specific engine). Therefore, TGG Rules specify at the level of metamodels how source and target models are synchronized with each other. The incremental synchronization is efficient, which makes it feasible to employ the engine on-line in a running self-adaptive system. However, since source and target models are at different abstraction levels, the bidirectional synchronization based on TGGs is impeded due to limited support for abstraction/refinement transformations. This is addressed by Factories that provide creation or instantiation patterns for refinements within a synchronization. Thus, TGG rules and the factories as Monitoring and Execution Models specify the monitoring and execution of adaptation by defining which model changes are propagated from or to the managed system.

The remaining activities of analyzing the managed system and planning adaptation are performed on individual target models for different concerns. So far, we investigated three concerns, namely, performance, architectural constraints, and failures to address self-optimization, self-configuration, and self-healing. The analysis and planning steps are specified by Adaptation Models that operate on top of the target models. In our framework, we use Story Patterns (SPs) and the Object Constraint Language (OCL) to define rules specifying the analysis and planning activities (Evaluation and Change Models). Analysis rules evaluate the target models and thus the managed system, while planning rules change target models to prescribe an adaptation to be performed through the source model on the managed system. For execution, corresponding interpreters such as the Story Diagram Tools for SPs are employed in our framework. However, the framework is not restricted to the SP and OCL rules to specify the analysis and planning activities.

Finally, multiple runtime models are simultaneously used within a feedback loop, which requires means to capture their interplay to properly specify and execute a feedback loop. Therefore, we are developing Executable Runtime Megamodels that provide a modeling language and an interpreter for feedback loops that are driven by models@run.time.

Framework Instantiation for EJB-based Software

Our framework has been instantiated for the Eclipse Modeling Framework (EMF) and for managed systems realized with Enterprise Java Beans 3 (EJB3) technology. EJB application servers, in our case GlassFish, typically provide platform-specific management APIs (basic sensors and effectors) to control EJB-based applications, which are, however, limited with respect to seamless runtime adaptation. Therefore, we use mKernel, a manageable kernel for EJB-based systems providing comprehensive support for management of enterprise applications [8], in particular sensors and effectors for seamless adaptation. However, the server's or mKernel's sensors and effectors are code-based and they do not provide model-based views that reflect the running applications while following MDE principles, especially the layers of models, metamodel, and meta-metamodels. Thus, we have developed an adapter that incrementally synchronizes the source model with the sensors and effectors, which actually implements the causal connection between the source model and the managed system. This causal connector is generic in the sense that it is reusable for any EJB3-based application compatible with GlassFish.

This causal connector maintains a source model at runtime that conforms to the metamodel shown in Figure 3 in a highly simplified version. Figure 4 depicts the slightly simplified metamodel for target models used for self-healing. Instances of these metamodels are synchronized with each other as specified by TGG rules. Overall, eleven TGG rules and one factory are required to specify the synchronization of arbitrary source and target models conforming to the corresponding metamodels as shown here. One of these rules is depicted in Figure 5. To illustrate the specification of an example adaptation, Figure 6 depicts a Story Pattern that modifies the self-healing target model to prescribe an adaptation. This example adaptation changes the bindings between components.

Figure 3: Highly Simplified Metamodel for Source Models

Figure 4: Slightly Simplified Metamodel for Target Models Used for Self-Healing

Figure 5: Example TGG Rule

Figure 6: Example Adaptation Story Pattern

Framework Status and Availability

The framework has been employed to academic case studies for self-adaptive software, in particular to mRUBiS as the adaptable software/managed system.  The framework’s implementation is continuously enhanced and elaborated, and it is available on request. For further information on the research prototype, please contact us.

References

  1. Jeffrey O. Kephart and David M. Chess. The Vision of Autonomic Computing. Computer 36, 1, 41-50, 2013.
  2. Thomas Vogel and Andreas Seibel and Holger Giese. The Role of Models and Megamodels at Runtime. In Juergen Dingel and Arnor Solberg, ed., Models in Software Engineering, Workshops and Symposia at MODELS 2010, Oslo, Norway, October 3-8, 2010, Reports and Revised Selected Papers, vol. 6627 of Lecture Notes in Computer Science (LNCS), pages 224-238. Springer-Verlag, 5 2011.
  3. Thomas Vogel and Holger Giese. Model-Driven Engineering of Self-Adaptive Software with EUREMA. ACM Trans. Auton. Adapt. Syst. 8(4):18:1-18:33, 1 2014.
  4. Thomas Vogel and Holger Giese. Requirements and Assessment of Languages and Frameworks for Adaptation Models. In Jörg Kienzle, ed., Models in Software Engineering, Workshops and Symposia at MoDELS 2011, Wellington, New Zealand, October 16-21, 2011, Reports and Revised Selected Papers, vol. 7167 of Lecture Notes in Computer Science (LNCS), pages 167-182. Springer-Verlag, 4 2012.
  5. Holger Giese and Leen Lambers and Basil Becker and Stephan Hildebrandt and Stefan Neumann and Thomas Vogel and Sebastian Wätzoldt. Graph Transformations for MDE, Adaptation, and Models at Runtime. In Marco Bernardo and Vittorio Cortellessa and Alfonso Pierantonio, ed., Formal Methods for Model-Driven Engineering, vol. 7320 of Lecture Notes in Computer Science (LNCS), pages 137-191.Springer-Verlag, 6 2012.
  6. Thomas Vogel and Stefan Neumann and Stephan Hildebrandt and Holger Giese and Basil Becker. Incremental Model Synchronization for Efficient Run-Time Monitoring.  In Sudipto Ghosh, ed., Models in Software Engineering, Workshops and Symposia at MODELS 2009, Denver, CO, USA, October 4-9, 2009, Reports and Revised Selected Papers, vol. 6002 of Lecture Notes in Computer Science (LNCS),pages 124-139. Springer-Verlag, 4 2010.
  7. Thomas Vogel and Holger Giese. Adaptation and Abstract Runtime Models. In Proceedings of the 5th Workshop on Software Engineering for Adaptive and Self-Managing Systems (SEAMS 2010) at the 32nd IEEE/ACM International Conference on Software Engineering (ICSE 2010), Cape Town, South Africa, pages 39-48, 5 2010. ACM.
  8. Jens Bruhn and Christian Niklaus and Thomas Vogel and Guido Wirtz. Comprehensive support for management of Enterprise Applications. In Proceedings of the 6th ACS/IEEE International Conference on Computer Systems and Applications (AICCSA 2008), Doha, Katar, pages 755-762, 3 2008. IEEE Computer Society.

Project Team

Related MDELab Projects

Other MDELab Tools Used by the Framework

Comments are closed.