You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by David Bosschaert <da...@gmail.com> on 2015/10/15 12:02:49 UTC

[Discuss] Support for OSGi subsystems in slingstart?

Hi all,

Slingstart provisioning is a nice way to provision and launch
applications - I've even used it for non-sling based ones :)

One thing that would be nice is to add subsystem support. Especially
application/composite subsystems would be quite useful to support as
they provide a layer of isolation.

So I started looking into what would need to be done for subsystem support...

The provisioning model needs to be enhanced so that subsystems can be
specified there. I have started an initial prototype that enhances the
feature in the model with a type so that this can be recorded:
https://issues.apache.org/jira/browse/SLING-5148

Then the slingstart-maven-plugin must be enhanced to process these
subsystems from the model. Instead of individual bundles, it creates
an .esa file from the artifacts and places the .esa file in the
generated launchpad archive. I've added a prototype for this here:
https://issues.apache.org/jira/browse/SLING-5149

Finally the runtime side needs to be enhanced to pick up the .esa file
from the launchpad archive and install it using the Subsystem service,
for this an OSGi subsystems runtime must be available in the sling
runtime. I haven't added JIRAs for this yet, as I need to look into
the details of this a little more...

What do people think? If we agree to go ahead with this I will finish
off the patches, provide unit tests and add the additional JIRAs for
the runtime side...

Cheers,

David

Re: [Discuss] Support for OSGi subsystems in slingstart?

Posted by David Bosschaert <da...@gmail.com>.
Thanks for the positive feedback :)

I see that the Sling OSGi Installer already supports subsystems via
org.apache.sling.installer.factory.subsystems so I think the only
other thing to do is to add the requires Subsystem bundles to the
launchpad. I've created
https://issues.apache.org/jira/browse/SLING-5165 for that.

I'll work on the relevant issues and plan to provide more complete
patches than the initial ones I did soon.

Best regards,

David

On 15 October 2015 at 14:55, Carsten Ziegeler <cz...@apache.org> wrote:
> Am 15.10.15 um 15:41 schrieb Robert Munteanu:
>> On Thu, 2015-10-15 at 11:02 +0100, David Bosschaert wrote:
>>>
>>> What do people think? If we agree to go ahead with this I will finish
>>> off the patches, provide unit tests and add the additional JIRAs for
>>> the runtime side...
>>
>> +1 sounds good to me.
>>
> Same here!
>
> Carsten
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziegeler@apache.org

Re: [Discuss] Support for OSGi subsystems in slingstart?

Posted by Carsten Ziegeler <cz...@apache.org>.
Am 15.10.15 um 15:41 schrieb Robert Munteanu:
> On Thu, 2015-10-15 at 11:02 +0100, David Bosschaert wrote:
>>
>> What do people think? If we agree to go ahead with this I will finish
>> off the patches, provide unit tests and add the additional JIRAs for
>> the runtime side...
> 
> +1 sounds good to me.
> 
Same here!

Carsten
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: [Discuss] Support for OSGi subsystems in slingstart?

Posted by Robert Munteanu <ro...@apache.org>.
On Thu, 2015-10-15 at 11:02 +0100, David Bosschaert wrote:
> 
> What do people think? If we agree to go ahead with this I will finish
> off the patches, provide unit tests and add the additional JIRAs for
> the runtime side...

+1 sounds good to me.

Thanks,

Robert

Re: [Discuss] Support for OSGi subsystems in slingstart?

Posted by Oliver Lietz <ap...@oliverlietz.de>.
On Monday 19 October 2015 15:40:31 David Bosschaert wrote:
> Hi Oliver,

Hi David,

