A Formal Framework for Component Deployment Y. David Liu Scott F. - - PowerPoint PPT Presentation

a formal framework for component deployment
SMART_READER_LITE
LIVE PREVIEW

A Formal Framework for Component Deployment Y. David Liu Scott F. - - PowerPoint PPT Presentation

A Formal Framework for Component Deployment Y. David Liu Scott F. Smith Johns Hopkins University OOPSLA'06, Portland, Oregon A Menagerie of Deployment Systems CLI Assemblies InstallShield JSR 277 OSGi RPM Dpkg EJB Manifests Portage


slide-1
SLIDE 1

A Formal Framework for Component Deployment

  • Y. David Liu

Scott F. Smith Johns Hopkins University

OOPSLA'06, Portland, Oregon

slide-2
SLIDE 2

A Menagerie of Deployment Systems

OSGi InstallShield EJB Manifests Bazaar RubyGems CPAN CTAN CORBA D&C Portage Dpkg RPM JSR 277 CLI Assemblies

slide-3
SLIDE 3

Foundations?

OSGi InstallShield EJB Manifests Bazaar RubyGems CPAN CTAN CORBA D&C Portage Dpkg RPM JSR 277 CLI Assemblies

?

slide-4
SLIDE 4

An Analogy: Programming Languages

Java Pascal C++ C# C ML Haskel Scheme Scala Perl Lisp Smalltalk Fortran

slide-5
SLIDE 5

An Analogy: Foundations of Languages

Java Pascal C++ C# C ML Haskel Scheme Scala Perl Lisp Smalltalk Fortran

λ Calculus Object Calculi etc.

slide-6
SLIDE 6

This Work

OSGi InstallShield EJB Manifests Bazaar RubyGems CPAN CTAN CORBA D&C Portage Dpkg RPM JSR 277 CLI Assemblies

Application Buildbox

slide-7
SLIDE 7

This Work An abstract, platform-independent, vendor- independent study of component deployment

  • Designing components as deployment units
  • Formalizing the entire deployment lifecycle
  • Proving deployment invariants

Design objectives: simple (capturing recurring themes) and expressive

slide-8
SLIDE 8

This Work An abstract, platform-independent, vendor- independent study of component deployment

  • Designing components as deployment units
  • Formalizing the entire deployment lifecycle
  • Proving deployment invariants

Design objectives: simple (capturing recurring themes) and expressive

slide-9
SLIDE 9

This Work An abstract, platform-independent, vendor- independent study of component deployment

  • Designing components as deployment units
  • Formalizing the entire deployment lifecycle
  • Proving deployment invariants

Design objectives: simple (capturing recurring themes) and expressive

slide-10
SLIDE 10

NetLib 1690 NetLib 5429 Browser 5233 Browser NetLib 1690 5233 NetLib 5429 Browser NetLib 1690 5233 NetLib 5429 Browser 5233 NetLib 5429 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265

Flash

4423

install update remove execute hot deploy hot update

slide-11
SLIDE 11

NetLib 1690 Browser Browser 5233 NetLib 5429 Browser 5233 NetLib 5429 Browser 5233

build ship execute (testing)

slide-12
SLIDE 12

This Work An abstract, platform-independent, vendor- independent study of component deployment

  • Designing components as deployment units
  • Formalizing the entire deployment lifecycle
  • Proving deployment invariants
  • Deployment ''never goes wrong''
  • Version compatibility

Design objectives: simple (capturing recurring themes) and expressive

slide-13
SLIDE 13

This Work An abstract, platform-independent, vendor- independent study of component deployment

  • Designing components as deployment units
  • Formalizing the entire deployment lifecycle
  • Proving deployment invariants

Design objectives: simple (capturing recurring themes) and expressive

slide-14
SLIDE 14

Why Foundations?

  • Fosters next-generation deployment systems

– Elucidates subtle issues – More features proposed from academic

research community

– Deployment systems with provably

correct properties

  • Complements modularity research

– when and where of linking

slide-15
SLIDE 15

Why Foundations?

  • Fosters next-generation deployment systems

– Elucidates subtle issues – More features proposed from academic

research community

– Deployment systems with provably

correct properties

  • Complements modularity research

– when and where of linking

slide-16
SLIDE 16

Basics

slide-17
SLIDE 17

Application Buildbox

Browser NetLib

1690 5233

NetLib

5429

An imaginary box where an application ''hatches'' throughout the deployment lifecycle

slide-18
SLIDE 18

Deployment Unit: Assemblage

Browser

Net Plugins

send timeout readfile start

  • Real-world analogues: JAR, C .so library, DLL, CLI

