Top Banner
Filip Křikava PhD defense November 22, 2013, Sophia Antipolis CNRS, University of Nice Sophia Antipolis, I3S Laboratory, MODALIS research group Advisors: Philippe Collet and Johan Montagnat Domain-Specific Modeling Language for Self-Adaptive Software System Architectures
79

PhD Thesis Defense

Jan 27, 2015

Download

Technology

Filip Krikava

The vision of Autonomic Computing and Self-Adaptive Software Systems aims at realizing software that autonomously manage itself in presence of varying environmental conditions. Feedback Control Loops (FCL) provide generic mechanisms for self-adaptation, however, incorporating them into software systems raises many challenges.

The first part of this thesis addresses the integration challenge, i.e., forming the architecture connection between the underlying adaptable software and the adaptation engine. We propose a domain-specific modeling language, FCDL, for integrating adaptation mechanisms into software systems through external FCLs. It raises the level of abstraction, making FCLs amenable to automated analysis and implementation code synthesis. The language supports composition, distribution and reflection thereby enabling coordination and composition of multiple distributed FCLs. Its use is facilitated by a modeling environment, ACTRESS, that provides support for modeling, verification and complete code generation. The suitability of our approach is illustrated on three real-world adaptation scenarios.

The second part of this thesis focuses on model manipulation as the underlying facility for implementing ACTRESS. We propose an internal Domain-Specific Language (DSL) approach whereby Scala is used to implement a family of DSLs, SIGMA, for model consistency checking and model transformations. The DSLs have similar expressiveness and features to existing approaches, while leveraging Scala versatility, performance and tool support.

To conclude this thesis we discuss further work and further research directions for MDE applications to self-adaptive software systems.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PhD Thesis Defense

Filip KřikavaPhD defense

November 22, 2013, Sophia Antipolis

CNRS, University of Nice Sophia Antipolis, I3S Laboratory, MODALIS research group

Advisors: Philippe Collet and Johan Montagnat

Domain-Specific Modeling Language for Self-Adaptive Software System

Architectures

Page 2: PhD Thesis Defense

Context and Motivation

Jeff Kephart - Autonomic Computing: The First Decade, ICAC’11 keynote

Electronic Retailer - Application Diagram

• Ever growing complexity of computing systems• Taming this complexity by skilled IT professionals does not scale• New operation modes are needed

2

Page 3: PhD Thesis Defense

Towards Self-Adaptive Software Systems

• Towards Self-Adaptive Software Systems• Realizing system that adjusts themselves in accordance with some higher-level goals

3

Page 4: PhD Thesis Defense

Monitoring Reconfiguration

Decision Making

sensors effectors

Target System

events actions

measures decisions

Feedback Control Loop (FCL)

Towards Self-Adaptive Software Systems

• Towards Self-Adaptive Software Systems• Realizing system that adjusts themselves in accordance with some higher-level goals

3

Page 5: PhD Thesis Defense

Challenges

4

Engineering of self-adaptive software systems is a challenge

Designing an adaptation engine

Controller Target System

Transducer

+ -

� =mX

i=1

1

d=

m

d

⇥(N) = �µ =

md

µ

d =m

�(N)µ

Integrating the adaptation engine into the target system

API

LOGS

CONFIGURATIONS

COMMANDS

AOP

PROFILER

Page 6: PhD Thesis Defense

Challenges

4

Engineering of self-adaptive software systems is a challenge

Designing an adaptation engine

Controller Target System

Transducer

+ -

� =mX

i=1

1

d=

m

d

⇥(N) = �µ =

md

µ

d =m

�(N)µ

Integrating the adaptation engine into the target system

API

LOGS

CONFIGURATIONS

COMMANDS

AOP

PROFILER

Page 7: PhD Thesis Defense

Challenges

5

Integrating the adaptation engine into the target system

Adaptation Engine Target System

• Extensive handcrafting of non-trivial code• Cumbersome and error-prone• Accidental complexities

Adhoc Implementations

Controller Target System

Transducer

+ -

� =mX

i=1

1

d=

m

d

⇥(N) = �µ =

md

µ

d =m

�(N)µ

API

LOGS

CONFIGURATIONS

COMMANDS

AOP

PROFILER

Page 8: PhD Thesis Defense

Challenges

6

Integrating the adaptation engine into the target system

Adaptation Engine Target SystemReusing and adapting existing work

Controller Target System

Transducer

+ -

� =mX

i=1

1

d=

m

d

⇥(N) = �µ =

md

µ

d =m

�(N)µ

API

LOGS

CONFIGURATIONS

COMMANDS

AOP

PROFILER

• Often target specific types of adaptation problems (Bertran’12)• Require the use of certain adaptation mechanism (Garlan’04)• Applicable to single domain (Rouvoy’08) or technology (Asadollahi’09)• Do not support remoting or complex control schemes (Adamczyk’08, Gorton’06)• Limiting their applicability

Page 9: PhD Thesis Defense

Requirements

7

Identified requirements for integrating self-adaptation into software systems

Generality

• Domain-agnostic• Technology-agnostic

• Explicit FCLs, their process and interactions• Verification support

Visibility

• Reusable FCL parts across adaptation scenarios

Reusability

Page 10: PhD Thesis Defense

Requirements

7

Identified requirements for integrating self-adaptation into software systems

Generality

• Domain-agnostic• Technology-agnostic

• Explicit FCLs, their process and interactions• Verification support

Visibility