> On 19 October 2015 at 15:21, Oliver Lietz <ap...@oliverlietz.de> wrote:
> >> While doing that, if you think of changes that need to be made to our
> >> other launchers (Karaf, Crankstart) to support subsystems it would be
> >> nice to list them somewhere, jira tickets maybe.
> > 
> > It should be sufficient to install the subsystems feature from the
> > enterprise features repository in Karaf.
> > 
> > David, can you outline some use cases?
> > 
> > I think there will be some limitations for applications because of
> > isolation, e.g. picking up services from scripts in the repository.
> 
> OSGi Subsystems are defined in the OSGi Subsystem spec (chapter 134 of
> the Enterprise spec [1]). In short, there are currently 3 types of
> subsystems:
> 1. Features - all bundles in these are shared as if they were
> installed normally. Feature subsystems are effectively just a
> deployment vehicle that make it easy to deploy an application built up
> of a lot of bundles.
> 2. Applications - this type of subsystem isolates the bundles inside
> the subsystem to not export any packages or services outside of it.
> 3. Composites - these have configurable isolation. This means that you
> can export/import some packages or some services but not all. What is
> precisely exported or imported is configured explicitly.
> So depending on what you want to do, you pick the subsystem type that
> fits :) If Sling needs to see your service then an application
> subsystem is probably not good, because it doesn't export the service,
> but a composite subsystem might be useful if you don't want to leak
> any internal services to the outside...

I'm aware of these different types thanks to your blog posts and presentations 
on this topic 8D. But I think we should give Sling's users some hints with 
examples when to use which type (in Sling's context). Our documentation has 
much room for improvements and my intention is to gather information to 
provide better documentation at least for new stuff coming.

Regards,
O.

> Cheers,
> 
> David
> 
> [1] http://www.osgi.org/Download/Release6


Re: [Discuss] Support for OSGi subsystems in slingstart?

Posted by David Bosschaert <da...@gmail.com>.
Hi Oliver,

On 19 October 2015 at 15:21, Oliver Lietz <ap...@oliverlietz.de> wrote:
>> While doing that, if you think of changes that need to be made to our
>> other launchers (Karaf, Crankstart) to support subsystems it would be
>> nice to list them somewhere, jira tickets maybe.
>
> It should be sufficient to install the subsystems feature from the enterprise
> features repository in Karaf.
>
> David, can you outline some use cases?
>
> I think there will be some limitations for applications because of isolation,
> e.g. picking up services from scripts in the repository.

OSGi Subsystems are defined in the OSGi Subsystem spec (chapter 134 of
the Enterprise spec [1]). In short, there are currently 3 types of
subsystems:
1. Features - all bundles in these are shared as if they were
installed normally. Feature subsystems are effectively just a
deployment vehicle that make it easy to deploy an application built up
of a lot of bundles.
2. Applications - this type of subsystem isolates the bundles inside
the subsystem to not export any packages or services outside of it.
3. Composites - these have configurable isolation. This means that you
can export/import some packages or some services but not all. What is
precisely exported or imported is configured explicitly.
So depending on what you want to do, you pick the subsystem type that
fits :) If Sling needs to see your service then an application
subsystem is probably not good, because it doesn't export the service,
but a composite subsystem might be useful if you don't want to leak
any internal services to the outside...

Cheers,

David

[1] http://www.osgi.org/Download/Release6

Re: [Discuss] Support for OSGi subsystems in slingstart?

Posted by Oliver Lietz <ap...@oliverlietz.de>.
On Thursday 15 October 2015 14:01:58 Bertrand Delacretaz wrote:
> Hi,
> 
> On Thu, Oct 15, 2015 at 12:02 PM, David Bosschaert
> 
> <da...@gmail.com> wrote:
> > ...If we agree to go ahead with this I will finish
> > off the patches, provide unit tests and add the additional JIRAs for
> > the runtime side...
> 
> That sounds good to me, being able to use subsystems is useful.

Agree.

> While doing that, if you think of changes that need to be made to our
> other launchers (Karaf, Crankstart) to support subsystems it would be
> nice to list them somewhere, jira tickets maybe.

It should be sufficient to install the subsystems feature from the enterprise 
features repository in Karaf.

David, can you outline some use cases?

I think there will be some limitations for applications because of isolation, 
e.g. picking up services from scripts in the repository.

Regards,
O.

> -Bertrand


Re: [Discuss] Support for OSGi subsystems in slingstart?

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

On Thu, Oct 15, 2015 at 12:02 PM, David Bosschaert
<da...@gmail.com> wrote:
> ...If we agree to go ahead with this I will finish
> off the patches, provide unit tests and add the additional JIRAs for
> the runtime side...

That sounds good to me, being able to use subsystems is useful.

While doing that, if you think of changes that need to be made to our
other launchers (Karaf, Crankstart) to support subsystems it would be
nice to list them somewhere, jira tickets maybe.

-Bertrand