Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

The Virtual OSGi Framework - Jan Rellermeyer

362 views

Published on

OSGi DevCon 2008

In the last EclipseCon, we presented R-OSGi, a solution for distributed OSGi services. We have shown how dynamic proxy bundles built from the service interfaces and communicating through the R-OSGi protocol can be used to allow one OSGi peer to access services located on another peer.

This time, we will go a significant step further in generalizing the main ideas behind OSGi. The goal is to treat the whole network as a virtual OSGi framework where the location of a specific bundle or service is no longer relevant. Peers can run arbitrary OSGi applications that, instead of running on one machine (OSGi) or on a fixed set of machines (R-OSGi), are located in a virtual computer running the virtual OSGi framework. The framework autonomously and dynamically controls where to place bundles, when and which bundles to replicate, where remote service links should be used.

In this talk, we will discuss the challenges and opportunities of our approach and how this solution can help to build highly-available and fault-tolerant OSGi applications as well as applications operating on federations of ubiquitous devices. Furthermore, we will show how recent extensions to the R-OSGi platform allow even non-Java services to participate in virtual OSGi applications.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

The Virtual OSGi Framework - Jan Rellermeyer

  1. 1. © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 | March 19th 2008 The Virtual OSGi Framework Systems Group Department of Computer Science ETH Zurich 8092 Zurich, Switzerland Invited Researcher of the OSGi Alliance Jan S. Rellermeyer “Inaugural Talk”
  2. 2. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Virtual OSGi? VOSGi? • Unintended name clash • VOSGi is work by Stephane Frenot et. al. • Share services among virtual gateways [Y. Royon, S. Frenot: Un environnement multi-utilisateurs orienté service. In: CFSE 2006] More like OS- Virtualization
  3. 3. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Remember EclipseCon 2007… • R-OSGi • Originally motivated by embedded systems • Service Discovery via SLP R-OSGi Presentation R-OSGi EventAdmin EventAdmin RobotDevice RobotDevice EventHandler Proxy Bundle [J. S. Rellermeyer, G. Alonso, and T. Roscoe: R-OSGi: Distributed Applications Through Software Modularization. In: Middleware 2007] Services were described by SLP Service URLs
  4. 4. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 R-OSGi Today • Point to point • Explicit connections • Service Discovery is an optional part • Closer to OSGi RemoteServiceReferences known after lease exchange Proxy is generated when the service is retrieved by a client More feasible for remote services on the server side. Gives “hints” where to connect to. Already synchronized Transparently “import” the remote service into the local framework
  5. 5. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 R-OSGi as an ECF Remote Service Provider • ECF API on top of R-OSGi • Thereby, non-transparent access on top of a transparent service approach • E.g., asynchronous service invocation DSO on an ECF server Transparent, point to point remote services
  6. 6. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Motivation: Distributed Service Registry • Original R-OSGi Service Discovery • R-OSGi 1.0.0.RCs Pair wise joined Service Registry Still service registry and remote service registry • ECF Generic Provider Server and DSOs • Other possibility: Unified service registry for both local and remote services “The network is the service registry” “Remote Service Registry = union of connected service registries” “Centralized service registry” The Virtual OSGi Framework
  7. 7. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Motivation: Tool for “Orthogonal Distribution” Demo [Jan S. Rellermeyer, Gustavo Alonso, Timothy Roscoe: Building, Deploying, and Monitoring Distributed Applications with Eclipse and R-OSGi. In: Eclipse Technology eXchange (ETX) Workshop (in conjunction with OOPSLA 2007)].
  8. 8. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 How does it work? Proxy Bundle Channel Endpoint Service Channel Endpoint Channel Endpoint Channel Multiplexer
  9. 9. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 The Problem of State • Failover • Load balancing • Real Services are not always stateless. • Couldn’t state be preserved? • Service replicas instead of just copies? Think of the web Task for the middleware The Virtual OSGi Framework
  10. 10. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Motivation: Sensor Nodes as OSGi Services • TMote Sky TI MSP430F1611 microcontroller at up to 8 MHz 10k SRAM, 48k Flash + 1024k serial storage 250kbps 2.4 GHz Chipcon CC2420 IEEE 802.15.4 Wireless Transceiver • Cannot even run an OS Runs TinyOS • But it can be an R-OSGi service… [J.S. Rellermeyer, M. Duller, and G. Alonso. Using Non-Java OSGi Services for Mobile Applications. Demo at: MiNEMA 2008 Workshop in conjunction with EuroSys 2008]. Demo [with Michael Duller]
  11. 11. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Extending the Idea of OSGi Services • C/C++ • CLDC • Over Bluetooth, … [J.S. Rellermeyer, M. Duller, K. Gilmer, D. Maragkos, D. Papageorgiou, and G. Alonso: The Software Fabric for the Internet of Things. In: Internet of Things 2008]. Why should a remote OSGi service have to be written in Java? Would be nice to have this for local services as well The Virtual OSGi Framework
  12. 12. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 What about consuming services • The consumer has to be an OSGi framework • But, … • Couldn’t it be The Virtual OSGi Framework
  13. 13. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 The Virtual OSGi Framework • OSGi on the cloud Have a network full of machines running OSGi Don’t care where they are Don’t care where bundles are installed Don’t care where services are provided Access them from anywhere • Fluid OSGi Have a replica where you need it Read any / write any Bundles and services are becoming virtual Access them transparently From a peer’s perspective, services “flow” through the network
  14. 14. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Architecture • Unifying local and remote services • As an extension, non-invasive against the framework
  15. 15. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Architecture • Unifying local and remote services • As an extension, non-invasive against the framework Equivalent for a peer on the cloud
  16. 16. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Virtualized Module Layer • The Virtual Framework runs as a bundle on the host framework • Virtual Bundles are installed on the host framework • Virtual Bundles are started on the virtual Framework [Dimitrios Papageorgiou] Host framework
  17. 17. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Virtual Bundles • Installation of the bundle • Install on the host framework • Pass back a VirtualBundle instead of the host framework’s Bundle implementation • Starting the bundle • Called through a VirtualBundle • get the Activator from the host framework • Call it with a VirtualBundleContext • Handle the virtual state of the bundle within the virtual framework • Subtile: ensure BundleID consistency
  18. 18. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Distributed Registries • Centralized registries are replaced by a distributed registry • Prototype system: kind of DHT Can store pointers to bundles Supports constraints Can store pointers to services + attributes Supports filters
  19. 19. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Challenges • Mapping the class space model to the DHT •getAllServices becomes a very expensive operation • Maintaining replicas of DHT nodes • Scalability? Can it scale to massively distributed systems? Can it scale to the diameter of the internet? Optimization for resolving Is there a good Tradeoff? Transactional model? Currently not our focus!
  20. 20. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 OceanStore? [J. Kubiatowicz, D. Bindel, Y. Chen, S. Czerwinski, P. Eaton, D. Geels, R. Gummadi, S. Rhea, H. Weatherspoon, W. Weimer, C. Wells, and B. Zhao: OceanStore: An Architecture for Global-Scale Persistent Storage. In: ASPLOS 2000]
  21. 21. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Service Replication • Fluid Replication Place a replica of the service where ever it is needed • Preserve the state between service replicas • Prototype: Communication model through the DHT • Coordinator nodes For update propagation For using different consistency levels within the same virtual framework [Damianos Maragkos]
  22. 22. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 PRACTI? • Partial Replication • Arbitrary Consistency • Topology Independence [N. Belaramani, M. Dahlin, L. Gao, A. Nayate, A. Venkataramani, P. Yalagandula, and J. Zheng: PRACTI Replication. In: NSDI 2006]
  23. 23. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Replication of Services • What is state? Model: Only services have state State is contained in fields • Capturing state? Update propagation Arbitrary consistency • Goal: Transparent replication Run with every OSGi Service Requires no changes
  24. 24. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 OpenTerracotta? • Transparent clustering • Load time instrumentation • Distributed locking [http://www.terracotta.org]
  25. 25. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Instrumentation • Symbolic Execution • Instrumentation to capture fields • Also does distributed locking, distributed thread coordination • Also used for service migration Find out where state is accessed/changed P2P update propagation through group communication Seamless parallelization Can be considered as a temporal replication But we also handle thread migration.
  26. 26. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 What we have now…
  27. 27. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Coordination overhead • Coordinating all the replicas • Affects scalability Duality between Service Replicas and Remote Services
  28. 28. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Outlook: Autonomous Controller [Ramon Küpfer, Dario Simone; starting soon]
  29. 29. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Outlook: Language-independent OSGi • Soon a prototype for Barrelfish (new operating system at ETH) Use the kernel-provided IPC model Provide an application model (derived from OSGi) Optimize for interactions within the same language Provide generic type mappings for heterogeneous apps [with Simon Peter, Adrian Schüpbach, Andrew Baumann, Timothy Roscoe]
  30. 30. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Conclusions • The Virtual OSGi Framework Unifies local and remote services Makes a (dynamic) group of machines appear as a single OSGi framework Allows replication of services for load balancing or to increase failure resilience Runs as a bundle on top of every framework Uses the host framework for module layer operations Intercepts/extends certain operations on the virtualization layer Can relocate bundles/services OSGi on the cluster/cloud
  31. 31. The Virtual OSGi Framework | © 2008 by Jan S. Rellermeyer, ETH Zurich; made available under the EPL v1.0 Welcome to the virtual world! • Questions?

×