• Reusable FCL parts across adaptation scenarios

Reusability

• Remote distribution of FCL

Distribution

• Composition• Reflection

Complexcontrol

Page 11: PhD Thesis Defense

Requirements

7

Identified requirements for integrating self-adaptation into software systems

Generality

• Domain-agnostic• Technology-agnostic

• Explicit FCLs, their process and interactions• Verification support

Visibility

• Reusable FCL parts across adaptation scenarios

Reusability

• Remote distribution of FCL

Distribution

• Composition• Reflection

Complexcontrol

• Prototyping• Automating

Tooling

Lightweight approach

Page 12: PhD Thesis Defense

Objectives

Provide an approach to facilitate systematic integration of self-adaptive mechanisms into software systems through feedback control loops.

8

“”

Page 13: PhD Thesis Defense

Contributions

9

Feedback Control Definition Language

The ACTRESS Modeling Environment

The SIGMA Model Manipulation Languages

Monitoring Reconfiguration

Decision Making

sensors effectors

Target System

events actions

measures decisions

Integrating the adaptation engine into the target system

Con

trib

utio

ns

Facilitates language

use

Facilitates tooling

implementation

Controller Target System

Transducer

+ -

� =mX

i=1

1

d=

m

d

⇥(N) = �µ =

md

µ

d =m

�(N)µ

API

LOGS

CONFIGURATIONS

COMMANDS

AOP

PROFILER

Generality Visibility Reusability Distribution Complex control

Tooling

Lightweight approach

Page 14: PhD Thesis Defense

Plan

10

1. Feedback Control Definition Language

2. The ACTRESS Modeling Environment

3. The Sigma Model Manipulation Languages

4. Conclusions and Perspectives

Page 15: PhD Thesis Defense

Plan

11

1. Feedback Control Definition Language

2. The ACTRESS Modeling Environment

3. The Sigma Model Manipulation Languages

4. Conclusions and Perspectives

Page 16: PhD Thesis Defense

Feedback Control Definition Language

12

1. Raise the level of abstraction

2. Fine-grained decomposition of FCL elements

3. Explicit interactions

4. Provide reflection and composition capabilities

5. Embed remoting

Monitoring Decision Making Reconfiguration

measures

events

decisions

actions

General Purpose Language (GPL)

Generality

Visibility

Reusability

Distribution

Complexcontrol

Page 17: PhD Thesis Defense

Feedback Control Definition Language

13

1. Raise the level of abstraction

2. Fine-grained decomposition of FCL elements

3. Explicit interactions

4. Provide reflection capabilities

5. Embed remoting

Domain-Specific Modeling

Page 18: PhD Thesis Defense

Feedback Control Definition Language

13

1. Raise the level of abstraction

2. Fine-grained decomposition of FCL elements

3. Explicit interactions

4. Provide reflection capabilities

5. Embed remoting

Domain-Specific Modeling

Monitoring Reconfiguration

Decision Making

sensors effectorsevents actions

measures decisions

Page 19: PhD Thesis Defense

Feedback Control Definition Language

13

1. Raise the level of abstraction

2. Fine-grained decomposition of FCL elements

3. Explicit interactions

4. Provide reflection capabilities

5. Embed remoting

Domain-Specific Modeling

• Feedback Control Loop• Sequence of interconnected processes• Inputs x State -> Output• Reactive• Concurrent• Dynamic

Monitoring Reconfiguration

Decision Making

sensors effectorsevents actions

measures decisions

Page 20: PhD Thesis Defense

Feedback Control Definition Language

13

1. Raise the level of abstraction

2. Fine-grained decomposition of FCL elements

3. Explicit interactions

4. Provide reflection capabilities

5. Embed remoting

Domain-Specific Modeling

• Feedback Control Loop• Sequence of interconnected processes• Inputs x State -> Output• Reactive• Concurrent• Dynamic

Monitoring Reconfiguration

Decision Making

sensors effectorsevents actions

measures decisions

• The Actor Model• Network of actors communicating via

message passing• Message x State -> Message(s)• Reactive• Concurrent• Dynamic

actor

actor

actor

Page 21: PhD Thesis Defense

Feedback Control Definition Language

14

• Feedback Control Loop• Sequence of interconnected processes• Inputs x State -> Output• Reactive• Concurrent• Dynamic

• The Actor Model• Network of actors communicating via

message passing• Message x State -> Message(s)• Reactive• Concurrent• Dynamic• Thread safe• Scalable• Remoting support• Programming support

Monitoring Reconfiguration

Decision Making

sensors effectorsevents actions

measures decisions

actor

actor

actor

Page 22: PhD Thesis Defense

Feedback Control Definition Language - Adaptive Element

15

Monitoring Reconfiguration

Decision Making

sensors effectorsevents actions

measures decisions

Processor

in input

out output

Effector

in input

Sensor

out output

Target System

in input

Controller

in input

out output

Processor

out output

Page 23: PhD Thesis Defense

Feedback Control Definition Language - Adaptive Element

15

Monitoring Reconfiguration

Decision Making

sensors effectorsevents actions

measures decisions

Processor

in input

out output

Effector

in input

Sensor

out output

Target System

in input

Controller

in input

out output

Processor

out output

in input

providedEffectorprovidedSensor

out output

Page 24: PhD Thesis Defense

Feedback Control Definition Language - Illustration

• Typical example of a control-based solution to a well-known and well-scoped problem• Design of a sophisticated control mechanisms• Integration left for adhoc implementation

