Model-driven Distributed Software Deployment

27
ing. S. van der Burg Healthcare Systems Architecture/Delft University of Technology September 16, 2008 Model-driven Distributed Software Deployment

description

Presentation about my master's thesis given at Philips Research

Transcript of Model-driven Distributed Software Deployment

Page 1: Model-driven Distributed Software Deployment

ing. S. van der BurgHealthcare Systems Architecture/Delft University of Technology

September 16, 2008

Model-driven Distributed Software Deployment

Page 2: Model-driven Distributed Software Deployment

2Healthcare Systems Architecture/TU Delft, April 09, 2008

Outline

• Introduction

• SDS2

• Nix

• Disnix

• Conclusions

• Future work

• Demonstration

Page 3: Model-driven Distributed Software Deployment

3Healthcare Systems Architecture/TU Delft, April 09, 2008

Introduction

• Software deployment is all of the activities that make a software system available for use

– Install/Uninstall

– Update

– Release

– Activate/Deactivate

Page 4: Model-driven Distributed Software Deployment

4Healthcare Systems Architecture/TU Delft, April 09, 2008

Introduction

• The software deployment process should be a simple problem, but it turns out to be much more complex

– A software component is almost never self-contained

– A software system should be able to find its dependencies

– Some software components require specific hardware

– Uninstalling should be safe

– Keeping the system up to date should be safe and atomic

Page 5: Model-driven Distributed Software Deployment

5Healthcare Systems Architecture/TU Delft, April 09, 2008

Introduction

• Distributed systems are systems that appear to a user as one logical system

– Components are distributed across different systems in a network and work together to reach a common goal

• The software deployment process of distributed systems is even more difficult:

– Dependencies of components on the same systems (intra-dependencies)

– Dependencies of components running on different systems (inter-dependencies)

Page 6: Model-driven Distributed Software Deployment

6Healthcare Systems Architecture/TU Delft, April 09, 2008

Introduction

• Information technology infrastructure of hospitals is heterogeneous

– Workstations

– Medical equipment (e.g. MRI scanners)

– Connected through wired and wireless network

Page 7: Model-driven Distributed Software Deployment

7Healthcare Systems Architecture/TU Delft, April 09, 2008

Introduction

• The software deployment process in hospital environments is a semi-automatic process

• Software deployment in such an environment requires

– Up-to-date documentation

– People with necessary skills

• A semi-automatic deployment process is

– Error prone

– Time consuming

– Costly

Page 8: Model-driven Distributed Software Deployment

8Healthcare Systems Architecture/TU Delft, April 09, 2008

Vision

• The software deployment process should be a simple process, not a complex one

• The software deployment process should be fully automatic, not semi-automatic

• The configuration of a system should be captured in a model

Page 9: Model-driven Distributed Software Deployment

9Healthcare Systems Architecture/TU Delft, April 09, 2008

Distributed Environment

Page 10: Model-driven Distributed Software Deployment

10Healthcare Systems Architecture/TU Delft, April 09, 2008

Service Development Support System (SDS2)

• Developed here at HSA

• Asset management and utilization services for mobile medical equipment

• Service Oriented Architecture

– Information as a service

– Services could be distributed across different machines

Page 11: Model-driven Distributed Software Deployment

11Healthcare Systems Architecture/TU Delft, April 09, 2008

Components, Protocols & Technologies

XMPP server

equipment logs

XMPP Logger

equipment log

summaries

asset trackingservice

utilizationservice

XMPP Generator

floor plan

SQ

L

XMPP

SOAP

Java

Axis2

ejabberd

smack

tomcat

mysql

GWT

Page 12: Model-driven Distributed Software Deployment

12Healthcare Systems Architecture/TU Delft, April 09, 2008

Deployment View

Philips EnterprisePhilips Enterprise

HospitalHospital

XMPP server

TomCat server

equipment logs

XMPP Logger

TomCat server

equipment logsummaries

TomCat server

asset trackingservice

TomCat server

utilizationservice

XMPP Generator

Mobile Equipment

TomCat server

floor plan

component types

client

transformer

repositoryTomCat server

communication protocols

SQL

SOAP

XMPP

event busevent bus

Page 13: Model-driven Distributed Software Deployment

13Healthcare Systems Architecture/TU Delft, April 09, 2008

Nix

• Nix is a purely functional package manger

• Installing/upgrading/removing package automatically (like others RPM, dpkg etc.)

• Nix expression language, a domain specific language to describe how components are built

• All dependencies are explicit, this yields:

– Multiple versions of a package to be installed side-by-side

– Ensures that dependency specifications are complete

– Supports atomic upgrades and rollbacks

– “Niks” + UNIX = Nix

• Nix deploys packages on local systems but not on distributed systems though

Page 14: Model-driven Distributed Software Deployment

14Healthcare Systems Architecture/TU Delft, April 09, 2008

Example Nix expression{stdenv, fetchsvnssh, apacheAnt, jdk, mysql_jdbc, smack, config, username, password }:

stdenv.mkDerivation { name = "XMPPLogger"; src = fetchsvnssh { url = "gforge.natlab.research.philips.com/svnroot/public/sds2/branches/NixDeploy/SDS2Applications/XMPPLogger"; md5 = "62401d706079cb61d3b7e0badc818a1d"; inherit username; inherit password; }; builder = ./builder.sh;

inherit jdk mysql_jdbc smack config; buildInputs = [apacheAnt jdk smack config];}

Page 15: Model-driven Distributed Software Deployment

15Healthcare Systems Architecture/TU Delft, April 09, 2008

Packages modelrec{

username = “user”;password = “secret”;

config = import ../config { ... };

smack = ...;stdenv = ...;apacheAnt = ...;

XMPPLogger = import ../SDS2Applications/XMPPLogger { inherit username password; inherit stdenv fetchsvnssh apacheAnt jdk; inherit smack mysql_jdbc; inherit config;

};...

}

Page 16: Model-driven Distributed Software Deployment

Research / Healthcare Systems Architecture, September 3, 2008

Package Dependency Graph AssetTracker Service

Page 17: Model-driven Distributed Software Deployment

17Healthcare Systems Architecture/TU Delft, April 09, 2008

Nix deployment operations

• Installing XMPP Logger:

– nix-env -f pkgs.nix -i XMPPLogger

• Uninstalling XMPP Logger:

– nix-env -f pkgs.nix -e XMPPLogger

• Upgrading XMPP Logger:

– nix-env -f pkgs.nix -u XMPPLogger

Page 18: Model-driven Distributed Software Deployment

18Healthcare Systems Architecture/TU Delft, April 09, 2008

Disnix

• An extension to Nix to allow distributed software deployment tasks

• A webservice interface which allows remote access to the Nix store and Nix profiles

• Introduces three model types to model a distributed system:

– Services model

– Infrastructure model

– Distribution model

• Uses a variant of the two-phase commit algorithm to allow distributed atomic commits

Page 19: Model-driven Distributed Software Deployment

19Healthcare Systems Architecture/TU Delft, April 09, 2008

Disnix overview

Page 20: Model-driven Distributed Software Deployment

20Healthcare Systems Architecture/TU Delft, April 09, 2008

Services model

ME2MSService = {name = "ME2MSService";pkg = pkgs.SDS2.webservices.ME2MSService;dependsOn = [ MELogService FloorPlanService ];

};

MULogService = {name = "MULogService";pkg = pkgs.SDS2.webservices.MULogService;dependsOn = [ ME2MSService ];

};

MELogService = {name = “MELogService”;pkg = pkgs.SDS2.webservices.MELogService;dependsOn = [ ... ];

};

Page 21: Model-driven Distributed Software Deployment

21Healthcare Systems Architecture/TU Delft, April 09, 2008

Infrastructure model{ dtk15 = {

hostname = "dtk15";targetEPR = http://dtk15:8080/axis2/services/DisnixService;tomcatPort = 8080;

};

dt2d1 = { hostname = "dt2d1";

targetEPR = http://dt2d1:8080/axis2/services/DisnixService;tomcatPort = 8080;mysqlPort = 3306;

};}

Page 22: Model-driven Distributed Software Deployment

22Healthcare Systems Architecture/TU Delft, April 09, 2008

Distribution model{services, infrastructure}:

[ { service = services.FloorPlanService; target = infrastructure.dtk15; } { service = services.ME2MSService; target = infrastructure.dtk15; } { service = services.MELogService; target = infrastructure.dt2d1; } { service = services.MULogService; target = infrastructure.dtk15; } ...]

Page 23: Model-driven Distributed Software Deployment

23Healthcare Systems Architecture/TU Delft, April 09, 2008

Distributed atomic commits

• Commit-request phase:

– Build all components on the coordinator machine

– Transfer the closures to the cohort machines through the webservice interface

• Request phase, on each cohort:

– Install component in profile

– Activate the component

Page 24: Model-driven Distributed Software Deployment

24Healthcare Systems Architecture/TU Delft, April 09, 2008

Conclusion

• We have adapted and modeled the SDS2 system in Nix expressions to make it automatically deployable

• We extended the Nix approach of software deployment of single system to distributed systems

• We have demonstrated that we can deploy SDS2 in a distributed environment

Page 25: Model-driven Distributed Software Deployment

25Healthcare Systems Architecture/TU Delft, April 09, 2008

Future work

• Dynamic distribution based on Quality of Service models

– Reliability by reducing the inter-dependencies

• Symmetric build and deliver parts

• Support for heterogeneous environments, example:

– Linux coordinator

– Windows/FreeBSD/Linux based network

• Support for other types of distributed systems with other protocols

• Investigate development constraints

Page 26: Model-driven Distributed Software Deployment

Research / Healthcare Systems Architecture, September 3, 2008

MySQL databaseSDS2AssetTrackerEMLogServiceHIBServiceMELogServiceXMPPGeneratorXMPPLogger

EjabberdSDS2UtilisationFloorplanServiceME2MSServiceMULogServiceEventMergerDemoPortal

VirtualBox/NixOSVirtualBox/NixOS

nbu55

disnix

VirtualBox/NixOS

SDS2 Deployment Demo

Initial deployment state

Deployment over two machines

Garbage collect to initial state

Page 27: Model-driven Distributed Software Deployment