You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by Rupert Westenthaler <ru...@gmail.com> on 2011/03/28 11:45:33 UTC

Proposal: Implementation of the Stanbol Configuration Management based on the Sling Installer (was: Default OSGi configs (was: Redesigning the Entityhub Configuration))

Hi all

I am currently evaluating if we could use the Sling Installer to
handle all the various configuration data needed by the different
Stanbol components e.g.
 - open NLP models
 - Solr Indexes for the Entityhub
 - Knowledge Bases (thinking of a Jena TDB Triple Stores with data)
 - maybe even Kres Ontologies, Rules  ... ?!

The Sling Installer provides a plug-in system for "Sling installer
factories". Currently there is only a single implementation that
handles configuration files [1] but as far as I can currently tell it
should be possible to create your own implementation that could
install configurations as mentioned in the above list.

Managing the Configuration by the user would be very easy. By adding
the "org.apache.sling/org.apache.sling.installer.provider.file" bundle
a "installer" directory is created in the "sling.home" directory. This
directory could be used to add/update/remove configurations.

Within the launcher we would need to add such data within the
"resources/install" folder. The Sling Lauchpad will parse such
resource to the Sling Installer as Installable Resource with the type
"InstallableResource.TYPE_FILE".

A final Question:

Is there a possibility that the Sling Installer also processes
resources within deployed bundles. Because sometimes it would be even
more convenient to combine a set of configurations to a single bundle
(e.g. a local index of dbPedia + the Service configuration to start
the SolrYard for this index). Also within the Launcher Project it
would be easier to use a bundle (at let mvn do all the downloading) as
to manually copy the required data into the "resources/install"
folder.

Here an example describing such an use case in more details:
Lets assume a bundle that contains the following
"resources/config/" -> some config files that init the needed OSGI components
"resrouces/install" -> some files that need to be installed. The
correct Stanbol Installer Factory is called by evaluating the
extension

Now the user drops this Bundle into the "/sling/installer" folder
(1) Sling installs the new Bundle
(2) Sling recognizes that this Bundle contains some resources it needs
to process
(3) Sling parses the files within the "resources/install" folder to
the Stanbol Installer Factory
(4) Sling parses the files within the "resources/install" to [1]. By
that way the needed Services are created by using the
ConfigAdminService

My question is if Sling already provides some functionality for (2).


I would like to have some feedback about this proposal. I there is the
opinion that something like that would make sense I will create an
Issue and implement a first demonstrator.

WDYT
Rupert Westenthaler

[1] http://svn.apache.org/viewvc/sling/trunk/installer/factories/configuration/
[2] http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/


---------- Forwarded message ----------
From: Bertrand Delacretaz <bd...@apache.org>
Date: Fri, Mar 4, 2011 at 6:06 PM
Subject: Re: Default OSGi configs (was: Redesigning the Entityhub Configuration)
To: stanbol-dev@incubator.apache.org


On Thu, Mar 3, 2011 at 9:16 AM, Rupert Westenthaler <rw...@apache.org> wrote:
> On Wed, Mar 2, 2011 at 3:59 PM, Bertrand Delacretaz
> <bd...@apache.org> wrote:
>> ...Using Sling's org.apache.sling.launchpad.installer bundle, configs
>> included as text files in the runnable jar, under resources/config,
>> are installed at startup...
>...
> +1 This would be the preferred solution to provide the configuration of the
> core components for the Entityhub...

Ok, I have added an example config to the enhancer launcher in
http://issues.apache.org/jira/browse/STANBOL-110 including a test that
verifies its presence.

To add similar configs in other launchers you'll need to add a few
Sling utility bundles, see
http://svn.apache.org/viewvc?view=revision&revision=1078044

-Bertrand



-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Re: Proposal: Implementation of the Stanbol Configuration Management based on the Sling Installer (was: Default OSGi configs (was: Redesigning the Entityhub Configuration))

Posted by Rupert Westenthaler <ru...@gmail.com>.
On Mon, Mar 28, 2011 at 12:11 PM, Bertrand Delacretaz
<bd...@apache.org> wrote:
> Hi,
>
> On Mon, Mar 28, 2011 at 11:45 AM, Rupert Westenthaler
> <ru...@gmail.com> wrote:
>> I am currently evaluating if we could use the Sling Installer to
>> handle all the various configuration data needed by the different
>> Stanbol components e.g....
>
> I think that would work fine, we already have the required Sling
> bundles in our launcher so not much is needed.
>
>> ...Is there a possibility that the Sling Installer also processes
>> resources within deployed bundles...
>
> There's nothing OOTB in Sling, but we'd just need to implement a
> service that talks to the OsgiInstaller [1] to install, update and
> remove configs when bundles come and go.
>
> The OSGi extender pattern [2] can be used for this: a BundleListener
> listens to bundle states change, and reads the bundle headers to
> locate the configuration resources.
>
That s nice Idea to use a Bundle Header to 1. indicate that the bundle
need to be processed and 2. to get the directory used to load the
config form the bundle as value for that key.
The remaining stuff should be easy to implement , because it will be
very similar to the file based solution.

thx
Rupert

> -Bertrand
>
> [1] http://svn.apache.org/repos/asf/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/OsgiInstaller.java
> [2] http://www.aqute.biz/Snippets/Extender
>



-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Re: Proposal: Implementation of the Stanbol Configuration Management based on the Sling Installer (was: Default OSGi configs (was: Redesigning the Entityhub Configuration))

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Mon, Mar 28, 2011 at 11:45 AM, Rupert Westenthaler
<ru...@gmail.com> wrote:
> I am currently evaluating if we could use the Sling Installer to
> handle all the various configuration data needed by the different
> Stanbol components e.g....

I think that would work fine, we already have the required Sling
bundles in our launcher so not much is needed.

> ...Is there a possibility that the Sling Installer also processes
> resources within deployed bundles...

There's nothing OOTB in Sling, but we'd just need to implement a
service that talks to the OsgiInstaller [1] to install, update and
remove configs when bundles come and go.

The OSGi extender pattern [2] can be used for this: a BundleListener
listens to bundle states change, and reads the bundle headers to
locate the configuration resources.

-Bertrand

[1] http://svn.apache.org/repos/asf/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/OsgiInstaller.java
[2] http://www.aqute.biz/Snippets/Extender