16

QoS management control of web servers by content delivery adaptation

Page 25: PhD Thesis Defense

Feedback Control Definition Language - Illustration

17

Idea: service time = fixed overhead + data-size dependent overhead

Abdelzaher et al., 1999, 2002

QoS management control of web servers by content delivery adaptationGoal: maintain server load around some pre-set value

Prerequisite: preprocessed content (different quality and size)

Page 26: PhD Thesis Defense

Feedback Control Definition Language - Illustration

17

Idea: service time = fixed overhead + data-size dependent overhead

Abdelzaher et al., 1999, 2002

QoS management control of web servers by content delivery adaptationGoal: maintain server load around some pre-set value

/1/photo.jpg

/2/photo.jpg

/photo.jpgfull quality

degraded quality

Prerequisite: preprocessed content (different quality and size)

Page 27: PhD Thesis Defense

Feedback Control Definition Language - Illustration

17

Idea: service time = fixed overhead + data-size dependent overhead

Abdelzaher et al., 1999, 2002

QoS management control of web servers by content delivery adaptationGoal: maintain server load around some pre-set value

/1/photo.jpg

/2/photo.jpg

/photo.jpgfull quality

degraded quality

normal load

overload

Prerequisite: preprocessed content (different quality and size)

Page 28: PhD Thesis Defense

Feedback Control Definition Language - Illustration

17

Idea: service time = fixed overhead + data-size dependent overhead

Abdelzaher et al., 1999, 2002

QoS management control of web servers by content delivery adaptation

...

serve fromtree #2

serve fromtree #1

Rejection Level

Minimum Content Full Content

Goal: maintain server load around some pre-set value

/1/photo.jpg

/2/photo.jpg

/photo.jpgfull quality

degraded quality

normal load

overload

Prerequisite: preprocessed content (different quality and size)

Page 29: PhD Thesis Defense

Feedback Control Definition Language - Illustration

17

Idea: service time = fixed overhead + data-size dependent overhead

Abdelzaher et al., 1999, 2002

QoS management control of web servers by content delivery adaptation

...

serve fromtree #2

serve fromtree #1

Rejection Level

Minimum Content Full Content

Goal: maintain server load around some pre-set value

/1/photo.jpg

/2/photo.jpg

/photo.jpgfull quality

degraded quality

normal load

overload

Prerequisite: preprocessed content (different quality and size)

Page 30: PhD Thesis Defense

Feedback Control Definition Language - Illustration

17

Idea: service time = fixed overhead + data-size dependent overhead

Abdelzaher et al., 1999, 2002

QoS management control of web servers by content delivery adaptation

...

serve fromtree #2

serve fromtree #1

Rejection Level

Minimum Content Full Content

Generality Visibility Reusability

Using FCDL

Goal: maintain server load around some pre-set value

/1/photo.jpg

/2/photo.jpg

/photo.jpgfull quality

degraded quality

normal load

overload

Prerequisite: preprocessed content (different quality and size)

Page 31: PhD Thesis Defense

Feedback Control Definition Language - Illustration

17

Idea: service time = fixed overhead + data-size dependent overhead

Abdelzaher et al., 1999, 2002

QoS management control of web servers by content delivery adaptation

...

serve fromtree #2

serve fromtree #1

Rejection Level

Minimum Content Full Content

Distribution Complex control

Generality Visibility Reusability

Using FCDL

Goal: maintain server load around some pre-set value

/1/photo.jpg

/2/photo.jpg

/photo.jpgfull quality

degraded quality

normal load

overload

Prerequisite: preprocessed content (different quality and size)

Page 32: PhD Thesis Defense

Feedback Control Definition Language - Illustration

18

3. Compute severity of adaptation (G)

2. Compute the requests rate (R), bandwidth (W) and utilization (U)

1. Compute the number of requests (r) and size of responses (w)

Page 33: PhD Thesis Defense

1. Compute the number of requests (r) and size of responses (w)

accessLog: FileTailer

out lines

file=/var/log/apache2/access.log

Feedback Control Definition Language - Illustration

access_log

19

active sensor FileTailer { push out port lines: String

property file: String}

processor Accumulator { push in port input: long pull out port sum: long}

processor AccessLogParser { push in port lines: String push out port size: int push out port requests: int}

Generality

Visibility

Reusability

requestCounter: Accumulator

responseSizeCounter: Accumulator

in input

out sum out sum

in lines

out sizeout requests

accessLogParser: AccessLogParser

Page 34: PhD Thesis Defense

access_log

Feedback Control Definition Language - Illustration

20

active processor PeriodTrigger<T> { pull in port input: T push out port output: T

property initialPeriod = 10.seconds}

Generality

Visibility

Reusability

requestCounter: Accumulator

responseSizeCounter: Accumulator

scheduler: PeriodTrigger

loadMonitor: LoadMonitor

in input

out sum out sum

in requests in size

out utilization

in input

out output

initialPeriod=10s

accessLog: FileTailer

in lines

out lines

file=/var/log/apache2/access_log

out sizeout requests

accessLogParser: AccessLogParser

2. Compute the requests rate (R), bandwidth (W) and utilization (U)

Page 35: PhD Thesis Defense

content_tree

Feedback Control Definition Language - Illustration

access_log

21

Generality

Visibility

Reusability

utilController: UtilizationController

requestCounter: Accumulator

responseSizeCounter: Accumulator