Assembly

  • Assemblages were first developed in [Liu and Smith,

ECOOP'04], but without deployment

5233

slide-19
SLIDE 19

Version Identifiers

Browser

Net Plugins

send timeout readfile start

  • Globally Unique
  • Real-world analogues: COM+ GUID, CLI Assembly

strong names

5233

slide-20
SLIDE 20

Side-by-Side Deployment

Browser NetLib

1690 5233

NetLib

5429

Two versions of the NetLib are deployed in the same buildbox

slide-21
SLIDE 21

Basic Construct: Assemblage Interfaces

Browser

Net Plugins

send timeout readfile start

Real-world analogues: Manifest files, Deployment Descriptors

5233

slide-22
SLIDE 22

Two Kinds of Assemblage Interfaces

Browser

Net Plugins

send timeout readfile start

Mixers: regular dependency Pluggers: hot deployment dependency

5233

slide-23
SLIDE 23

Interfaces are Bi-directional: Imports, Exports

Browser

Net Plugins

send timeout readfile start

5233

slide-24
SLIDE 24

Multiple Interfaces

readfile start

Net Plugins

send timeout

5233

Browser

GUI

initGraphics draw

  • Name management is crucial for deployment.
  • Avoid global name clashes
slide-25
SLIDE 25

Interface: Unit of Versioning Dependencies

Net Plugins

5233

Browser

GUI

initGraphics draw

GUILib

0872 initGraphics draw

slide-26
SLIDE 26

What is NOT Possible...

Net Plugins

5233

Browser

GUI

initGraphics draw

GUILib

5422 initGraphics draw

GUILib

0872 initGraphics draw

slide-27
SLIDE 27

Assemblages in Shipped Form

Browser

Net Plugins

send timeout readfile start

Net -> NetLib.1690.Socket

version constraint

5233

slide-28
SLIDE 28

Component Wiring: Mixing

Browser NetLib

1690 5233 Net -> NetLib.1690.Socket Net Plugins Socket

send timeout

  • Between a pair of mixers
  • Matching of functionalities
  • Matching of version constraints
slide-29
SLIDE 29

Component Wiring: Plugging

Flash Browser

5233 3265 Main -> Browser.5233.Plugins Main Plugins

readFile start

  • Wiring at hot deployment time
  • Between a plugger and a mixer
  • Matching of functionalities
  • Matching of version constraints
slide-30
SLIDE 30

Compatibility Set

Browser NetLib

1690 5233 Net -> NetLib.1690.Socket Net Plugins Socket

  • Subversioning: a partial order
  • We do not hardcode the strategy on how two versions

are semantically compatible

3370 < : 1690

slide-31
SLIDE 31

Act 2: Component Deployment Lifecycle

slide-32
SLIDE 32

NetLib 1690 NetLib 5429 Browser 5233 Browser NetLib 1690 5233 NetLib 5429 Browser NetLib 1690 5233 NetLib 5429 Browser 5233 NetLib 5429 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265

Flash

4423

install update remove execute hot deploy hot update

Deployment Site Transitions

slide-33
SLIDE 33

NetLib 1690 NetLib 5429 Browser 5233 Browser NetLib 1690 5233 NetLib 5429 Browser NetLib 1690 5233 NetLib 5429 Browser 5233 NetLib 5429 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265

Flash

4423

install update remove execute hot deploy hot update

slide-34
SLIDE 34

NetLib 1690 NetLib 5429 Browser 5233 Browser NetLib 1690 5233 NetLib 5429 Browser NetLib 1690 5233 NetLib 5429 Browser 5233 NetLib 5429 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265

Flash

4423

install update remove execute hot deploy hot update

slide-35
SLIDE 35

NetLib 1690 NetLib 5429 Browser 5233 Browser NetLib 1690 5233 NetLib 5429 Browser NetLib 1690 5233 NetLib 5429 Browser 5233 NetLib 5429 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265

Flash

4423

install update remove execute hot deploy hot update

slide-36
SLIDE 36

NetLib 1690 NetLib 5429 Browser 5233 Browser NetLib 1690 5233 NetLib 5429 Browser NetLib 1690 5233 NetLib 5429 Browser 5233 NetLib 5429 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265

Flash

4423

install update remove execute hot deploy hot update

slide-37
SLIDE 37

NetLib 1690 NetLib 5429 Browser 5233 Browser NetLib 1690 5233 NetLib 5429 Browser NetLib 1690 5233 NetLib 5429 Browser 5233 NetLib 5429 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265

Flash

4423

install update remove execute hot deploy hot update

slide-38
SLIDE 38

NetLib 1690 NetLib 5429 Browser 5233 Browser NetLib 1690 5233 NetLib 5429 Browser NetLib 1690 5233 NetLib 5429 Browser 5233 NetLib 5429 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265

Flash

4423

install update remove execute hot deploy hot update

slide-39
SLIDE 39

NetLib 1690 Browser Browser 5233 NetLib 5429 Browser 5233 NetLib 5429 Browser 5233

build ship execute (testing)

Development Site Transitions

slide-40
SLIDE 40

NetLib 1690 Browser Browser 5233 NetLib 5429 Browser 5233

build ship execute (testing)

Browser 5233 NetLib 5429

slide-41
SLIDE 41

NetLib 1690 Browser Browser 5233 NetLib 5429 Browser 5233 NetLib 5429 Browser 5233

build ship execute (testing)

slide-42
SLIDE 42

NetLib 1690 Browser Browser 5233 NetLib 5429 Browser 5233 NetLib 5429 Browser 5233

build ship execute (testing)

slide-43
SLIDE 43

Formalism Choice

  • Labelled Transition System (LTS) for deployment
  • perations

– Each transition step is an application buildbox

evolution step

– Labels are ''commands'' which deployment

system users can trigger

  • Run-time behaviors captured via a minimalistic

programming language

slide-44
SLIDE 44

Browser NetLib

Socket Net Plugins

Shipping a Component ship (Browser, 5233, {Net})

1690 5233

slide-45
SLIDE 45

Browser NetLib

Socket Net Plugins

Shipping a Component ship (Browser, 5233, {Net})

1690 5233

Browser

Net Plugins 5233 Shipped Assemblage Net -> NetLib.1690.Socket

slide-46
SLIDE 46

Why Not Always Ship the Entire Closure?

Browser NetLib

Socket Net Plugins 1690 5233

slide-47
SLIDE 47

Browser NetLib

Socket Net Plugins 1690 5233

  • Components are independently deployable units!
  • Off-the-shelf commercial components, libraries
  • Updates, patches
  • Sometimes not realistic, such as native code

Why Not Always Ship the Entire Closure?

slide-48
SLIDE 48

NetLib

Socket

Installing a Component install (shippedbrowser)

3370

Browser

Net Plugins 5233 shippedbrowser Net -> NetLib.1690.Socket 3370 < : 1690

slide-49
SLIDE 49

Browser NetLib

Socket Net Plugins

Installing a Component

3370 5233 Net -> NetLib.1690.Socket 3370 < : 1690

install (shippedbrowser)

slide-50
SLIDE 50

Cyclic Dependencies Example: System.dll and System.xml.dll in .NET

B

Q 0088 shippedB Q -> A.7421.P

A

P 7421 shippedA P -> B.0088.Q

slide-51
SLIDE 51

Cyclic Dependencies

B

Q 0088 shippedB Q -> A.7421.P

A

P 7421 shippedA P -> B.0088.Q

install (shippedA)

slide-52
SLIDE 52

Cyclic Dependencies

B

Q 0088 shippedB Q -> A.7421.P 7421 P -> B.0088.Q

install (shippedA)

A

P

slide-53
SLIDE 53

Cyclic Dependencies

B

Q 0088 shippedB Q -> A.7421.P 7421 P -> B.0088.Q

install (shippedB)

A

P

slide-54
SLIDE 54

Cyclic Dependencies

B

Q 0088 Q -> A.7421.P 7421 P -> B.0088.Q

install (shippedB)

A

P

slide-55
SLIDE 55

Browser NetLib

Socket Net Plugins

Updating a Component

7622 5233 Net -> NetLib.1690.Socket

NetLib

Socket 9985 9985 <: 1690, 7622 <: 1690

update (NetLib, 7622, 9985)

slide-56
SLIDE 56

Browser NetLib

Socket Net Plugins

Updating a Component

7622 5233 Net -> NetLib.1690.Socket

NetLib

Socket 9985 9985 <: 1690, 7622 <: 1690

update (NetLib, 7622, 9985)

slide-57
SLIDE 57

Browser NetLib

Socket Net Plugins

Updating a Component

7622 5233 Net -> NetLib.1690.Socket

NetLib

Socket 9985 9985 <: 1690, 7622 <: 1690

an update is not necessarily an upgrade

slide-58
SLIDE 58

Browser NetLib

Socket Net Plugins

Hot Deployment

send timeout readfile start

7622 5233

Flash

Main 3265 flash Main -> Browser.5233.Plugins

h = plugin flash with Plugins >> Main;

Running application

slide-59
SLIDE 59

Browser NetLib

Socket Net Plugins

Hot Deployment

send timeout readfile start

7622 5233

Flash

Main 3265

h = plugin flash with Plugins >> Main;

Running application

slide-60
SLIDE 60

Browser NetLib

Socket Net Plugins

Hot Deployment

send timeout readfile start

7622 5233

Flash

Main 3265

h = plugin flash with Plugins >> Main; h..start();

Running application

slide-61
SLIDE 61

Browser NetLib

Socket Net Plugins

send timeout readfile start

7622 5233

Flash

Main 3265

h1 = plugin flash1 with Plugins >> Main; ... h2 = plugin flash2 with Plugins >> Main;

Flash

Main 3211

Multiple Plugins: Hot Update

slide-62
SLIDE 62

Act 3: Invariants, Invariants!

slide-63
SLIDE 63

Theorems: Buildbox Well-formedness

  • Theorem: no deployment operations can turn

a well-formed buildbox into a non-well- formed one.

  • Theorem: no reductions at run time can turn

a well-formed buildbox into a non-well- formed one.

slide-64
SLIDE 64

NetLib 1690 NetLib 5429 Browser 5233 Browser NetLib 1690 5233 NetLib 5429 Browser NetLib 1690 5233 NetLib 5429 Browser 5233 NetLib 5429 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265 Browser 5233 NetLib 5429

Flash

3265

Flash

4423

install update remove execute hot deploy hot update

slide-65
SLIDE 65

NetLib 1690 Browser Browser 5233 NetLib 5429 Browser 5233 NetLib 5429 Browser 5233

build ship execute (testing)

slide-66
SLIDE 66

Specifying Version Compatibility How do a deployment-site run and a pre- shipping test-run correspond?

slide-67
SLIDE 67

Suppose we have a component X...

P m

locating method m imported/exported from P

... int z = P::m(3); ...

2700 n method n X

slide-68
SLIDE 68

On The Development Site

X

2700 P m

slide-69
SLIDE 69

On The Development Site

execute (testing)

X

2700 P m

X

2700 P m

slide-70
SLIDE 70

On The Development Site

execute (testing)

X

2700 P m

X

2700 P m

at run time P::m is bound to assemblage Y version v

slide-71
SLIDE 71

On The Development Site

at run time P::m is bound to assemblage Y version v

ship (X, 2700, {P})

X

execute (testing)

X

2700 P m

X

2700 P m 2700 P m

slide-72
SLIDE 72

On Any Deployment Site

X

2700 P m

install

slide-73
SLIDE 73

On Any Deployment Site

X

2700 P m

install

2700 m P

X

slide-74
SLIDE 74

On Any Deployment Site

X

2700 P m

install

2700 m P

X

. .

2700 m P

X

anyLTS steps

slide-75
SLIDE 75

On Any Deployment Site

X

2700 P m

install

2700 m P

X

. .

2700 m P

X

any LTS steps execute

2700 m P

X

slide-76
SLIDE 76

On Any Deployment Site

X

2700 P m

install

2700 m P

X

. .

2700 m P

X

any LTS steps execute

2700 m P

X

at run time P::m is bound to assemblage Y' version v'

slide-77
SLIDE 77
  • Y = Y'
  • v = v' or v' is a subversion of v

Theorem on Version Compatibility

slide-78
SLIDE 78

Future Work

  • Keep the platform-independent spirit, with

more expressiveness gains

– security in deployment – distributed deployment (e.g. sensor network

applications)

  • A closer look at Java deployment

– an effort to map back to the real world

slide-79
SLIDE 79

Related Work

  • Many real-world systems
  • Formal treatment is rare

– [Buckley, CD'05]: formalized name-binding

  • f CLI Assemblies
  • platform-specific
  • no modeling of deployment lifecycle
  • no invariant properties proved
slide-80
SLIDE 80

Related Work: Real-world Systems

OSGi InstallShield EJB Manifests Bazaar RubyGems CPAN CTAN CORBA D&C Portage Dpkg RPM JSR 277 CLI Assemblies

Application Buildbox

slide-81
SLIDE 81

Related Work

  • Many real-world systems
  • Formal treatment is rare

– [Buckley, CD'05]: formalized name-binding

  • f CLI Assemblies
  • platform-specific
  • no modeling of deployment lifecycle
  • no invariant properties proved
slide-82
SLIDE 82

A Retrospective

  • For deployment systems designers:

– platform-independent communication – foster next-generation deployment systems

  • For deployment system users:

– tools with well-defined user interfaces – tools with provably correct properties

  • For module system researchers:

– a foundational study of when and where of

linking