Subsystems in the Wild - G Charters

959 views

Published on

Subsystems is an OSGi Alliance specification that standardizes the development and deployment of bundle collections. The specification was motivated by the need for bundle collections exhibited by many existing products & projects, including: Apache Karaf, Apache Aries, Eclipse Virgo, WebSphere Application Server, etc.

Three different types of collections are defined in the specification: feature, composite & application, each having different rules covering sharing of packages and services, and each being designed with different use cases in mind. Subsystems was first introduced in OSGi Enterprise R5 and since then work has continued on further enhancements. This talk will introduce the Subsystems specification, describe some practical use cases, provide demonstrations based on the Apache Aries Reference Implementation, and finally talk a bit about what's coming in the next version.

Bio:
Graham Charters is a Senior Technical Staff Member in the IBM WebSphere Application Server development organization. He is responsible for the OSGi Applications feature of the Application Server and a committer and PMC member of the Apache Aries OSGi programming model project. He is also the IBM technical lead in the OSGi Alliance Enterprise Expert Group.

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
959
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
30
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Subsystems in the Wild - G Charters

  1. 1. © 2014 IBM Corporation OSGi DevCon 2014Wednesday, June 11, 2014 SUBSYSTEMS IN THE WILD Graham Charters Senior Technical Staff Member IBM 1
  2. 2. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Contents • Motivation • Subsystems Overview • Use case “In the Wild” …with a demo or two along the way 2
  3. 3. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Motivation • Many Enterprise Java platforms offer bundle collections • Apache Aries – Applications • Apache Karaf – Features • Eclipse Virgo – Plans, PARs • WebSphere – OSGi Applications, Composite, Features • Oracle GlassFish – Applications • Paremus Service Fabric – System Parts • Standardization enables • Portability • Tools • Ecosystem 3
  4. 4. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Subsystem Concepts • A Grouping Resources (Bundles) • An Identity • Scoping for visibility • Group Management • Documentation (coming in 1.1) 4
  5. 5. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Subsystem Types • Subsystem types aligned with common sharing policies 5 Type Sharing Policy Feature Share everything Application Share everything in, share nothing out Composite Explicit selective sharing
  6. 6. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Feature Subsystems • A grouping of related artefacts • Simplifies re-use & provisioning • Raw resources in the runtime • Useful for frameworks & libraries 6 Bundle A Bundle B Bundle C Bundle D Feature A Feature B
  7. 7. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Feature A Application Subsystems • Isolated group of related artefacts • Share nothing out • Implicitly share all in • Useful for independent applications in same process • cheap/weak multi-tenancy • Can share common infrastructure • e.g. frameworks or libraries 7 Bundle A Bundle B Bundle C Bundle D Application A Application B ✘ ✘
  8. 8. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Composite Subsystems • Isolated group of related artefacts • Explicitly share in • Explicitly share out • Useful for controlling coupling of “subsytems” (hide internals) 8 Feature A Bundle A Bundle B Bundle C Bundle D Composite A Composite B ✘ ✘
  9. 9. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Nesting • Subsystems can be nested • All subsystems are descendants of the “Root Subsystem” • Enables runtime subsystem ‘sharing’ • Enables logical groupings 9 Feature Bundle A Bundle B Bundle D Application Root Bundle C
  10. 10. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Definition • Subsystem manifest format • Jar manifest without the annoying restrictions • Familiar to bundle programmers • Configuration by exception • Can be left out altogether • Version ranges enabled deployment flexibility 10 Subsystem-ManifestVersion: 1.0 Subsystem-Name: HttpService Subsystem-Description: This feature enables the http service Subsystem-SymbolicName: com.acme.httpService Subsystem-Version: 1.0.0 Subsystem-Type: osgi.subsystem.feature Subsystem-Content: httpServiceWab;version="1.0.0", org.eclipse.equinox.http.servlet;version="1.1.200", org.eclipse.osgi.services;version="3.3.0"
  11. 11. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Packaging • Zip file with .esa extension • Optionally contains resources (bundles) for provisioning • duplicates binaries • bloats deployment • inhibits update • does not influence runtime sharing • uses repositories if not • Optionally contains Subsystem manifest • defaulted if not 11 Subsystem.esa Bundle A Bundle C Bundle B Bundle D Subsystem.MF
  12. 12. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Management • Subsystem service • Introspection of subsystem • Lifecycle management of subsystem • Management of child subsystems (e.g. install) • Roots subsystem – solves the bootstrap problem • Really only for systems programmers – runtimes should simplify management capabilities 12 Feature A Bundle A Bundle B Bundle C Bundle D Application A Application B Root
  13. 13. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Repositories • Repositories represent collections of resources considered during provisioning • The Subsystem archive contents • Simplifies operations, bloats deployment • The visible set of installed things • Configured repository services • Enables single binary for install and service • Fits well with ‘continuous delivery’ 13 Subsystem.esa Bundle A Bundle C Bundle B Bundle D Subsystem.MF Feature Bundle A Bundle B Bundle D Application Bundle C Bundle A Bundle C Bundle B Bundle D
  14. 14. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Dependency Management • Installs missing dependencies • Removes redundant dependencies • Dependency installation maximises runtime sharing • Dependency types • Package • Services via declarative models (optional) • Require-Capability 14 Bundle A Bundle B Feature Bundle C Bundle D Application Composite
  15. 15. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 From Test to Production • Product deployment resolution uncertainty • Deployment manifests lock down deployment • Repository and install governance necessary for guarantees 15 Subsystem.esa Bundle A Bundle C Bundle B Bundle D Subsystem.MF Deployment.MF
  16. 16. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Extenders and whiteboards • Extender & whiteboard patterns commonplace • Rely on visibility of bundle & service lifecycle events • Subsystem scoping can hide these events from extenders • The System Bundle is your friend • Sees all events • Can be found by any bundle using its location string • Use this to register trackers 16 Bundle Service Bundle systemBundle = bc.getBundle(org.osgi.framework.Constants.SYSTEM_BUNDLE_LOCATION);
  17. 17. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Demo • httpservice: http service whiteboard • greenWeb, redWeb: register http services • wab-1.0: web container 17 wab-1.0 WebContainer Impl WebContainer API Root (kernel) greenWab greenWeb redWab redWeb httpservice httpServiceWab http.servlet osgi.services “User”
  18. 18. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 In the Wild • Confession time… 18
  19. 19. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Reuse/release equivalence principle • The unit of reuse is the unit of release • A matter of perspective; jar, library, framework, product • Higher levels take on ‘product’ qualities • Licensing • Documentation • Install • Subsystems 1.1 adds many headers for product qualities • Icons, Docs, License, Localization 19
  20. 20. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Use Case • Decomposition of a product into re-usable capabilities • Independent release of product capabilities • Users care about capabilities, not implementation • Users want to consume capabilities piecemeal • ‘Stack’ products re-use subset of capabilities • ‘Stack’ products add their own capabilities 20
  21. 21. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Subsystem Asset Life-cycle 21 Dev, build, test Provision Feature A Bundle A Bundle B Bundle C Bundle D Application A Application B Root Install W.esa X.esa Y.esa Z.esa Repository & Resolver Services Z.esa Y.esa X.esa Release Repository X.esa Doc, license, icon, etc Repository & Resolver Services
  22. 22. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Demo 22
  23. 23. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Summary • The standard way to manage groups of resources • Subsystem ‘types’ defines sharing for most common use cases • Deployment resolution enables sharing of runtime resources • Repositories-based resolution enables sharing of binaries • New 1.1 features enable more ‘product’ and marketplace- like qualities 23
  24. 24. © 2014 IBM Corporation OSGi DevCon 201411 June 2014 Find out more • Reference Implementation: • Subsystems 1.0 https://svn.apache.org/repos/asf/aries/trunk/subsystem/ • Subsystems 1.1 https://svn.apache.org/repos/asf/aries/branches/subsystemsR6/subsystem/ • New Early Draft Specification of OSGi Enterprise Release 6 • http://www.osgi.org/Specifications/Drafts • New OSGi Core Release 6 Specification • http://www.osgi.org/Specifications/HomePage • OSGi Alliance Design Documents • https://github.com/osgi/design 24

×