scheduler: PeriodTrigger

loadMonitor: LoadMonitor

in input

out sum out sum

in requests in size

out utilization

in input

out output

in utilization

out contentTreeinitialPeriod=10s

adaptor: ContentAdaptor

in contentTree

accessLog: FileTailer

in lines

out lines

file=/var/log/apache2/access_log

out sizeout requests

accessLogParser: AccessLogParser

k=?U*=?

3. Compute severity of adaptation (G)

Page 36: PhD Thesis Defense

Feedback Control Definition Language - Illustration

22

composite ApacheQOS {

feature accessLog = new FileTailer { file = “/var/log/apache2/access_log” }

feature accessLogParser = new AccessLogParser feature requestCounter = new Accumulator feature responseSizeCounter = new Accumulator feature loadMonitor = new LoadMonitor feature scheduler = new PeriodTrigger<Double> feature utilController = new UtilizationController feature adaptor = new ContentAdaptor

connect accessLog.lines to accessLogParser.lines connect accessLogParser.size to responseSizeCounter.input connect accessLogParser.requests to requestsCounter.input connect requestCounter.output to loadMonitor.requests connect responseSizeCounter.output to loadMonitor.size connect loadMonitor.utilization to scheduler.input connect scheduler.output to utilController.utilization connect utilController.contentTree to adaptor.contentTree }

Complete model of the first prototype

Generality Visibility Reusability

ApacheQOSutilController

: UtilizationController

in input

requestCounter: Accumulator

responseSizeCounter: Accumulator

scheduler: PeriodTrigger

loadMonitor: LoadMonitor

in input

out sum out sum

in requests in size

out utilization

in input

out output

in utilization

out contentTree

syst

em

laye

rco

ntro

l la

yer

initialPeriod=10s

adaptor: ContentAdaptor

in contentTree

accessLog: FileTailer

in lines

out lines

file=/var/log/apache2/access_log

out sizeout requests

accessLogParser: AccessLogParser

k=?U*=?

Page 37: PhD Thesis Defense

Feedback Control Definition Language - Composition

23

ApacheQOS utilController: UtilizationController

in input

requestCounter: Accumulator

responseSizeCounter: Accumulator

scheduler: PeriodTrigger

loadMonitor: LoadMonitor

in input

out sum out sum

in requests in size

out utilization

in input

out output

in utilization

out contentTree

out requests

out size

syst

em

laye

rco

ntro

l la

yer

composite name

initialPeriod=10s

adaptor: ContentAdaptor

out

size

in contentTree

out size

out

requ

ests out requests in contentTree

port promotion

in contentTree

ApacheWebServer

server: ApacheWebServer

accessLog: FileTailer

accessLogParser: AccessLogParser

in lines

out lines

file=/var/log/apache2/access_log

k=?U*=?

composite ApacheWebServer {

property accessLogFile: String! feature accessLog = new FileTailer { file = accessLogFile }

feature accessLogParser = new AccessLogParser feature adaptor = new ContentAdaptor! connect accessLog.lines to accessLogParser.lines

promote accessLogParser.size promote accessLogParser.requests promote adaptor.contentTree!

}

Hierarchical organization of Adaptive Elements using composites

Generality Visibility Reusability

Page 38: PhD Thesis Defense

ApacheQOS

control: QOSControl

in contentTree

apache: ApacheWebServer

in requests

in size

out requests

out size

out contentTree

cont

rol

laye

rsy

stem

la

yer

QOSControl

utilController: UtilizationController

utilization: UtilizationMonitor

out contentTree

scheduler: PeriodTrigger

out utilizationin input out output

in utilization

out contentTreein requests in size

in requests in size

Feedback Control Definition Language - Composition

24

Generality

Visibility

Reusability

LighttpdQOS

control: QOSControl

in contentTree

lighttpd: LighttpdWebServer

in requests

in size

out requests

out size

out contentTree

cont

rol

laye

rsy

stem

la

yer

QOSControl

utilController: UtilizationController

utilization: UtilizationMonitor

out contentTree

scheduler: PeriodTrigger

out utilizationin input out output

in utilization

out contentTreein requests in size

in requests in size

Page 39: PhD Thesis Defense

Feedback Control Definition Language - Distribution

remote-main remote-apache

network

ApacheQOS

in contentTree

in requests

in size

out requests

out size

out contentTree

Apache.apacheendpoint= akka.tcp://actress@remote-apache/user/Apache/apache

referenced feature

Apache

in contentTree

in requests

in size

out requests

out size

out contentTree

ApacheQOS.control

endpoint=akka.tcp://actress@remote-main/user/ApacheQOS/control

apache: ApacheWebServer

control: QOSControl

composite feature

25

// deployed at remote-apachecomposite Apache { feature apache = new ApacheWebServer { ... } feature control = ref ApacheQOS.control @ "akka://remote-main/user/ApacheQOS/control"}

// deployed at host remote-maincomposite ApacheQOS { feature control = new QOSControl { ... } feature apache = ref Apache.apache @ "akka://remote-apache/user/Apache/apache" // ...}

Remote Distribution of Adaptive ElementsDistribution

Visibility

Page 40: PhD Thesis Defense

Feedback Control Definition Language - Reflection

26

ApacheQOS

cont

rol

laye

r

sysLoad: SystemLoad

met

a-co

ntro

l la

yer

periodController: PeriodController

out output

in load out period

syst

em

laye

r

