s
Technology for a better society
A comparison of two-level
and multi-level modelling
for cloud-based applications
Alessandro Rossini
Nikolay Nikolov
Juan de Lara
Esther Guerra
s
Technology for a better society
s
Technology for a better society
22 Feb 2014
1.8
million
users
register to Telegram
…
s
Technology for a better society
Self-adaptive cloud-based applications
Cloud-based applications that self-adapt to
changes in environment and requirements
s
Technology for a better society
Cloud-based applications
Virtualisa)on
Servers
Storage
Network
IaaS
Run-‐)me
OS
PaaS
Applica)ons
Data
SaaS
s
Technology for a better society
Models@run-time
Reasoning engine
Models
@run-‐-me
Target
model
Diff
Adapta0on
engine
Current
model
Running system
s
Technology for a better society
Deployment model:
design-time
[loca)on: NO]
haProxy1
sensApp1
[instances range: 1..4]tomcat1
ubuntu1
Types
HAProxy
SensApp
Tomcat
Ubuntu
s
Technology for a better society
Deployment model:
run-time
[instances range: 1..4, instances=3]OpenStack
[loca)on: NO]
OpenStack
[loca)on: NO]haProxy1
sensApp1
[instances range: 1..4, instances=2]tomcat1
ubuntu1
haProxy1
sensApp1
tomcat1
ubuntu1
OpenStack
[loca)on: NO]
OpenStack
[loca)on: NO]haProxy1
sensApp11
tomcat11
ubuntu11
[CPU load = 99]sensApp12
tomcat12
ubuntu12
[CPU load = 90]haProxy1
sensApp11
tomcat11
ubuntu11
[CPU load = 80]sensApp12
tomcat12
ubuntu12
[CPU load = 70]sensApp13
tomcat13
ubuntu13
[CPU load = 60]Before adapta)on AXer adapta)on
Before adapta)on
AXer adapta)on
Implicit instances
Explicit instances
If CPU load of a VM is above 90%, then scale out
Types
HAProxy
SensApp
Tomcat
Ubuntu
s
Technology for a better society
CloudML abstract syntax:
two levels
s
Technology for a better society
model
metamodel
CompType
hostedCompType
*
type
CompInst
currentInst: Int minInst: Int maxInst: InthostedCompInst
*
VMType
type
VMInst
cpuLoadAvg: DoubleSensApp
ontological
typing
sensApp1
currentInst = 2 minInst = 1 maxInst = 4
st1
currentInst = 2tomcat1
minInst = 1 maxInst = 4tu1
ubuntu1
currentInst = 2 minInst = 1 maxInst = 4 cpuLoadAvg = 94.5ST
Tomcat
TU
Ubuntu
linguis1c
typing
C1: self.hostedCompType-‐>forAll(t | CompInst.allInstances()-‐>exists(i | i.type = self andi.hostedCompInst-‐>exists(ci | ci.type = t))) C2: self.currentInst >= self.minInst C3: self.maxInst <> -‐1 implies self.currentInst <= self.maxInst C4: self.hostedCompInst-‐>forAll(i | self.type.hostedCompType -‐>includes(i.type))
Deployment model:
implicit instances
OpenStack*[loca.on:*NO]* haProxy1* sensApp1*[instances range: 1..4,
instances=2]
tomcat1* ubuntu1*
s
Technology for a better society
model
metamodel
CompType
hostedCompType
*
type
CompInst
hostedCompInst
*
VMType
/cpuLoadAvg: Double = let loads:Set = VMInst.allInstances()-‐>select(m | m.type=self) -‐>collect(cpuLoad) in loads-‐>sum() / loads-‐>size()type
VMInst
cpuLoad: IntSensApp
sensApp12
st1
tomcat12
tu1
ubuntu12
cpuLoad = 90ST
Tomcat
TU
Ubuntu
/cpuLoadAvg = 94.5 C5: self.hostedCompType-‐>forAll(t | CompInst.allInstances()-‐>exists(i | i.type = self andi.hostedCompInst-‐>exists(ci | ci.type = t))) C6: self.hostedCompInst-‐>forAll(i | self.type.hostedCompType -‐>includes(i.type))
Deployment model:
explicit instances
OpenStack*[loca.on:*NO]* haProxy1* sensApp11* tomcat11* ubuntu11* [CPU load = 99] sensApp12* tomcat12* ubuntu12* [CPU load = 90]
s
Technology for a better society
Deployment model:
implicit
and
explicit inst.
model
metamodel
CompType
hostedCompType * typeCompTemp
currentInst:3Int minInst:3Int maxInst:3Int hostedCompTemp *VMType
typeVMTemp
/cpuLoadAvg:3Double3=3…SensApp
ontologicaltypingsensApp1
currentInst =32 minInst =31 maxInst =34 st1
tomcat1
currentInst =32 minInst =31 maxInst =34 tu1ubuntu1
currentInst =32 minInst =31 maxInst =34 /cpuLoadAvg =394.5 STTomcat
TUUbuntu
linguistic typing typeCompInst
hostedCompInst * typeVMInst
cpuLoad:3Int sensApp12 st12tomcat12
tu12ubuntu12
cpuLoad =390 C1 C2,% C3,"C4,% C5 C6 OpenStack* [loca.on:*NO]* haProxy1* sensApp1*[instances range: 1..4,instances=2] tomcat1* ubuntu1* OpenStack* [loca.on:*NO]* haProxy1* sensApp11* tomcat11* ubuntu11* [CPU load = 99] sensApp12* tomcat12* ubuntu12* [CPU load = 90]
s
Technology for a better society
CloudML abstract syntax:
multiple levels
s
Technology for a better society
@3
@2
@1
@0
Language
definition
Component
types definition
Deployment
model:
implicit inst.
Deployment
model:
explicit inst.
Component
/currentInst@2: int = $ self.allInstances().size() $
*
hostedComp
VirtualMachine
cpuLoad@3: int
/cpuLoadAvg@2: double =
$ self.allInstances()-‐>collect(cpuLoad )-‐>sum()/self.currentInst $
SensApp: Component *
Tomcat: Component
*
Ubuntu: VirtualMachine
sensApp1:
SensApp [1..4]
/currentInst = 2
1..1
tomcat1:
Tomcat [1..*]
/currentInst = 2
1..4
ubuntu1: Ubuntu [1..*]
/cpuLoadAvg = 94.5
/currentInst = 2
sensApp11: sensApp1
tomcat11: tomcat1
ubuntu11: ubuntu1
cpuLoad = 99
sensApp12: sensApp1
tomcat12: tomcat1
ubuntu12: ubuntu1
s
Technology for a better society
s
Technology for a better society
Criteria
•
Size of language definition
•
Complexity of OCL constraints
•
Precision
•
Extensibility
•
Flexibility
s
Technology for a better society
Size of language definition
@3
Language
definition:
Multi-level
Component
/currentInst@2: int = $ self.allInstances().size() $
*
hostedComp
VirtualMachine
cpuLoad@3: int
/cpuLoadAvg@2: double =
$ self.allInstances()-‐>collect(cpuLoad )-‐>sum()/self.currentInst $
Language
definition:
Two-level
CompType( hostedCompType * type CompTemp( currentInst: Int minInst: Int maxInst: Int hostedCompTemp * VMType( type VMTemp( /cpuLoadAvg: Double = … type CompInst( hostedCompInst * type VMInst( cpuLoad: Int C1! C2,%C3,!C4,%C5% C6%s
Technology for a better society
s
Technology for a better society
CloudML two-level tooling
s
Technology for a better society
CloudML multi-level tooling
22
MetaDepth
s
Technology for a better society
MetaDepth
•
Potency-based multi-level modelling
•
Textual modelling
•
Integration with Epsilon languages (adapted to
multi-level):
–
Epsilon Object Language
–
Epsilon Transformation Language
–
Epsilon Generation Language
•
Analysis of conflicts between integrity constraints at
s
Technology for a better society
CloudML in MetaDepth
// Level 3: Language definition
Model CloudML@3 { Node Component {
hostedComp: Component[*];
/currentInst@2: int = $ self.allInstances().size() $; }
Node VirtualMachine: Component { cpuLoad@3: int;
/cpuLoadAvg@2: double = $ self.allInstances().collect ( c | c.cpuLoad ).sum() / self.currentInst $ ;
} }
// Level 2: Component types definition
CloudML ComponentTypes { Component Tomcat { tomcatHosts: SensApp[*]{hostedComp}; } Component SensApp {} VirtualMachine Ubuntu { ubuntuHosts: Tomcat[*]{hostedComp}; } }
s
Technology for a better society
CloudML in MetaDepth
// Level 1: Deployment model with implicit instances
ComponentTypes DeploymentModel { SensApp sensApp1 [1..4] {} Tomcat tomcat1 [1..*] {
t1Hosts: sensApp1[1] {tomcatHosts}; }
Ubuntu ubuntu1 [1..*] {
u1Hosts: tomcat1[1..4] {ubuntuHosts}; }
}
// Level 0: Deployment model with explicit instances
DeploymentModel instances { sensApp1 sensApp11;
sensApp1 sensApp12;
tomcat1 tomcat11 { t1Hosts = [sensApp11]; } tomcat1 tomcat12 { t1Hosts = [sensApp12]; }
ubuntu1 ubuntu11 { cpuLoad = 99; u1Hosts = [tomcat11]; } ubuntu1 ubuntu12 { cpuLoad = 90; u1Hosts = [tomcat12]; } }