SlideShare a Scribd company logo
Copyright © 2005 - 2013 Paremus Ltd.
May not be reproduced by any means without express permission. All rights reserved.
Paremus Packager March 2013
Deploying Heterogeneous Artifacts
to the Cloud with OSGi
Neil Bartlett - Paremus
neil.bartlett@paremus.com
Friday, 29 March 13
Motivation
Good OSGi Bundles are Self-Describing
Dependency Management, Resolving, Provisioning...
Consistent Interface: Bundle Install/Uninstall/Update/Start/
Stop, Config Admin, Metatype, Log Service...
If I Have a Bundle, I Always Know How to Deploy It!
Friday, 29 March 13
Unfortunately...
Not All Software is Built in OSGi (yet). Lots of useful things are
not even Java!
How do we ensure this software is installed where it needs to
go?
Current state-of-the-art: assume it’s already there!
Friday, 29 March 13
Proposal
Wrap Native Artifacts in OSGi Bundles
Tie the Lifecycle. Bundle Start => Launch, etc.
Link to Standard OSGi Services: Configuration Admin,
Metatype, Log Service...
Friday, 29 March 13
Separation of Concerns
1. What and How Should we Run?
2. When, How Many, and How Configured?
3. Actually Run and Monitor It.
Friday, 29 March 13
Separation of Concerns
1. What and How Should we Run? => Package Type
2. When, How Many, and How Configured? => Process Guard
3. Actually Run and Monitor It => Watchdog
Friday, 29 March 13
The PackageType
Usually Contains the Native Parts, or Knows Where to Get
Them
Installs the Native Program
Returns Scripts to the Packager for: start, stop, ping...
Is Platform Specific
Friday, 29 March 13
The PackageType
One Bundle for Each Type/Platform Combo
Use Generic Caps/Reqs, e.g.:
Provide-Capability: packager.type; 
packager.type=mongodb; 
version:Version=2.2.0
Require-Capability: osgi.native; 
filter:=”(& 
(osgi.native.osname=Linux) 
(osgi.native.processor=x86-64) 
)”
Friday, 29 March 13
Example PackageType
@Component(properties = "package.type=mongodb")
public class MongoPackagerUNIX implements PackageType {
	 @Override
	 public PackageDescriptor create(Map<String,Object> properties, File data) throws Exception {
	 	 MongoProperties config = Converter.cnv(MongoProperties.class, properties);
	 	 PackageDescriptor pd = new PackageDescriptor();
	 	 // Expand mongod executable
	 	 File mongod = new File(data, "mongod");
	 	 if (!mongod.isFile()) {
	 	 	 IO.copy(getClass().getResource("/data/mongod"), mongod);
	 	 	 run("chmod a+x " + mongod.getAbsolutePath());
	 	 }
	 	 // Construct the start command
	 	 StringBuilder sb = new StringBuilder().append(mongod.getAbsolutePath());
	 	 if (config.port() != 0)
	 	 	 sb.append(" --port ").append(config.port());
	 	 pd.startScript = sb.toString();
	 	 // ...
	 	 return pd;
	 }
Friday, 29 March 13
The ProcessGuard
Gathers Process Config Properties
Signals When to Start/Stop
Receives State Change Events (started, crashed...)
Advertises the Running Package (Optional)
Friday, 29 March 13
Packager
Manager
MongoDB
Mac OSX
MongoDB
Guard
PackageType
type=mongodb
ProcessGuard
type=mongodb
scripts
config
config
state events
Endpoint
uri=mongodb://10.0.0.1:27017/
service.exported.interfaces=*
Friday, 29 March 13
The ProcessGuard
1. Published Service Means “Start the Process”
2. Packager Calls getProperties() to get Config
3. Passes Config to PackageType, gets Script
4. Unpublished Service Means “Stop the Process”
Friday, 29 March 13
ProcessGuard Dependencies
Use Declarative Services to Easily Create Dependencies for the
Package
E.g. Required Configuration
Can Also Use Service References...
Friday, 29 March 13
Example ProcessGuard
	 @Reference(target = "(uri=http://*/rest)", type='*')
	 void setRestService(Endpoint ep, Map<String, String> props) throws Exception {
	 	 this.restSvcUri = new URI(props.get("uri"));
	 }
Friday, 29 March 13
Publishing an Endpoint
Guard can Optionally Publish an Endpoint Service
Just a Marker Interface with a URI Property, e.g.: mongodb://
10.0.0.1:27017/
Use OSGi Remote Services (RSA) Discovery to Publish Across
the Network
Friday, 29 March 13
Mongo
Client
mongodb://10.0.0.1/
mongodb://10.0.0.2/
mongodb://10.0.0.3/
OSGiRemoteServices(RSA)Discovery
Friday, 29 March 13
Consuming Endpoints
Guards can be Endpoint Consumers as Well
Example, Nginx
Friday, 29 March 13
Nginx Load
Balancer
Web
Server
Web
Server
Web
Server
Web
Server
request
forward
Friday, 29 March 13
Nginx
ProcessGuard
Friday, 29 March 13
Nginx
Guard Tracks Endpoints with a DS Multiple/Dynamic Reference
PackageType Rewrites Nginx Config and Sends a UNIX Signal
Friday, 29 March 13
Watchdog
Java Program that Sits Between OSGi and Native Package
Execs Native as a Child Process
Death of Watchdog => Death of Native Package
Heartbeat UDP Between OSGi and Watchdog
Friday, 29 March 13
Native ProcessOSGi Application Watchdog
heartbeat exec
Friday, 29 March 13
Watchdog
Must Be as Simple As Possible!
Mustn’t Crash
Might Need Elevated Privileges (e.g. setuid)
Friday, 29 March 13
DEMO...
REST
Service
Library
Impl
Library
MongoDB
Mongo
Guard
Endpoint
Friday, 29 March 13
Tooling
Bndtools Highly Recommended
Project Templates Coming Soon...
It’s Just Plain Declarative Services!
Friday, 29 March 13
Conclusion
Friday, 29 March 13
Availability
API is Open Source (EPL): github.com/bndtools/bndtools-rt/
Paremus implementation releasing later this week, stay tuned:
http://blogs.paremus.com
Register interest: info@paremus.com
Examples: MongoDb, Mosquitto, Nginx, Derby, Custom Play
App
In progress: RabbitMQ, Riak
Friday, 29 March 13

More Related Content

PDF
Setting up iSCSI Providers and Clients in openSUSE
PDF
Testing with MySQL embedded
PDF
Introduction to rust
PDF
RabbitMQ Server - cheat sheet -
ODP
How to access your FIWARE Lab Instance.
PDF
Tech talk Introduction to containers
PDF
Data encryption on azure VMs' Disks
TXT
Openstack
Setting up iSCSI Providers and Clients in openSUSE
Testing with MySQL embedded
Introduction to rust
RabbitMQ Server - cheat sheet -
How to access your FIWARE Lab Instance.
Tech talk Introduction to containers
Data encryption on azure VMs' Disks
Openstack

What's hot (13)

TXT
Install mongo db on centos
PDF
Solaris 11 base box for Vagrant using Packer
PDF
仮想化環境におけるバイナリー・ポータビリティの考察 (WebAssemblyの場合)
KEY
Why Bundler 1.1 will be much faster
PDF
MQTTS mosquitto - cheat sheet -
PDF
SGI OpenFOAM Cloud Benchmark, OpenFOAM Study Meeting for beginner@Kansai, 7th...
PDF
How to install OpenStack MITAKA --allinone - cheat sheet -
DOCX
Solaris mysql sop
PPTX
Tutorial to make sure of nginx files starterpack.
PDF
EuroBSDCon 2021 - (auto)Installing BSD Systems
PPTX
Great Hiroshima with Python 170830
PDF
How to Install Ghost (CMS) MEMO
PDF
pkgsrc 2014 - the record of the past year
Install mongo db on centos
Solaris 11 base box for Vagrant using Packer
仮想化環境におけるバイナリー・ポータビリティの考察 (WebAssemblyの場合)
Why Bundler 1.1 will be much faster
MQTTS mosquitto - cheat sheet -
SGI OpenFOAM Cloud Benchmark, OpenFOAM Study Meeting for beginner@Kansai, 7th...
How to install OpenStack MITAKA --allinone - cheat sheet -
Solaris mysql sop
Tutorial to make sure of nginx files starterpack.
EuroBSDCon 2021 - (auto)Installing BSD Systems
Great Hiroshima with Python 170830
How to Install Ghost (CMS) MEMO
pkgsrc 2014 - the record of the past year
Ad

Viewers also liked (20)

PPTX
Virus y vacunas informáticas
PPS
Onde nasceu jesus (autoria desconhecida)
PDF
r57_9_brochure_bts_bio
PPTX
PPTX
Better burger
PPTX
Presentación1
DOCX
Review booster magento extension
PDF
Programacion cc tiendas
PDF
Cloud & OSGi - The Dawn of Composite Clouds (Now with demo videos)
PDF
From Distributed to Pervasive OSGi
PDF
Paremus Cloud and OSGi Beyond the VM - OSGi Cloud Workshop March 2012
PDF
Robust collaboration services with OSGi - Satya Maheshwari
PDF
Lessons learned from a large scale OSGii web app - P Bakker & J de Vreede
PDF
OSGi Cloud Ecosystems
PDF
Cloudy with a Chance of Bundles (and non java components) - R Nicholson & T Ward
PDF
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
PDF
Eclipse Gyrex OSGi based PaaS-Like Programming Stack - OSGi Cloud Workshop Ma...
DOCX
Sermina hoàn thành
PPTX
Building Open-Source React Components
PDF
Using OSGi as a Cloud Platform - Jan Rellermeyer
Virus y vacunas informáticas
Onde nasceu jesus (autoria desconhecida)
r57_9_brochure_bts_bio
Better burger
Presentación1
Review booster magento extension
Programacion cc tiendas
Cloud & OSGi - The Dawn of Composite Clouds (Now with demo videos)
From Distributed to Pervasive OSGi
Paremus Cloud and OSGi Beyond the VM - OSGi Cloud Workshop March 2012
Robust collaboration services with OSGi - Satya Maheshwari
Lessons learned from a large scale OSGii web app - P Bakker & J de Vreede
OSGi Cloud Ecosystems
Cloudy with a Chance of Bundles (and non java components) - R Nicholson & T Ward
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
Eclipse Gyrex OSGi based PaaS-Like Programming Stack - OSGi Cloud Workshop Ma...
Sermina hoàn thành
Building Open-Source React Components
Using OSGi as a Cloud Platform - Jan Rellermeyer
Ad

Similar to Deploying Heterogeneous Artifacts to the Cloud with OSGi - Neil Bartlett (20)

PDF
OSGi Presentation
PDF
OSGi introduction
PDF
Open Services Gateway Initiative (OSGI)
PDF
Managing Installations and Provisioning of OSGi Applications - Carsten Ziegeler
PDF
OSGi tech session
PDF
OSGi Community Event 2010 - OSGi Technical Update
PDF
Automating Mendix application deployments with Nix
PDF
Bndtools and Maven: A Brave New World - N Bartlett & T Ward
KEY
First Touch with OSGi
PPTX
What is os gi and what does osgi
PPTX
PPT
OSGi & Blueprint
PDF
An Open Source OSGi Plug-In for Eclipse - Mikaël Desertot, University of Gre...
PDF
Tuscany : Applying OSGi After The Fact
KEY
OSGi in 5 minutes
PDF
Best Practices for Enterprise OSGi Applications - Emily Jiang
PPTX
Oracle Solaris 11 - Best for Enterprise Applications
PDF
OSGi user forum dc metro v1
PDF
OSGi User Forum US DC Metro
PDF
Osgi Sun 20080820
OSGi Presentation
OSGi introduction
Open Services Gateway Initiative (OSGI)
Managing Installations and Provisioning of OSGi Applications - Carsten Ziegeler
OSGi tech session
OSGi Community Event 2010 - OSGi Technical Update
Automating Mendix application deployments with Nix
Bndtools and Maven: A Brave New World - N Bartlett & T Ward
First Touch with OSGi
What is os gi and what does osgi
OSGi & Blueprint
An Open Source OSGi Plug-In for Eclipse - Mikaël Desertot, University of Gre...
Tuscany : Applying OSGi After The Fact
OSGi in 5 minutes
Best Practices for Enterprise OSGi Applications - Emily Jiang
Oracle Solaris 11 - Best for Enterprise Applications
OSGi user forum dc metro v1
OSGi User Forum US DC Metro
Osgi Sun 20080820

More from mfrancis (20)

PDF
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
PDF
OSGi and Java 9+ - BJ Hargrave (IBM)
PDF
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
PDF
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
PDF
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
PDF
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
PDF
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
PDF
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
PDF
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
PDF
OSGi CDI Integration Specification - Ray Augé (Liferay)
PDF
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
PDF
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
PDF
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
PDF
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
PDF
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
PDF
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
PDF
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
PDF
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
PDF
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
PDF
How to connect your OSGi application - Dirk Fauth (Bosch)
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
OSGi and Java 9+ - BJ Hargrave (IBM)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
OSGi CDI Integration Specification - Ray Augé (Liferay)
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
How to connect your OSGi application - Dirk Fauth (Bosch)

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPT
Teaching material agriculture food technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
cuic standard and advanced reporting.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
KodekX | Application Modernization Development
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Digital-Transformation-Roadmap-for-Companies.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Teaching material agriculture food technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Reach Out and Touch Someone: Haptics and Empathic Computing
cuic standard and advanced reporting.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Unlocking AI with Model Context Protocol (MCP)
Understanding_Digital_Forensics_Presentation.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Building Integrated photovoltaic BIPV_UPV.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KodekX | Application Modernization Development
20250228 LYD VKU AI Blended-Learning.pptx
Network Security Unit 5.pdf for BCA BBA.
sap open course for s4hana steps from ECC to s4
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Deploying Heterogeneous Artifacts to the Cloud with OSGi - Neil Bartlett