Date post: | 04-Jul-2015 |
Category: |
Technology |
Upload: | mfrancis |
View: | 168 times |
Download: | 4 times |
©2014 IBM Corporation
Making everything better with OSGi
a happy case study in building a really nice runtime
Holly Cummins [email protected]
@holly_cummins
©2014 IBM Corporation
Let’s talk about WebSphere.
©2014 IBM Corporation
Let’s talk about WebSphere.
Awesome capabilities…
©2014 IBM Corporation
Let’s talk about WebSphere.
Awesome capabilities…
©2014 IBM Corporation
Let’s talk about WebSphere.
Awesome capabilities…
… for production.
©2014 IBM Corporation
Let’s talk about WebSphere.
Awesome capabilities…
… for production.
For development, historically not so well-suited.
©2014 IBM Corporation
History
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
History
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
History
forever
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
Big codebase
History
forever
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
Big codebase
Big customer base
History
forever
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
Big codebase
Big customer base
Big workloads
History
forever
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
Big codebase
Big customer base
Big workloads
… Big inhibitors to massive change
History
forever
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
Big codebase
Big customer base
Big workloads
… Big inhibitors to massive change
History
This is not a complaint.
This is a problem we arehappy to have.
forever
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
Big codebase
Big customer base
Big workloads
… Big inhibitors to massive change
History
This is not a complaint.
This is a problem we arehappy to have.
But it is still a problem.
forever
©2014 IBM Corporation
©2014 IBM Corporation
Code that has been around forever…
©2014 IBM Corporation
Code that has been around forever…
No matter how good you are, or how smart you are
©2014 IBM Corporation
Code that has been around forever…
No matter how good you are, or how smart you are
If your code lives long enough, and is used enough, it ends up looking like…
©2014 IBM Corporation
Code that has been around forever…
No matter how good you are, or how smart you are
If your code lives long enough, and is used enough, it ends up looking like…
?!
©2014 IBM Corporation
Code that has been around forever…
No matter how good you are, or how smart you are
If your code lives long enough, and is used enough, it ends up looking like…
dragons
?!
©2014 IBM Corporation
Code that has been around forever…
No matter how good you are, or how smart you are
If your code lives long enough, and is used enough, it ends up looking like…
dragons
?!
Especially code that has roots
going back to late ‘90s…
©2014 IBM Corporation
By Steve Collis from Melbourne, Australia [CC-BY-2.0 (http://
creativecommons.org/licenses/by/2.0)], via Wikimedia Commons
How do you manage dragons?
©2014 IBM Corporation
By Steve Collis from Melbourne, Australia [CC-BY-2.0 (http://
creativecommons.org/licenses/by/2.0)], via Wikimedia Commons
Clever WebSphere architects
How do you manage dragons?
©2014 IBM Corporation
By Steve Collis from Melbourne, Australia [CC-BY-2.0 (http://
creativecommons.org/licenses/by/2.0)], via Wikimedia Commons
Clever WebSphere architects OSGi
How do you manage dragons?
©2014 IBM Corporation
OSGi and WAS: The first pass…
OSGi was included in WAS v6.1, in 2006
Went from lots of arbitrary jars to a few bundles
Achieved some modularity enforced by OSGi
We did not use or expose OSGi services
Compatibility constraints: WAS is the bottom of the stack
Assumptions about resource initialization and availability
Entrenched dependencies between some core elements
©2014 IBM Corporation
Did that fix everything?
©2014 IBM Corporation
Not quite.
Did that fix everything?
By Steve Collis from Melbourne, Australia [CC-
BY-2.0 (http://creativecommons.org/licenses/by/2.0)], via Wikimedia Commons
©2014 IBM Corporation
What if… If we could start over, what would we want?
©2014 IBM Corporation
What if… If we could start over, what would we want?
Developer-friendly
©2014 IBM Corporation
What if… If we could start over, what would we want?
Developer-friendly
Simple
©2014 IBM Corporation
What if… If we could start over, what would we want?
Developer-friendly
Simple
Dynamic
©2014 IBM Corporation
What if… If we could start over, what would we want?
Developer-friendly
Simple
Dynamic
Light-weight
©2014 IBM Corporation
What if… If we could start over, what would we want?
Developer-friendly
Simple
Dynamic
Light-weight
Composable / Flexible
©2014 IBM Corporation
What if… If we could start over, what would we want?
Developer-friendly
Simple
Dynamic
Light-weight
Composable / Flexible
Extensible
©2014 IBM Corporation
What if… If we could start over, what would we want?
Developer-friendly
Simple
Dynamic
Light-weight
Composable / Flexible
Extensible
selectable content
clear API/SPI runtime/app
isolation
human usable configuration
©2014 IBM Corporation
runtimeonly
some combination oftechnologies
!app-centered
everything
What if…
grokable config
provisioning
©2014 IBM Corporation
What if…
grokable config
provisioning
runtimeonly
some combination oftechnologies
!app-centered
everything
How do we do this?
©2014 IBM Corporation
What if… runtime
only
some combination oftechnologies
!app-centeredeverything
And yet allow this?
no restarts
©2014 IBM Corporation
What if…
And for crying out loud, can we prevent THIS?!
runtime3rd party
bundleB
systembundle
A
©2014 IBM Corporation
What if…
And for crying out loud, can we prevent THIS?!
runtime3rd party
bundleB
systembundle
A
Application
©2014 IBM Corporation
What if…
And for crying out loud, can we prevent THIS?!
runtime3rd party
bundleB
systembundle
A
Application
©2014 IBM Corporation
What if…
And for crying out loud, can we prevent THIS?!
runtime3rd party
bundleB
systembundle
A
Application
X
©2014 IBM Corporation
The egg problem
“Create a light-weight profile of WebSphere that starts in under 2 seconds… Don’t break any eggs”
— Ian Robinson (cleverest WebSphere architect)
©2014 IBM Corporation
The egg problem
“Create a light-weight profile of WebSphere that starts in under 2 seconds… Don’t break any eggs”
— Ian Robinson (cleverest WebSphere architect)
By miya (miya's own file) [CC-BY-3.0 (http://creativecommons.org/licenses/by/3.0)], via Wikimedia Commons
©2014 IBM Corporation
OSGi maturity model
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
Level 3: Modularity
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
Level 3: Modularity
Level 4: Loose coupling
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
Level 3: Modularity
Level 4: Loose coupling
Level 5: Devolution
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
Level 3: Modularity
Level 4: Loose coupling
Level 5: Devolution
Level 6: Dynamism
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
Level 3: Modularity
Level 4: Loose coupling
Level 5: Devolution
Level 6: Dynamism
Level 7: Peter Kriens
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
Level 3: Modularity
Level 4: Loose coupling
Level 5: Devolution
Level 6: Dynamism
Level 7: Peter Kriens
Websphere Full Profile
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
Level 3: Modularity
Level 4: Loose coupling
Level 5: Devolution
Level 6: Dynamism
Level 7: Peter Kriens
Websphere Liberty Profile
©2014 IBM Corporation
Dealing with our legacy
We needed a new kernel
Used the new base to re-group…
Lots of code still common with full profile
Wrap/Shim: New face on old code
Patch: tweak and replace bits where necessary
©2014 IBM Corporation
Building a kernel from scratch
OSGi-based for all the reasons
First-class use of OSGi services
Must react to configuration changes
Runtime composition on-the-fly
©2014 IBM Corporation
Bundle manifests
©2014 IBM Corporation
Bundle manifests? What manifests?We use Eclipse .classpath to
Determine project build order
Generate ant classpath
Bnd takes care of the rest
Declare services using annotations
Bnd makes overrides really easy
Useful when integrating legacy code
©2014 IBM Corporation
Bundle manifests? What manifests?We use Eclipse .classpath to
Determine project build order
Generate ant classpath
Bnd takes care of the rest
Declare services using annotations
Bnd makes overrides really easy
Useful when integrating legacy code
New developers need to have almost no awareness we’re
©2014 IBM Corporation
ConfigurationSettled on XML for configuration format
Ubiquitous
Expressive
BUT, for simplicity:
single file
usable defaults
<server description=“simple”> <featureManager> <feature>jsp-2.2</feature> </featureManager> ! <httpEndpoint id=“defaultHttpEndpoint” httpPort=“9080” httpsPort=“9443” /> </server>
©2014 IBM Corporation
ConfigurationComposable system requires composable configuration:
Individual components own their config
No centralized repository
No externally defined global config model
©2014 IBM Corporation
ConfigurationComposable system requires composable configuration:
Individual components own their config
No centralized repository
No externally defined global config modelConfiguration Admin and Metatype
- job done
©2014 IBM Corporation
ConfigurationComposable system requires composable configuration:
Individual components own their config
No centralized repository
No externally defined global config modelConfiguration Admin and Metatype
- job mostly done
©2014 IBM Corporation
Metatype Equinox impl + extensions
Uniform validation of user input
Define configuration and constraints in one place, it gets used everywhere else.
We favor metatype.xml for this reason
Custom namespace for additional types and validators
ibm:type — duration, location, password
pid/reference
©2014 IBM Corporation
Metatype Equinox impl + extensions
Uniform validation of user input
Define configuration and constraints in one place, it gets used everywhere else.
We favor metatype.xml for this reason
Custom namespace for additional types and validators
ibm:type — duration, location, password
pid/reference
human readable: 1h30m converted to unit of
choice
©2014 IBM Corporation
Metatype Equinox impl + extensions
Uniform validation of user input
Define configuration and constraints in one place, it gets used everywhere else.
We favor metatype.xml for this reason
Custom namespace for additional types and validators
ibm:type — duration, location, password
pid/reference
human readable: 1h30m converted to unit of
choiceused by developer tools to help prompt for the right kind of
path: file vs. url
©2014 IBM Corporation
Metatype Equinox impl + extensions
Uniform validation of user input
Define configuration and constraints in one place, it gets used everywhere else.
We favor metatype.xml for this reason
Custom namespace for additional types and validators
ibm:type — duration, location, password
pid/reference
human readable: 1h30m converted to unit of
choiceused by developer tools to help prompt for the right kind of
path: file vs. url
type=“String” ibm:type=“password”
The value is a “SerializedProtectedString”,
which is not a String.
©2014 IBM Corporation
Using OSGi Services…
?
BlueprintDeclarative Services
yes, there are others. We focused on these two.
©2014 IBM Corporation
Using OSGi Services… Who in their right mind wants to manage OSGi services themselves??
?
BlueprintDeclarative Services
yes, there are others. We focused on these two.
©2014 IBM Corporation
Using OSGi Services… Who in their right mind wants to manage OSGi services themselves??
Exactly. NOBODY.?
BlueprintDeclarative Services
yes, there are others. We focused on these two.
©2014 IBM Corporation
Declarative ServicesWe chose DS for two main reasons:
Timing: Blueprint and Aries were just getting started
Integration with Configuration Admin and Metatype!
Config injected as one unit
activate/modified/updated methods
Service instance creation based on metatype-declared factory pid
DS target filters can be set via configuration
©2014 IBM Corporation
DS is AWESOME!
DS is a central part of the Liberty runtime
CA + M + DS = “magic”We do insane things with config-derived target filters
Our runtime would not be what it is without DS in the middle of it
©2014 IBM Corporation
But …
©2014 IBM Corporation
Remember this?We need to prevent
THIS
runtime3rd party
bundleB system
bundleA
Application
X
©2014 IBM Corporation
Package privacy
©2014 IBM Corporation
Package privacy
OSGi lets you keep your internals private.
©2014 IBM Corporation
Package privacy
OSGi lets you keep your internals private.
Your externals are public.
©2014 IBM Corporation
Package privacy
OSGi lets you keep your internals private.
Your externals are public.
PublicPrivate
©2014 IBM Corporation
Package privacy
OSGi lets you keep your internals private.
Your externals are public.
PublicPrivate
©2014 IBM Corporation
Granularity
bundle C
bundle Abundle B
©2014 IBM Corporation
Granularitybundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
©2014 IBM Corporation
Granularitybundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
Wait a minute, it wasn’t supposed to be that
public …
©2014 IBM Corporation
Granularitybundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
Wait a minute, it wasn’t supposed to be that
public …
©2014 IBM Corporation
Granularitybundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
©2014 IBM Corporation
Granularitybundle D
bund
le F
bund
le E
bundle G
bundle M
bund
le N
bund
le I
bundle K
bund
le Jbu
ndle O
bund
le P
bund
le N
bund
le L
bundle M
bund
le Q
bundle C
bund
le A
bund
le B
©2014 IBM Corporation
Granularitybundle D
bund
le F
bund
le E
bundle G
bundle M
bund
le N
bund
le I
bundle K
bund
le Jbu
ndle O
bund
le P
bund
le N
bund
le L
bundle M
bund
le Q
bundle C
bund
le A
bund
le BWhat bundles do I
actually need?
©2014 IBM Corporation
Granularitybundle D
bund
le F
bund
le E
bundle G
bundle M
bund
le N
bund
le I
bundle K
bund
le Jbu
ndle O
bund
le P
bund
le N
bund
le L
bundle M
bund
le Q
bundle C
bund
le A
bund
le BWhat bundles do I
actually need?
Could I just have an archive, please?
©2014 IBM Corporation
Granularitybundle D
bund
le F
bund
le E
bundle G
bundle M
bund
le N
bund
le I
bundle K
bund
le Jbu
ndle O
bund
le P
bund
le N
bund
le L
bundle M
bund
le Q
bundle C
bund
le A
bund
le BWhat bundles do I
actually need?
Could I just have an archive, please?
©2014 IBM Corporation
This is not a new requirement
©2014 IBM Corporation
This is not a new requirement
Lots of attempts to solve this problem
©2014 IBM Corporation
This is not a new requirement
Lots of attempts to solve this problem
Eclipse features
©2014 IBM Corporation
This is not a new requirement
Lots of attempts to solve this problem
Eclipse features
Equinox composite bundles
©2014 IBM Corporation
This is not a new requirement
Lots of attempts to solve this problem
Eclipse features
Equinox composite bundles
Apache Aries Enterprise Bundle Archives (.ebas)
©2014 IBM Corporation
This is not a new requirement
Lots of attempts to solve this problem
Eclipse features
Equinox composite bundles
Apache Aries Enterprise Bundle Archives (.ebas)
Liberty features (mark 1)
©2014 IBM Corporation
OSGi Subsystems are AWESOME
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
Liberty uses the Apache Aries implementation
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
Liberty uses the Apache Aries implementation
Granularity
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
Liberty uses the Apache Aries implementation
Granularity
Package isolation
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
Liberty uses the Apache Aries implementation
Granularity
Package isolation
Packaging
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
Liberty uses the Apache Aries implementation
Granularity
Package isolation
Packaging
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
Liberty uses the Apache Aries implementation
Granularity
Package isolation
Packaging
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
Liberty uses the Apache Aries implementation
Granularity
Package isolation
Packaging
©2014 IBM Corporation
When better boxes is not enoughbundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
©2014 IBM Corporation
When better boxes is not enoughbundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
bundle M
©2014 IBM Corporation
When better boxes is not enoughbundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
bundle M
©2014 IBM Corporation
When better boxes is not enoughbundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
bundle M Extension
©2014 IBM Corporation
When better boxes is not enoughbundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
Resolver hook
bundle M Extension
©2014 IBM Corporation
Sophisticated package visibility
Features explicitly declare API and SPI packages (IBM-* metadata in the feature manifest)
Isolation between API/SPI, apps/extensions/runtime is enforced in a few ways:
Subsystems (the Aries impl) for OSGi Applications (API)
Resolver hooks and/or Eclipse Regions for isolation between runtime, extensions (SPI), and containers (API).
©2014 IBM Corporation
Provisioning
©2014 IBM Corporation
Provisioning
Dynamically install features (subsystems) based on configuration
©2014 IBM Corporation
Provisioning
Dynamically install features (subsystems) based on configuration
Adding or removing features …
©2014 IBM Corporation
Provisioning
Dynamically install features (subsystems) based on configuration
Adding or removing features …
installs or uninstalls bundles…
©2014 IBM Corporation
Provisioning
Dynamically install features (subsystems) based on configuration
Adding or removing features …
installs or uninstalls bundles…
which adds or removes configurations…
©2014 IBM Corporation
Provisioning
Dynamically install features (subsystems) based on configuration
Adding or removing features …
installs or uninstalls bundles…
which adds or removes configurations…
which triggers the creation or removal of services!
©2014 IBM Corporation
Provisioning
Dynamically install features (subsystems) based on configuration
Adding or removing features …
installs or uninstalls bundles…
which adds or removes configurations…
which triggers the creation or removal of services!
No restart needed. !
#really
©2014 IBM Corporation
Did we get rid of all the dragons?
©2014 IBM Corporation
Did we get rid of all the dragons?
By Abraham (Own work) CC-BY-3.0 via Wikimedia Commons
©2014 IBM Corporation
Did we get rid of all the dragons?
The OSGi dragon
By Abraham (Own work) CC-BY-3.0 via Wikimedia Commons
©2014 IBM Corporation
Did we get rid of all the dragons?
The OSGi dragon
By Abraham (Own work) CC-BY-3.0 via Wikimedia Commons
©2014 IBM Corporation
What version should this be?
©2014 IBM Corporation
What version should this be?This is ALWAYS a hard problem in any non-trivial evolving system
©2014 IBM Corporation
What version should this be?This is ALWAYS a hard problem in any non-trivial evolving system
OSGi just makes the problem more obvious
©2014 IBM Corporation
What version should this be?This is ALWAYS a hard problem in any non-trivial evolving system
OSGi just makes the problem more obvious
Semantic versioning is …
©2014 IBM Corporation
What version should this be?This is ALWAYS a hard problem in any non-trivial evolving system
OSGi just makes the problem more obvious
Semantic versioning is …
Beautiful
©2014 IBM Corporation
What version should this be?This is ALWAYS a hard problem in any non-trivial evolving system
OSGi just makes the problem more obvious
Semantic versioning is …
Beautiful
Insufficient
©2014 IBM Corporation
What version should this be?This is ALWAYS a hard problem in any non-trivial evolving system
OSGi just makes the problem more obvious
Semantic versioning is …
Beautiful
Insufficient
Our developers never touch versions
©2014 IBM Corporation
What version should this be?This is ALWAYS a hard problem in any non-trivial evolving system
OSGi just makes the problem more obvious
Semantic versioning is …
Beautiful
Insufficient
Our developers never touch versions
That’s what a release team is for :)
©2014 IBM Corporation
How do I interact with X?Let DS do it. Really.
DS is excellent at managing non-trivial service dependencies
It is very unlikely that you will be able to do better— just let DS do it. That means:
Don’t register services inside a component
Don’t manage references inside a component
©2014 IBM Corporation
Why is my test failing intermittently ?
©2014 IBM Corporation
Why is my test failing intermittently ?
Because something hasn’t happened yet.
©2014 IBM Corporation
Service dynamics can hurt!
©2014 IBM Corporation
Service dynamics can hurt!
Service dynamics are a huge hurdle for “new” developers
©2014 IBM Corporation
Service dynamics can hurt!
Service dynamics are a huge hurdle for “new” developers
DI and IoC can turn even experienced brains inside out if they aren’t prepared. Thankfully, they do seem to recover.
©2014 IBM Corporation
Service dynamics can hurt!
Service dynamics are a huge hurdle for “new” developers
DI and IoC can turn even experienced brains inside out if they aren’t prepared. Thankfully, they do seem to recover.
DS helps a LOT
©2014 IBM Corporation
Service dynamics can hurt!
Service dynamics are a huge hurdle for “new” developers
DI and IoC can turn even experienced brains inside out if they aren’t prepared. Thankfully, they do seem to recover.
DS helps a LOT
But …
©2014 IBM Corporation
Service dynamics can still hurt.
©2014 IBM Corporation
Service dynamics can still hurt.
Being really lazy is hard work!
©2014 IBM Corporation
Service dynamics can still hurt.
Being really lazy is hard work!
Easy to make assumptions
©2014 IBM Corporation
Service dynamics can still hurt.
Being really lazy is hard work!
Easy to make assumptions
Service availability
©2014 IBM Corporation
Service dynamics can still hurt.
Being really lazy is hard work!
Easy to make assumptions
Service availability
Event ordering
©2014 IBM Corporation
Service dynamics can still hurt.
Being really lazy is hard work!
Easy to make assumptions
Service availability
Event ordering
Especially in our tests
©2014 IBM Corporation
Is the server started?
©2014 IBM Corporation
Is the server started?
The server
©2014 IBM Corporation
Is the server started?
The server
©2014 IBM Corporation
Is the server started?What does this boundary even mean
in an extensible system?
The server
©2014 IBM Corporation
Is the server started?What does this boundary even mean
in an extensible system?
The server
©2014 IBM Corporation
Is the server started?What does this boundary even mean
in an extensible system?
The server
©2014 IBM Corporation
Is the server started?What does this boundary even mean
in an extensible system?
The server
©2014 IBM Corporation
Is the server started?What does this boundary even mean
in an extensible system?
Care about the services
you care about
©2014 IBM Corporation
What’s the schema for the configuration?
©2014 IBM Corporation
What’s the schema for the configuration?
Devolved configuration is great. But ..
©2014 IBM Corporation
What’s the schema for the configuration?
Devolved configuration is great. But ..
Tolerating unrecognised elements is great when your config is correct.
©2014 IBM Corporation
What’s the schema for the configuration?
Devolved configuration is great. But ..
Tolerating unrecognised elements is great when your config is correct.
It’s not so good when your config is wrong.
©2014 IBM Corporation
What’s the schema for the configuration?
Devolved configuration is great. But ..
Tolerating unrecognised elements is great when your config is correct.
It’s not so good when your config is wrong.
Aggregated documentation is good for users.
©2014 IBM Corporation
What’s the schema for the configuration?
Devolved configuration is great. But ..
Tolerating unrecognised elements is great when your config is correct.
It’s not so good when your config is wrong.
Aggregated documentation is good for users.
Aggregated documentation is (sort of) needed for tooling
©2014 IBM Corporation
What’s the schema for the configuration?
Devolved configuration is great. But ..
Tolerating unrecognised elements is great when your config is correct.
It’s not so good when your config is wrong.
Aggregated documentation is good for users.
Aggregated documentation is (sort of) needed for tooling
We generate an xsd at build-time so tooling can validate user config
©2014 IBM Corporation
Is it worth it?
©2014 IBM Corporation
Is it worth it?OH YES.
©2014 IBM Corporation
Is it worth it?OH YES.
Our server is GREAT.
©2014 IBM Corporation
Is it worth it?OH YES.
Our server is GREAT.
Starts in 3s …
©2014 IBM Corporation
Is it worth it?OH YES.
Our server is GREAT.
Starts in 3s …
… which we never have to do anyway…
©2014 IBM Corporation
Is it worth it?OH YES.
Our server is GREAT.
Starts in 3s …
… which we never have to do anyway…
… because it’s fully dynamic
©2014 IBM Corporation
Is it worth it?OH YES.
Our server is GREAT.
Starts in 3s …
… which we never have to do anyway…
… because it’s fully dynamic
Concise, shareable configuration
©2014 IBM Corporation
Did it all turn out the way we expected?
A funny thing happened while we were developing for developers …
©2014 IBM Corporation
OSGi was designed for …
©2014 IBM Corporation
OSGi was designed for …
Small embedded system
©2014 IBM Corporation
… but turned out to be perfect for …
©2014 IBM Corporation
… but turned out to be perfect for …
©2014 IBM Corporation
Liberty was designed for …
©2014 IBM Corporation
Liberty was designed for …
Developer-scale
©2014 IBM Corporation
… but turned out to be perfect for…
©2014 IBM Corporation
… but turned out to be perfect for…
BIG scale
©2014 IBM Corporation
BlueMix server farm
… but turned out to be perfect for…
BIG scale
©2014 IBM Corporation
BlueMix server farm
… but turned out to be perfect for…
BIG scale
Lots of Liberty instances
©2014 IBM Corporation
Thank you!
Questions?
Oh, and I have a book!
@holly_cummins www.wasdev.net
©2014 IBM Corporation
Backup
©2014 IBM Corporation
</cleanSlate>Of course, we didn’t really get a clean
slate.Application compatibility had to be
preserved. !
©2014 IBM Corporation
Configuration Admin We rolled our own (sorry)
Parse and merge user configuration and bundle-provided defaults
Resolve variables
Provide configuration to consumers as required by the spec (mostly)
©2014 IBM Corporation
Uniform validation of user input
Define configuration and constraints in one place, it gets used everywhere else.
We favor metatype.xml for this reason
Custom namespace for additional types and validators
ibm:type — duration, location, password
pid/reference
unique, final, variable, etc.
Metatype Equinox impl + extensions
http://www-01.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_extensions_osgi_metatype.html
human readable: 1h30m converted to unit of used by developer tools to
help prompt for the right kind of path: file vs. url
©2014 IBM Corporation
Uniform validation of user input
Define configuration and constraints in one place, it gets used everywhere else.
We favor metatype.xml for this reason
Custom namespace for additional types and validators
ibm:type — duration, location, password
pid/reference
unique, final, variable, etc.
Metatype Equinox impl + extensions
http://www-01.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_extensions_osgi_metatype.html
type=“String”ibm:type=“password”
The value is a “SerializedProtectedString”,
which is not a String.
©2014 IBM Corporation
Uniform validation of user input
Define configuration and constraints in one place, it gets used everywhere else.
We favor metatype.xml for this reason
Custom namespace for additional types and validators
ibm:type — duration, location, password
pid/reference
unique, final, variable, etc.
Metatype Equinox impl + extensions
http://www-01.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_extensions_osgi_metatype.html
This is some crazy stuff.
ibm:type=“pid” ibm:reference=“specific.service.pid”
Allows nested configuration elements
to define service relationships
©2014 IBM Corporation
IsolationWe mean this in a good way.
Liberty runtime serves two masters:
Typical Application Server paradigm(apps strictly separated from runtime) — API
Platform extender paradigm(the “app” is the runtime) — SPI
Persistent problem:how to allow apps or extensions to use their own versions of libraries that don't conflict with the runtime!?
©2014 IBM Corporation
Private-package declarations pull in redundant classes
Split packages never end well