34
Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes [email protected] @pnoltes Björn Petri [email protected]

Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes [email protected] @pnoltes Björn Petri [email protected]

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Self Healing Systems using Distributed OSGiApacheCon: Core Europe 2015

Pepijn [email protected]@pnoltes

Björn [email protected]

Page 2: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Agenda

● Introduction Services & OSGi ~ 5 min

● Demo Dynamic Services ~ 10 min

● Self Healing Architecture ~ 5 min

● Demo Self Healing System ~ 10 min

● Wrap-up ~ 5 min

Page 3: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Introduction Services & OSGi

Page 4: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

● components as services

● application partitioning

● modular responsibility

● isolated

● technology diversity

What are Microservices?

MicroservicesMonolith

Page 5: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

● Services

○ “plain old interfaces”

○ provided not inherited

● Services are first class citizens

● Program against interface

● Promote cohesion, prevent coupling

● Favor services composition over inheritance

● Discoverable & Dynamic

Dynamic Service-Oriented Programming

Microservices

Page 6: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Monolith

Microservices

Project size

Co

mp

lexi

tyStreamline your Development

Page 7: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Monolith

Microservices

Project size

Co

mp

lexi

tyStreamline your Development

smaller projects suffer from an

additional overhead of complexity

Page 8: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Monolith

Microservices

Project size

Co

mp

lexi

tyStreamline your Development

modulare boundaries of microservices reduces the

complexity for bigger projects

smaller projects suffer from an

additional overhead of complexity

Page 9: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Rebuilt it all ... while running

● application partitioning

● independently deployable

● best fitting scalability

● no technology commitment

● easily refactorable

Page 10: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

● Specification

● dynamic component model

● (Nano)Services Framework

● By embedded system

vendors & network provides

Introduction OSGi

Page 11: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Java implementation of the OSGi framework specification

C implementation of the OSGi framework specification

Apache ACE is a provisioning framework

Introduction OSGi

Page 12: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Services

Provides Uses

Monitors

Service

Page 13: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

public interface Sensor {

String getName();

Location getLocation();

Double getRange();

}

struct Sensor {

void *handle;

int getName(void *handle, char **name);

int getLocation(void *handle, location_t **loc);

int getRange(void *handle, double *range);

};

Service Example

Page 14: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

public Viewer {

private final List<Sensor> sensors = … public void addSensor(Sensor s) {

sensors.add(s);

}

public void doGet(...) {

… sensor.getLocation()

… }

}

struct Viewer {

array_list_pt sensors;

pthread_mutex_t *mutex;

};

void addSensor(struct Viewer *v, struct Sensor *s) {

pthread_mutex_lock(v->mutex);

arrayList_add(sensors,s)

pthread_mutex_unlock(v->mutex)

}

void doGet(...) {

...

pthread_mutex_lock(v->mutex);

char *name = NULL;

int rc = sensor->getName(sensor->handle, &name);

pthread_mutex_unlock(v->mutex)

…}

1

1

Service Usage Example

Page 15: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

public Viewer {

private final List<Sensor> sensors = … public void addSensor(Sensor s) {

sensors.add(s);

}

public void doGet(...) {

… sensor.getLocation()

… }

}

struct Viewer {

array_list_pt sensors;

pthread_mutex_t *mutex;

};

void addSensor(struct Viewer *v, struct Sensor *s) {

pthread_mutex_lock(v->mutex);

arrayList_add(sensors,s)

pthread_mutex_unlock(v->mutex)

}

void doGet(...) {

...

pthread_mutex_lock(v->mutex);

char *name = NULL;

int rc = sensor->getName(sensor->handle, &name);

pthread_mutex_unlock(v->mutex)

…}

1

1

Remote Service Usage Example

22

Page 16: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Demo Dynamic Services

Page 17: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Self Healing Architecture

Page 18: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Running

Functional Change Security Change

Hardware Change

Dynamic Services delivers an evolvable Application

Page 19: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Computer Cluster

Celix FelixCelixFelixAce

Dynamic Application - Startup

Page 20: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Computer Cluster

Celix FelixCelixFelixAce

Dynamic Application - Provisioning

Page 21: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Computer Cluster

Celix FelixCelixFelixAce

Dynamic Application - Running

Page 22: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Computer Cluster

Celix FelixCelixFelixAce

Dynamic Application - Hardware failure

Page 23: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Computer Cluster

Celix FelixCelixFelixAce Celix

Dynamic Application - Self Healing

Page 24: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Computer Cluster

Celix FelixFelixAce Celix

Dynamic Application - Running

Page 25: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Celix FelixFelixAce Celix

Dynamic Application - Running

Page 26: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Demo Self Healing System

Page 27: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Wrap-up

Page 28: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

In a nutshell

Page 29: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

C

C

CJava

JavaJava

i i i

In a nutshell

Page 30: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

i i i

C

Design Space

In a nutshell

Page 31: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

i i i

C

Development Space

In a nutshell

Page 32: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

C

C

CJava

JavaJava

i i i

In a nutshell

Page 33: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

C

C

CJava

JavaJava

i i i

In a nutshell

Page 34: Self Healing Systems using Distributed OSGi...Self Healing Systems using Distributed OSGi ApacheCon: Core Europe 2015 Pepijn Noltes pepijnnoltes@gmail.com @pnoltes Björn Petri bjoern.petri@sundevil.de

Thank You!

Links● Apache Ace - https://ace.apache.org

https://github.com/apache/ace● Apache Celix - https://celix.apache.org

https://github.com/apache/celix● Apache Felix - https://felix.apache.org

https://github.com/apache/felix● INAETICS - http://www.inaetics.org

https://github.com/INAETICS