s-cube lp: dynamic adaptation: dynamic adaptation with the chemical model

35
www.s-cube-network.eu S-Cube Learning Package Dynamic Adaptation: Dynamic Adaptation with the Chemical Model CNR, SZTAKI, INRIA Claudia Di Napoli, CNR Maurizio Giordano, CNR

Upload: virtual-campus

Post on 18-Nov-2014

577 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

www.s-cube-network.eu

S-Cube Learning Package

Dynamic Adaptation:

Dynamic Adaptation with the Chemical Model

CNR, SZTAKI, INRIA

Claudia Di Napoli, CNR

Maurizio Giordano, CNR

Page 2: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Learning Package Categorization

S-Cube

Self-* Service Infrastructure

and Service Discovery Support

Infrastructure Mechanisms for the Run-Time Adaptation of Services

Dynamic Adaptation with the

Chemical Model

Page 3: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Learning Package Overview

Motivation

Problem Description

Goal

Background

Approach

Prototype

Conclusions

Page 4: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Motivation

Service Based Applications (SBAs) are realized composing

third-party services accessible through Internet and as such

they are managed and operated in a completely

decentralized way

Users will require SBAs with end-to-end quality requirements

and third-party service providers will provide services with

quality attributes

Service Based Applications are very likely to be provided

according to market-oriented approaches that regulate the

demand and supply of services

Page 5: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Motivation

Both user requirements and service quality attributes may

change in time due to the dynamic nature of service-based

environments:

– users may decide to change their requirements according to some

marketing strategies,

– service providers may decide to change the values of the quality

attributes they provide services with according to market trends,

– more service providers providing the same service but with different

quality attributes may be available

Therefore mechanisms to support this dynamicity (at the

infrastructure level of the S-Cube Conceptual Research

Framework) are necessary when selecting services

composing an SBA upon a user request

Page 6: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Learning Package Overview

Motivation

Problem Description

Goal

Background

Approach

Prototype

Conclusions

Page 7: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

1

6

3

4

2

9

5

7

10

11

8

Problem Description

Workflow: a set of activities to be executed

according to data/control-flow constraints

Page 8: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Workflow: a set of activities to be executed

according to data/control-flow constraints

WF service binding: a mapping

between WF activities and service

implementations with non-fun

values that fulfill some user requirements

– More Service Mappings (SMs) may be found:

a service can be provided by different

sources and with different non-fun values

Problem Description

1

6

3

4

2

9

5

7

10

11

8

Service offers

Page 9: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Workflow: a set of activities to be executed

according to data/control-flow constraints

WF service binding: a mapping

between WF activities and service

implementations with non-fun

values that fulfill some user requirements

– More service mappings (SM) may be found:

a service can be provided by different

sources and with different non-fun values

WF execution: a path from the

start to the end node of a specific SM

1

6

3

4

2

9

5

7

10

11

8

Problem Description

Page 10: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

To find a Service Mapping (SM), if any, starting from a Workflow, user requirements, and an initial set of service offers

A service “offer” is a service specification composed of:

– an endpoint to a software service

– a Quality Attribute, i.e. a value specifying a generic non-fun parameter of the service (price, delivery time ...) related to the user requirements

Currently supported workflows include:

– sequences

– split and merge (if-then-else, fork-join)

– no loops

Problem Description

1

6

3

4

2

9

5

7

10

11

8

Page 11: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Learning Package Overview

Motivation

Problem Description

Goal

Background

Approach

Prototype

Conclusions

Page 12: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Goal

To model the workflow service binding process as an evolving

and autonomic system so that:

– the process is distributed

- service compositions are local and not serial

– the process is incremental

- SMs are built by aggregating smaller mappings

– dynamicity is allowed

- changes in service availability is taken into account when the service binding takes

place

– adaptability is allowed

- new SMs may be found starting from previously computed partial results

Page 13: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Learning Package Overview

Motivation

Problem Description

Goal

Background

Approach

Prototype

Conclusions

Page 14: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Background: Nature Inspired Computing

Nature Inspired Computing is emerging as a way to reproduce such an autonomous (lifelike-based) behaviour in solving computing problems

Its characterizing features are:

– autonomy, entities are individuals that act independently

– distributed, entities with localized decision-making capabilities are distributed in a heterogeneous environment, and they interact to exchange information on each other or to affect the states of others

– emergent, entities collectively exhibit a complex behaviour not present or predefined in the behaviour of each single entity;

– adaptability, entities change behaviour in response to changes in the environment in which they operate;

– self-configuration, local interactions among entities determine the evolution of the system toward desired states according to self-aggregation mechanisms

Page 15: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Background: Nature Inspired Computing

Chemical Computing is a nature inspired (unconventional)

programming model where the computation is represented

by abstract molecules reacting in an abstract chemical

solution according to local interactions (chemical reactions)

The result of a program is represented by the molecules

present in the chemical solution when it reaches an inert

state, i.e. when no element in the solution can trigger any

reactions

– Data are (passive) molecules

– Operations are chemical reactions (active molecules)

- reactions are unpredictable, concurrent, distributed, governed by

local conditions and well-known general laws

Page 16: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Background: Chemical Computing

Gamma-calculus is a declarative, functional formalism giving

the formal definition of the chemical paradigm introduced in

1986 by Banâtre & Le Métayer (INRIA)

The Higher Order Chemical Language (HOCL) is an

implementation of the Gamma-calculus extended with

expressions, types, pairs, empty solutions and names.

For further details consult learning package: The Chemical

Computing Model and HOCL Programming

Page 17: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Background: Chemical Computing: an example

1

2

4

6

8

12

let max = replace x,y

by x

if x>y

multiset

active molecules

(operations)

passive molecules

(data)

Page 18: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Learning Package Overview

Motivation

Problem Description

Goal

Background

Approach

Prototype

Conclusions

Page 19: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Approach: The overall picture

Instantiation Container

Workflow Execution

chemical

reaction

User request

Services with QoS

Chemical System

Services Registries

We propose to model the

WF service binding process

as a chemical process

where service offers

(passive molecules) coming

from the Internet may enter

the chemical container

continuously; they react

according to chemical rules

(active molecules) allowing

for the formation of Service

Mappings incrementally.

Chemical rules implement

QoS-driven selection criteria

that act as local constraint

solvers

Page 20: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

1

6

3

4

2

9

5

7

10

11

8

Approach: Problem chemical formalization

Workflow of activities as a DAG

Graph nodes and edges are chemical

molecules:

Nodei = <id:si,,in:ni,out:mi,... >

Edgel = <from:si,,to:sj,type:edgetype,...>

– They are catalysts involved in reactions

but remain intact afterwards

– Graph nodes are ordered according to

the edge directions

<id:11, in:2, out:0>

<id:4, in:1, out:2>

<id:1, in:0, out:2>

<from:1, to:3>

<from:7, to:10>

Page 21: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Each WF graph node may have zero or more

associated offers represented by the

chemical elementary molecules:

Offerik = <ei

k:si, qos: cik, rlev:pi

k>

– ei is an endpoint to a software service

with a service description (interface) si

offered with a Quality Attribute ci and a

reactivity level pi

– They are removed from

the system after they

react

<e42:4, qos:9 , rlvl:0.3 >

Approach: Problem chemical formalization

<e91:9, qos:40 , rlvl:0.2 >

<e92:9, qos:32 , rlvl:0.1 >

<e41:4, qos:7, rlvl:0.2>

1

6

3

4

2

9

5

7

10

11

8

Page 22: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

A Partial Service Mapping (PSM) is defined as the

building block for the composition as:

– either a single node with an

associated offer (elementary PSM),

– or a mapping of a workflow connected

subgraph (fragment) with the following

conditions*:

1. The first node has no edges outgoing

to nodes outside the subgraph

2. The last node has no edges incoming

from nodes outside the subgraph

3. All other nodes of the subgraph have no

edges incoming from or outgoing to

nodes outside the subgraph

Approach: Problem chemical formalization

(*) the PSM definition correspond s to the basic-block defintion in

control flow analysis theory

1

6

3

4

2

9

5

7

10

11

8

Page 23: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Approach: Chemical service selection

The chainrule deals with sequences and it builds PSMs from

other (elementary) PSMs

– the two PSMs are concatenated to form a new PSM containing all nodes of the

component PSMs

– the trigger part of the rule (the if part) implements local selection criteria to be defined

according to the specific considered application and QoS types specified by the user

replace by if pli pjk > AND cli cjk >

sl

sk

PSM

selection strategy specification according

to inputs from JRA-2.2, 1.3, 1.2

sl

si

sj

sk

PSM

PSM

Page 24: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Approach: Chemical service selection

The splitrule deals with split and merge nodes and it builds a

new PSM:

– two PSMs molecules are the branches of a split/merge, and the other two PSMs are

molecules containing split/merge nodes as last/first nodes

– the trigger part of the rule (the if part) implements local selection criteria to be defined

according to the specific considered application and QoS types specified by the user

pik ... phj > AND

cik ... chj > replace by if

si

sk

sk

sj

sp

sq

sl

sm

PSM

PSM

PSM PSM

sl

sj

PSM

selection strategy specification according

to inputs from JRA-2.2,1.3,1.2

Page 25: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Approach: Chemical communication

The rcvoffer rule receives service offers from the network (via UDP protocol)

– Applies always communication container is never inert

– Evolution: as soon as new offers arrive the selection is triggered

again and again

The sndwf rule sends the instantiation results (if any) to the caller software module (or through the network)

– Applies only when results are available

replace by offer: offer: if

replace by result: result:

UDP

if

UDP

WF enactment

Page 26: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Approach: Chemical middleware for service binding

prerule

rcvoffer

Services with QoS

chairule

splitrule

Instantiator multiset

Container multiset

wfextract

sndwf

Instantiated Workflof

{“OFFER” } {“RESULT” }

The container multiset is a

communication layer. It is an

interface towards both

service providers located on

the network, and the

workflow enactment module.

The instantiator multiset

receives a workflow

description specifying both

the functionality of each

component of the required

SBA, and the dependence

constraints occurring among

the components, together

with a user QoS

requirements for the entire

application. It selects a

service for each workflow

activity according to the

available offers and the user

requirements. If an

instantiated workflow is

obtained, it is sent back to

the main thread.

Page 27: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Learning Package Overview

Motivation

Problem Description

Goal

Background

Approach

Prototype

Conclusions

Page 28: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Prototype: The -Scheme interpreter

To realize the chemical-based middleware for service binding, we developed a HOCL interpreter, named -Scheme, on top of (and integrated in) a Scheme programming environment (Racket) with:

– Interpreter mode

- fast chemical middleware prototyping and testing

– Modularization

- Chemical code embedded in scheme functions with local scope binding

– Fast & on-fly compilation support

- byte-code JIT generation during interpreter execution

– Distribution and Concurrency

- Multithread, multiprocessing.

– Communication support

- Standard network protocol support (UDP, HTTP; ….)

– Powerful programming control mechanism

- Continuation handling

Page 29: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Prototype: The -Scheme interpreter

An interaction session with the -Scheme interpreter:

The greatest prime number in a multiset

– For -Scheme documentation and tutorial visit: ...... (shortly available!)

Page 30: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Learning Package Overview

Motivation

Problem Description

Goal

Background

Approach

Prototype

Conclusions

Page 31: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Conclusions

Autonomous behaviour

– WF service binding is modeled as an autonomous and always

running chemical system decoupled from the execution stage

Distributed approach

– Service binding to service specifications (i.e. mapping service

description to “offers”) is concurrent and may be distributed

(no serial instantiation)

Adaptation

– the binding process computes new service compositions as soon as

new service offers become available

– active rules could be modified to express different constraints

Page 32: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

References

This presentation is based on [1], [2], [3].

Related works on using a chemical approach for service-

based applications can be found in [4], [5], [6], [7]

Further readings on Gamma-calculus and HOCL can be

found in the learning package The Chemical Computing

Model and HOCL Programming

For a better understanding of quality attribute models can be

found in the learning package Quality of Service models for

Service Oriented Architectures

Page 33: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

References

– Di Napoli C., Giordano M., Pazat J-L., and Wang C.

A Chemical Based Middleware for Workflow Instantiation and

Execution

LNCS 6481 (2010) “Towards a Service-Based Internet”, pp. 100-

111, Springer

– Di Napoli C., Giordano M., Németh Z., and Tonellotto N.

Adaptive instantiation of service workflows using a chemical

approach

Proc. of CoreGrid Workshop (in conjunction with EuroPar 2010)

– Di Napoli C., Giordano M., Németh Z., and Tonellotto N.

Using Chemical Reactions to Model Service Composition

Proc. of 2nd Int. Workshop on Self-Organizing Architectures (in

conjunction with ICAC 2010), pp. 43-50

Page 34: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

References

4. Viroli M., Casadei M.

Chemical-inspired selfcomposition of competing services,”

Proc. of the 2010 ACM Symposium on Applied Computing. NY,

USA, pp. 2029–2036

5. Viroli M., and Zambonelli F.

A biochemical approach to adaptive service ecosystems

Information Science, 2009

6. Nemeth Z., Perez C., Priol T.

Workflow enactment based on a chemical metaphor

Proceedings of the Third IEEE Int.Conf. on Software Engineering

and Formal Methods, pp. 127–136

7. Caeiro M., Nemeth Z., and Priol T.

A chemical model for dynamic workflow coordination

Proc. of the 2011 19th International Euromicro Conference on

Parallel, Distributed and Network-Based Processing, pp. 215–222

Page 35: S-CUBE LP: Dynamic Adaptation: Dynamic Adaptation with the Chemical Model

© Claudia Di Napoli, Maurizio Giordano

Acknowledgements

The research leading to these results has

received funding from the European

Community’s Seventh Framework

Programme [FP7/2007-2013] under grant

agreement 215483 (S-Cube).