sysLoadTrigger: PeriodTrigger

in input

out output

in contentTree

apache: ApacheWebServer

in requests

in size

out requests

out size

out contentTreeQOSControl

scheduler: PeriodTrigger

in input out output

setPeriod

provided in setPeriod

... ...

provided effectorpromotion

provided in setPeriod

control: QOSControl

Adaptive Element Reflection

active processor PeriodicTrigger<T> { pull in port input: T push out port output: T

provided effector setPeriod: Long

property initialPeriod = 10.seconds}

composite QOSControl { // ... promote scheduler.setPeriod // ...}

Visibility

Complexcontrol

Page 41: PhD Thesis Defense

Feedback Control Definition Language - Reflection

27

Adaptive Monitoring Pattern

ApacheQOS

cont

rol

laye

r

sysLoad: SystemLoad

met

a-co

ntro

l la

yer

out output

in load out period

syst

em

laye

r

in contentTree

apache: ApacheWebServer

in requests

in size

out requests

out size

out contentTreeQOSControl

scheduler: PeriodTrigger

in input out output

setPeriod

provided in setPeriod

... ...

provided effectorpromotion

provided in setPeriod

control: QOSControl

periodControl: AdaptiveMonitoring

Reusability

Visibility

Complexcontrol

Page 42: PhD Thesis Defense

Feedback Control Definition Language - Interaction Contracts

28

in input

: Accumulator

out sum

• Activated on input push request• Activated on sum pull request

Page 43: PhD Thesis Defense

in input

: Accumulator

out sumin reset

out output

Feedback Control Definition Language - Interaction Contracts

29

• Activated on input push request• Activated on reset push request• Activated on input / reset request• Activated on sum pull request• Activated on input push request always pushing data on output• Activated on reset push request always pushing data on output• ....

Page 44: PhD Thesis Defense

in input

: Accumulator

out sumin reset

out output

Feedback Control Definition Language - Interaction Contracts

30

• Behavior not explicitly stated in the architecture - Black Box• Limits verification support• Limits code-generation support

When it receives data on its input port, it pushes to its output port the input value plus the sum of all the input values it has received since the last time the reset port was triggered, similarly, when pulled on the sum port, it returns the sum of all the input values since the last reset, and finally receiving any data on its reset port, sets the current accumulated value back to 0.

if (!input.isEmpty()) { value += input.get output.send(value) } else if (!reset.isEmpty()) { reset.get() value = 0 } else if (!sum.isEmpty()) { sum.send(value) } else { throw new IllegalStateException("Invalid execution") }

Page 45: PhD Thesis Defense

in input

: Accumulator

out sumin reset

out output

Feedback Control Definition Language - Interaction Contracts

31

Interaction ContractsDescribe allowed interactions among components

Visibility

processor Accumulator { push in port reset: int push in port input: long pull out port sum: long push out port output: long

act onInput(input; ; output) act onSum(sum; ; ) act onReset(reset; ; )}

Page 46: PhD Thesis Defense

in input

: Accumulator

out sumin reset

out output

Feedback Control Definition Language - Interaction Contracts

31

Interaction ContractsDescribe allowed interactions among components

Visibility

• Our extensions• Elements with multiple output ports• Multiple port connections• Composites• Composite interaction contract inference algorithm • Optional contracts• Completion verification algorithm

Originally developed by Cassou et al. for SCC systems

processor Accumulator { push in port reset: int push in port input: long pull out port sum: long push out port output: long

act onInput(input; ; output) act onSum(sum; ; ) act onReset(reset; ; )}

Page 47: PhD Thesis Defense

Plan

32

1. Feedback Control Definition Language

2. The ACTRESS Modeling Environment

3. The Sigma Model Manipulation Languages

4. Conclusions and Perspectives

Page 48: PhD Thesis Defense

ACTRESS Overview

33

The ACTRESS Modeling Environment

Modeling

VerificationCode Generation

Tooling

• Reference implementation of FCDL based on Eclipse Modeling Framework• Facilitate the use of FCDL

Page 49: PhD Thesis Defense

ACTRESS - Modeling Support

34

controller UtilizationController { // ...

// interaction contract act activate(utilization; ; contentTree) // beginning of Xbase implementation implementation xbase { var G = M

// interaction contract act activate { // computes the error val E = targetUtilization - utilization // computes new extend of adaptation G = G + k * E

// correct bounds if (G < 0) G = 0 if (G > M) G = M // returns the result G }}

• Textual DSL for authoring FCDL models• Additionally supports

• Modularity• Java interoperability• Implementation specification using Xbase

• Eclipse IDE support

xFCDL (Extended FCDL)

utilController: UtilizationController

in utilization

out contentTree

k=?U*=?

Page 50: PhD Thesis Defense

ACTRESS - Code Generation Support

35

accessLogParser accessLog adaptor

apache control

requestCounter

responseSizeCounter

loadMonitor

utilization

scheduler utilController

ApacheQOS

ACTRESS Runtime

actor

actor with event listener

compositeactor

containment

messagepassing

ApacheQOS utilController: UtilizationController

in input

requestCounter: Accumulator

responseSizeCounter: Accumulator

scheduler: PeriodTrigger

loadMonitor: LoadMonitor

in input

out sum out sum

in requests in size

out utilization

in input

out output

in utilization

out contentTree

out requests

out size

initialPeriod=10s

in contentTree

server: ApacheWebServer

k=?U*=?

Code generator

Model-to-Texttransformation

ACTRESS Domain

Framework

FCDL Model

Executable System

Xbase compiled to JavaSkeleton implementation

Page 51: PhD Thesis Defense

ACTRESS - Code Generation Support

36

@SuppressWarnings("all")public class UtilizationControllerAct extends AdaptiveElementAct {

// ...

protected double activate(final double utilization) { // TODO: compute and output value for contentTree port }

// ...

}

utilController: UtilizationController

in utilization

out contentTree

k=?U*=?

Skeleton Implementation

PrescriptiveDescriptive

Visibility

Page 52: PhD Thesis Defense

ACTRESS - Verification Support

37

FCDL Verification

Page 53: PhD Thesis Defense

ACTRESS - Verification Support

37

FCDL Verification

Model Well-Formedness

• Data-type compatibility• Port connections• Required properties• and others

meta-model constraints(SIGMA)

Page 54: PhD Thesis Defense

ACTRESS - Verification Support

37

FCDL Verification

Model Well-Formedness

• Data-type compatibility• Port connections• Required properties• and others

meta-model constraints(SIGMA)

Architecture

interaction contracts verification

(SIGMA)

• Consistency• Determinacy• Completeness

Page 55: PhD Thesis Defense

ACTRESS - Verification Support

37

FCDL Verification

Model Well-Formedness

• Data-type compatibility• Port connections• Required properties• and others

meta-model constraints(SIGMA)

Architecture

interaction contracts verification

(SIGMA)

• Consistency• Determinacy• Completeness

@OCL(invDifferentSource="self.ports->select(p | p.name = 'size' || p.name = 'requests') // select ports ->collect(p | p.connections) // select their connects->collect(p | p.parent) // select owning instances->asSet()->size() == 2 // there must be two different ones")processor LoadMonitor {

User Structural Constraints

xFCDL OCL Annotations

Page 56: PhD Thesis Defense

ACTRESS - Verification Support

37

FCDL Verification

Model Well-Formedness

• Data-type compatibility• Port connections• Required properties• and others

meta-model constraints(SIGMA)

Architecture

interaction contracts verification

(SIGMA)

• Consistency• Determinacy• Completeness

XWLO&RQWUROOHU

! ( DFFHVV/RJ3DUVHUactivate ! (" XWLO&RQWUROOHUactivate))

DFFHVV/RJ3DUVHUactivate XWLO&RQWUROOHUactivateDFFHVV/RJ3DUVHU XWLO&RQWUROOHU

DFWLYDWH (!)

DFFHVV/RJ3DUVHU DFWLYDWH XWLO&RQWUROOHUDFWLYDWH (")

DFFHVV/RJ3DUVHU $FFHVV/RJ3DUVHU" # (OLQHV); $; # (UHTXHVWV, VL]H) %�� DFW DFWLYDWH�OLQHV� � VL]H� UHTXHVWV��GHILQH DFFHVV/RJ3DUVHUBDFWLYDWH �DFFHVV/RJ3DUVHU#DFWBDFWLYDWH�

�� SRUWVFKDQ DFFHVV/RJ3DUVHUBSRUWBOLQHV >�@ RI ^ PW\SH `�FKDQ DFFHVV/RJ3DUVHUBSRUWBVL]H >�@ RI ^ PW\SH `�FKDQ DFFHVV/RJ3DUVHUBSRUWBUHTXHVWV >�@ RI ^ PW\SH `�

DFWLYH SURFW\SH DFFHVV/RJ3DUVHU�� ^�� ZKLFK LQWHUDFWLRQ KDV EHHQ H[HFXWHGE\WH DFW ��

�� LQILQLWH SURFHVV�

�� IRU DFWLYDWLRQ�

LI�� DFW DFWLYDWH�OLQHV� � VL]H� UHTXHVWV�

�� DFFHVV/RJ3DUVHUBSRUWBOLQHV " 386+ �! DFW ��IL�

User Temporal Constraints

FCDL to PROMELAtransformation

SPIN model checker

@OCL(invDifferentSource="self.ports->select(p | p.name = 'size' || p.name = 'requests') // select ports ->collect(p | p.connections) // select their connects->collect(p | p.parent) // select owning instances->asSet()->size() == 2 // there must be two different ones")processor LoadMonitor {

User Structural Constraints

xFCDL OCL Annotations

Page 57: PhD Thesis Defense

ACTRESS Evaluation

38

HTCondor Client Host

schedd

DAGMan 1

DAGMan 2

DAGMan N

User Interface

Submitworkflows

...

Executes

HTCondor clusterof worker nodes

Users

Spawns

Submit jobs

Case Study 1

Page 58: PhD Thesis Defense

ACTRESS Evaluation

38

HTCondor Client Host

schedd

DAGMan 1

DAGMan 2

DAGMan N

User Interface

Submitworkflows

...

Executes

HTCondor clusterof worker nodes

Users

Spawns

Submit jobs

Case Study 1

User Interface 1

User Interface 2

User Interface N

Executes

HTCondor clusterof worker nodes

Users

Users

Users

Submit

workflows

Submit jobs

...Central schedd

Case Study 2

Page 59: PhD Thesis Defense

FCDL / ACTRESS Evaluation

39

Generality Visibility

Reusability• Reused elements across scenarios

• Explicit FCLs• Explicit AE • Explicit AE interactions

• Potentially any self-* property• FCDL is technology agnostic• xFCDL with Xbase depends on Java• ACTRESS runtime depends on Java

Page 60: PhD Thesis Defense

FCDL / ACTRESS Evaluation

39

Generality Visibility

Reusability• Reused elements across scenarios

• Explicit FCLs• Explicit AE • Explicit AE interactions

• Potentially any self-* property• FCDL is technology agnostic• xFCDL with Xbase depends on Java• ACTRESS runtime depends on Java

UHPRWH6WDWV &HQWUDO6WDWVFHQWUDO6WDWV

N! = 1000, Nc = 5000, p = 5, !0 = 10

/RDG&RQWUROOHU

1

2

1 2

/RFDO&RQWURO

KWWS���ZZZZ�JULG�����IU

Reuse

Page 61: PhD Thesis Defense

FCDL / ACTRESS Evaluation

39

Generality Visibility

Reusability• Reused elements across scenarios

• Explicit FCLs• Explicit AE • Explicit AE interactions

• Potentially any self-* property• FCDL is technology agnostic• xFCDL with Xbase depends on Java• ACTRESS runtime depends on Java

Distribution

Complex control

• Case Study 2 deployed on 10 Grid5000 hosts

• All case studies use hierarchical control • Eclipse based modeling environment

Tooling

UHPRWH6WDWV &HQWUDO6WDWVFHQWUDO6WDWV

N! = 1000, Nc = 5000, p = 5, !0 = 10

/RDG&RQWUROOHU

1

2

1 2

/RFDO&RQWURO

KWWS���ZZZZ�JULG�����IU

Reuse

Page 62: PhD Thesis Defense

FCDL / ACTRESS Evaluation

40

Generality Visibility

Reusability Distribution

Complex control

• Reused elements across scenarios

• All case studies use hierarchical control

• Potentially any self-* property• FCDL is technology agnostic• xFCDL with Xbase depends on Java• ACTRESS runtime depends on Java

UHPRWH6WDWV &HQWUDO6WDWVFHQWUDO6WDWV

N! = 1000, Nc = 5000, p = 5, !0 = 10

/RDG&RQWUROOHU

1

2

1 2

/RFDO&RQWURO

KWWS���ZZZZ�JULG�����IU

Overall implementation effort

• Eclipse based modeling environment

Tooling

• Explicit FCLs• Explicit AE • Explicit AE interactions

• Case Study 2 deployed on 10 Grid5000 hosts

Page 63: PhD Thesis Defense

FCDL / ACTRESS Evaluation

41

Generality Visibility

Reusability Distribution

Complex control

• Reused elements across scenarios

• All case studies use hierarchical control

• Potentially any self-* property• FCDL is technology agnostic• xFCDL with Xbase depends on Java• ACTRESS runtime depends on Java

UHPRWH6WDWV &HQWUDO6WDWVFHQWUDO6WDWV

N! = 1000, Nc = 5000, p = 5, !0 = 10

/RDG&RQWUROOHU

1

2

1 2

/RFDO&RQWURO

KWWS���ZZZZ�JULG�����IU

Overall implementation effort

• Eclipse based modeling environment

Tooling

Separation of concerns

• Case Study 2 deployed on 10 Grid5000 hosts

• Explicit FCLs• Explicit AE • Explicit AE interactions

Page 64: PhD Thesis Defense

Plan

42

1. Feedback Control Definition Language

2. The ACTRESS Modeling Environment

3. The Sigma Model Manipulation Languages

4. Conclusions and Perspectives

Page 65: PhD Thesis Defense

SIGMA

43

Eclipse Modeling Framework (EMF)

ACTRESS Modeling Environment

Model Manipulation

Model Consistency Checking

Model Transformations

Page 66: PhD Thesis Defense

SIGMA

43

Eclipse Modeling Framework (EMF)

ACTRESS Modeling Environment

Model Manipulation

Model Consistency Checking

Model Transformations

GPL• Low level of abstraction• Limited expressiveness• Accidental complexities

Page 67: PhD Thesis Defense

SIGMA

43

Eclipse Modeling Framework (EMF)

ACTRESS Modeling Environment

Model Manipulation

Model Consistency Checking

Model Transformations

GPL• Low level of abstraction• Limited expressiveness• Accidental complexities

• Limited tool support• Limited versatility• Limited interoperability• Limited testability• Accidental complexities

External DSLs

Page 68: PhD Thesis Defense

SIGMA

43

Eclipse Modeling Framework (EMF)

ACTRESS Modeling Environment

Model Manipulation

Model Consistency Checking

Model Transformations

GPL• Low level of abstraction• Limited expressiveness• Accidental complexities

• Limited tool support• Limited versatility• Limited interoperability• Limited testability• Accidental complexities

External DSLs

• Internal DSLs in Scala for model manipulation• Embeds domain-specific constructs into a GPL• Small API• Efficient• Directly reuse the host language infrastructure

Internal DSLs

SIGMA

Lightweight approach

Page 69: PhD Thesis Defense

SIGMA

Quick Example

Check that all instances within a composite have unique names

Page 70: PhD Thesis Defense

SIGMA

Quick Example

Check that all instances within a composite have unique names

invariant UniqueNamesWithinType: parent.allFeatures->forAll(e | e <> self implies e.name <> self.name);

OCL

Page 71: PhD Thesis Defense

SIGMA

Quick Example

Check that all instances within a composite have unique names

invariant UniqueNamesWithinType: parent.allFeatures->forAll(e | e <> self implies e.name <> self.name);

OCL

def invUniqueNamesWithinType = self.parent.allFeatures forall (e => e != self implies e.name != self.name)

SIGMA

Page 72: PhD Thesis Defense

SIGMA

Quick Example

Check that all instances within a composite have unique names

• Similar expressiveness• Easy to edit• Easy to test

• Easy to debug• Easy to integrate into model

manipulation workflow

invariant UniqueNamesWithinType: parent.allFeatures->forAll(e | e <> self implies e.name <> self.name);

OCL

def invUniqueNamesWithinType = self.parent.allFeatures forall (e => e != self implies e.name != self.name)

SIGMA

Page 73: PhD Thesis Defense

SIGMA

Quick Example

Check that all instances within a composite have unique names

• Similar expressiveness• Easy to edit• Easy to test

• Easy to debug• Easy to integrate into model

manipulation workflow

def invUniqueNamesWithinType = self.parent.allFeatures find (e => e != self && e.name == self.name) match { case None => Passed case Some(e) => Error(s”Element $e has the name”) .quickFix(“Rename ‘${self.name}’ to ‘${self.name}’_2”) { self.name += “_2” } }

• Different levels of severity• User feedback

• Inconsistency repair• and more

invariant UniqueNamesWithinType: parent.allFeatures->forAll(e | e <> self implies e.name <> self.name);

OCL

def invUniqueNamesWithinType = self.parent.allFeatures forall (e => e != self implies e.name != self.name)

SIGMA

Page 74: PhD Thesis Defense

SIGMA

45

Architecture

SIGMA

Eclipse Modeling Framework (EMF)

Scala

SIGMA EMF bridge

Model Navigation

Model-to-Model Transformation

Model Consistency Checking

Model Modification

Model-to-Text Transformation

CommonInfrastructure

Task-specificDSLs

ANR EMERGENCEANR-09-SEGI-012

Requirements

• Tool support

• Expressiveness

• Usability

• Testability

Page 75: PhD Thesis Defense

Plan

46

1. Feedback Control Definition Language

2. The ACTRESS Modeling Environment

3. The Sigma Model Manipulation Languages

4. Conclusions and Perspectives

Page 76: PhD Thesis Defense

Summary

• Combining self-adaptive software systems with principles of MDE to provide systematic and tooled approach for integrating control mechanisms into software applications.

• Design of a domain-specific modeling language for defining complex feedback control loop architectures on a flexible, high level of abstraction.

• A reference implementation and tools facilitating the language use including modeling, code synthesis and verification support.

• A family of internal DSLs in Scala for lightweight model manipulations including model consistency checking, model transformations.

47

Page 77: PhD Thesis Defense

Summary

• Combining self-adaptive software systems with principles of MDE to provide systematic and tooled approach for integrating control mechanisms into software applications.

• Design of a domain-specific modeling language for defining complex feedback control loop architectures on a flexible, high level of abstraction.

• A reference implementation and tools facilitating the language use including modeling, code synthesis and verification support.

• A family of internal DSLs in Scala for lightweight model manipulations including model consistency checking, model transformations.

47

• Materialized in 2 software stacks• The ACTRESS Modeling Environment

http://fikovnik.github.io/Actress• The SIGMA Model Manipulation DSLs

http://fikovnik.github.io/Sigma

Page 78: PhD Thesis Defense

Perspectives

• On Self-Adaptive Software Systems• Towards Higher-Level Abstractions

• Towards [email protected]

• Towards DSL composition

• On Model Manipulations• Towards deep DSL embedding

• Towards domain-specific optimization and error checking

• Taming the leaking abstraction of internal DSLs

48

Further Research Directions

• Improvements in both ACTRESS and SIGMA implementations• Extend the validation on more use cases, gather more experience

Short-term further work

Page 79: PhD Thesis Defense

Merci!

• P. Collet, F. Křikava, J. Montagnat, M. Blay-Fornarino, D. Manset. Issues and Scenarios for Self-Managing Grid Middleware, Workshop on Grids meets autonomic computing (GMAC '10), 2010

• F. Křikava, P. Collet, M. Blay-Fornarino. Uniform and Model-Driven Engineering of Feedback Control Systems, International Conference on Autonomic Computing (ICAC'11), 2011 short paper

• F. Křikava, P. Collet. A Reflective Model for Architecting Feedback Control Systems, International Conference on Software Engineering and Knowledge Engineering (SEKE'11), 2011

• F. Křikava, P. Collet. On the Use of an Internal DSL for Enriching EMF Models, Workshop on OCL and Textual Modelling (OCL'12), 2012

• F. Křikava, P. Collet, R. France. Actor-based Runtime Model of Adaptable Feedback Control Loops, Workshop on [email protected] (MRT'12), 2012

• F. Křikava, P. Collet, R. France. ACTRESS: Domain-Specific Modeling of Self-Adaptive Software Architectures, International Conference on Dependable and Adaptive Distributed Systems, SAC’14 (to appear)

• F. Křikava, P. Collet, R. France. Exploring Internal Domain-Specific Languages for Model Manipulations, International Conference on Programing Languages, SAC’14, short paper (to appear)

49

• EclipseCon Europe 2012 Modeling Symposium − Enriching EMF Models with Scala, Ludwigsburg, Germany• Scala Workshop 2013 − Model Manipulation Using Embedded DSLs in Scala, Montpellier, France

SIGMA model manipulation DSLs have been also presented at: