Friday, April 7, 2006

The Bundle Repository

First, if you go to JavaOne, get your calendar and not the following information:

  • Wednesday, May 17 10:30 PM 50 Franciscan II & IIIComponent Programming with OSGi

  • Thursday, May 18, 08:30 PM 50 Esplanade 304/306The OSGi Service Architecture, From Embedded to Enterprise

I sure hope to see you there! While we are at it, the OSGi Alliance organizes a webinar. This webinar will take place at Thursday, April 20, 2006, 9:30 AM - 11:00 AM US Eastern time. The webinar will provide updates on: Plans for upcoming and future OSGi technology releases, OSGi technology with JSR 291, Dynamic Component Support for Java™ SE, Expanding OSGi Alliance participation: new Adopter Associates class of membership, and OSGi Alliance leveraging of open source.

Time for the real stuff! The OSGi Alliance has been working on a Bundle Repository for the last few months. A bundle repository is a natural extension to the OSGi Alliance because they want to promote a bundle market. Markets perform best when they are transparent; a searchable repository provides for this transparency. A bundle repository is not a new idea; Richard S. Hall pioneered a repository with his Oscar Bundle Repository (OBR). OBR was an XML based federated repository combined with a tool that could run on any Framework. The tool made it very easy to manage a framework installation from within the framework itself. Richard has helped us develop the version we are introducing today. He is also working inside Apache Felix to make a compatible bundle repository application.

The most visible part of the repository is the web based interface. You can search for bundles, which are then presented in a list. You can select a number of bundles and resolve these bundles. Resolving the bundles means that their dependencies are used to find other bundles that can resolve those dependencies. This will give you a nice list of bundles that you can download and install. When you hover over the link of a bundle, you see the description. Clicking on the link gives more detailed information. This window also contains comments and if you wish, you can add new comments. The web based interface enables you to brows the repository at your leisure. Richard Hall will soon make an updated version of OBR available that uses this repository.

From a technical point of view I think the repository is quite interesting. We have used a very generic capability-requirements model. This model is partly derived from JSR 124: J2EETM Client Provisioning Specification but is simpler and more powerful. Each bundle (resource as we call it, we can also handle other things than bundles) has a set of capabilities (property sets) and requirements, which are extended OSGi filters. A resource has a set of mandatory or optional requirements. Requirements can require a single instance out of many, or it can actually use many. The Bundle Repository is not an OSGi standard specification; it is only a utility provided by the OSGi Alliance. However, we have described the format and requirements in an RFC that is publicly available. This RFC also contains an API to access a repository locally. Richard Hall’s OBR tool will use this API (which, again, is not part of the OSGi specifications).

Currently the repository contains over 700 bundles from ProSyst, Eclipse, the old Oscar repository, and some of mine. The goal of this repository is to become the central clearing house for bundles. We are therefore very interested in parties that are willing to become part of the OSGi Bundle Repository. Participating is rather easy; you will have to host a repository.xml file and your bundles on any host. Creation of this XML can be done in several ways. The hardest way is to hand code it, I do not recommend that approach. You can write your own program to generate the file, however, we have also written a generic one for you. The bindex utility is a small Java program that can traverse a directory and generate the repository.xml file from the manifest in the bundles. If your manifest is nicely formatted (description, license, etc) then you get a very expressive repository file. You can send the URL for this repository to me. After we verified that you are a legitimate company or person we will add this to our main repository.

As a note, the repository and the web based interface are hosted on an OSGi Framework running on bundles.osgi.org, we are surely eating our own dog food. The software has been written from scratch. I am very interested in feedback around this repository. Please send me your ideas of how to extend the repository, or to get rid of the inevitable bugs. You can use our bugzilla or you can mail me.

Enjoy!

Peter Kriens

5 comments:

  1. Peter,

    What's the best way to get bundles added to the repository? Should I log them in BugZilla?

    I've just spent hours bundleizing a whole load of open source projects (eg Apache Commons, Spring, JDOM etc) for my project, and I'd like to save somebody else the effort of doing it again!

    - Neil

    ReplyDelete
  2. You have to host your bundles on your own site and then generate an index with the bindex utility:

    http://bundles.osgi.org/build/jar/bindex.jar

    You then have to send the URL of the index file to me.

    Looking forward to your URL!

    Peter Kriens

    ReplyDelete
  3. Peter,

    Where can I find the programmatic access api which can talk to OBR(OSGi Bundle Repository) for deploying some bundles?
    I am looking for the bundle which provides the way of programmatic access to OBR in a osgi framework.
    I saw there existed "bundlerepository" bundle before in OSCAR Bundle Repository (I guess which is the predecessor of current proposed OBR (OSGi Bundle Repository) but seems they both are using different format of "repostiory.xml". The reason why I am asking like this is that I saw there exist "bindex" utility which helps to generate repostiory.xml for OBR(OSGi Bundle Repository) format, but I can't find the programmatic way for deploying bundle from there.
    Any suggestion on this?
    Thanks in advnace.

    - Changwoo Jung

    ReplyDelete
  4. Unfortunately it isn't clear for me, how can I get the URL of the XML repository index file. (I would like to use it from felix console, with orb add-url command.)

    ReplyDelete
  5. Changwoo: Look at the Apache Felix OBR stuff. They handle the new OBR as a bundle

    Géza: The following URL gives access to the whole OSGi bundle repository:

    http://www.osgi.org/obr/browse?cmd=repository&_xml=1

    However, this is quite huge, please cache it and reuse it to not overload the server.

    Kind regards,

    Peter Kriens

    ReplyDelete

Blog Archive