You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by Tommaso Teofili <to...@gmail.com> on 2010/03/03 15:03:29 UTC

Sandbox OSGi runtime

Hi all,
what do you think of a uimaj module similar to uimaj-ep-runtime just for
sandbox components (something like sanxbox-osgi-runtime)?
This is useful when you want to use Sandbox components in an OSGi
environment.
Cheers.
Tommaso

Re: Sandbox OSGi runtime

Posted by Tommaso Teofili <to...@gmail.com>.
2010/4/4 Marshall Schor <ms...@schor.com>

>
> +1.  I think there is a (slowly?) growing interest in OSGi - see, for
> instance, the latest info in the apache felix project [1] and in
> particular, the newer, possibly unreleased subprojects [2].  There are
> efforts there in the Apache Felix Commons subproject  [3] to do more or
> less what you are trying to do here - it would be good to confirm these
> approaches are aligned :-).


2010/4/21 Tommaso Teofili <to...@gmail.com>

> 2010/4/14 Jörn Kottmann <ko...@gmail.com>
>
>>
>> In my opinion we shouldn't advertise OSGi support since key features
>> of UIMA cannot be used flawlessly in an OSGi environment right now.
>>
>>
> Hi,
> I would like to wait for new (parent) POMs as Marshall is working on them
> and then put sandbox annotators bundles POMs with new "parents" inside a
> separate project in the sandbox so that the community can start looking at
> and using them.
> Jorn, do you already have in mind which features could be difficult to use
> in an OSGi environment and why?
> Do you think we should wait before we get in touch with Felix Commons to
> advertise our effort on OSGi?
> Cheers.
> Tommaso
>

I think it's time to have this work on the Sandbox so that we can "play"
with it, without advertising OSGi support but starting to actually face
issues (if any) ;-)
What do you think?
Cheers,
Tommaso

Re: Sandbox OSGi runtime

Posted by Tommaso Teofili <to...@gmail.com>.
2010/4/14 Jörn Kottmann <ko...@gmail.com>
>
>
> In my opinion we shouldn't advertise OSGi support since key features
> of UIMA cannot be used flawlessly in an OSGi environment right now.
>
>
Hi,
I would like to wait for new (parent) POMs as Marshall is working on them
and then put sandbox annotators bundles POMs with new "parents" inside a
separate project in the sandbox so that the community can start looking at
and using them.
Jorn, do you already have in mind which features could be difficult to use
in an OSGi environment and why?
Do you think we should wait before we get in touch with Felix Commons to
advertise our effort on OSGi?
Cheers.
Tommaso

Re: Sandbox OSGi runtime

Posted by Jörn Kottmann <ko...@gmail.com>.
Tommaso Teofili wrote:
> Nice one!
> It seems a nice effort from the Felix community and it looks like it's
> perfectly aligned with what we are trying to do (a POM with a dependency on
> the library to bundle and the  Maven Felix plugin for the configuration of
> the bundle), so we may choose one of two ways: contribute such POMs to Felix
> Commons (but we'd need to change the group-id to org.apache.felix.commons) or
> have them deployed inside our SVN and "linked" (having UIMA listed as one of
> the supporting libraries) to the Felix Commons project.
> Since we already have OSGi versions of core framework inside our SVN to
> support Eclipse plugins we may go for the second option.
> So if we agree I could start a thread on Felix ML to let them know about
> this effort.
> What do you think?
>   

In my opinion we shouldn't advertise OSGi support since key features
of UIMA cannot be used flawlessly in an OSGi environment right now.

Jörn


Re: Sandbox OSGi runtime

Posted by Tommaso Teofili <to...@gmail.com>.
Nice one!
It seems a nice effort from the Felix community and it looks like it's
perfectly aligned with what we are trying to do (a POM with a dependency on
the library to bundle and the  Maven Felix plugin for the configuration of
the bundle), so we may choose one of two ways: contribute such POMs to Felix
Commons (but we'd need to change the group-id to org.apache.felix.commons) or
have them deployed inside our SVN and "linked" (having UIMA listed as one of
the supporting libraries) to the Felix Commons project.
Since we already have OSGi versions of core framework inside our SVN to
support Eclipse plugins we may go for the second option.
So if we agree I could start a thread on Felix ML to let them know about
this effort.
What do you think?
Have a nice day.
Tommaso

2010/4/4 Marshall Schor <ms...@schor.com>
>
>
> +1.  I think there is a (slowly?) growing interest in OSGi - see, for
> instance, the latest info in the apache felix project [1] and in
> particular, the newer, possibly unreleased subprojects [2].  There are
> efforts there in the Apache Felix Commons subproject  [3] to do more or
> less what you are trying to do here - it would be good to confirm these
> approaches are aligned :-).
>
> -Marshall
>
> [1] http://felix.apache.org/site/index.html
> [2] http://felix.apache.org/site/subprojects.html
> [3] http://felix.apache.org/site/apache-felix-commons.html
>

Re: Sandbox OSGi runtime

Posted by Marshall Schor <ms...@schor.com>.

On 4/4/2010 5:32 AM, Tommaso Teofili wrote:
> It seems I missed something with the previous configuration.
> Modifying POMs using your approach everything is still working and better
> looking.
> Thanks very much Marshall.
> What do you think of creating the sandbox-osgi-runtime (multi-module)
> project on the Sandbox so that everyone can use such generated bundles?
>   

+1.  I think there is a (slowly?) growing interest in OSGi - see, for
instance, the latest info in the apache felix project [1] and in
particular, the newer, possibly unreleased subprojects [2].  There are
efforts there in the Apache Felix Commons subproject  [3] to do more or
less what you are trying to do here - it would be good to confirm these
approaches are aligned :-).

-Marshall
> Happy Easter to everyone.
> Tommaso
>
>   
[1] http://felix.apache.org/site/index.html
[2] http://felix.apache.org/site/subprojects.html
[3] http://felix.apache.org/site/apache-felix-commons.html

Re: Sandbox OSGi runtime

Posted by Tommaso Teofili <to...@gmail.com>.
It seems I missed something with the previous configuration.
Modifying POMs using your approach everything is still working and better
looking.
Thanks very much Marshall.
What do you think of creating the sandbox-osgi-runtime (multi-module)
project on the Sandbox so that everyone can use such generated bundles?
Happy Easter to everyone.
Tommaso

Re: Sandbox OSGi runtime

Posted by Marshall Schor <ms...@schor.com>.

On 4/3/2010 5:14 AM, Tommaso Teofili wrote:
> 2010/3/25 Marshall Schor <ms...@schor.com>
>
>   
>> Seems like a reasonable approach (caveat: I'm not really up-to-date with
>> the use-cases).
>>
>> Is it possible to factor out any (i.e., most) of the felix bundle plugin
>> configuration into the parent pom?
>>     
>
> Good point Marshall.
> I tried to do so but it seems the <configuration> tag cannot be defined
> partially (something on the parent POM and something else inside the child
> POM)

hmm, not sure why this didn't work for you. I was able to get something
like this to work:
I set up a trial set of poms - a parent and a child. 

In the parent I put the items that I wanted to be inherited in a
<pluginManagement> element:

<build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <!-- version 1.4.0 to support _nouses instruction -->
          <version>1.4.0</version>
          <extensions>true</extensions>
          <configuration>
            <manifestLocation>META-INF</manifestLocation>
            <instructions>
              <_nouses>true</_nouses>
              <Import-Package>org.apache.uima,*</Import-Package>
             
<Embed-Dependency>*;scope=compile;inline=true</Embed-Dependency>
             
<Bundle-SymbolicName>org.apache.uima.bsf;singleton:=true</Bundle-SymbolicName>
             
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
              <Eclipse-ExtensibleAPI>true</Eclipse-ExtensibleAPI>
              <Eclipse-BuddyPolicy>registered</Eclipse-BuddyPolicy>
            </instructions>
          </configuration>
         
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

In the child I put the items that were specific to that one child:

  <build>

   
<finalName>org.apache.uima.bsf_${uimaj-release-eclipse-version}</finalName>

    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
       
        <configuration>
        
          <instructions>
           
            <Export-Package>org.apache.uima.annotator.bsf.*</Export-Package>
          
           
<Bundle-SymbolicName>org.apache.uima.bsf;${singleton}</Bundle-SymbolicName>
           
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>


Then, when I did mvn help:effective-pom on the child it showed that the
parent configuration was successfully merged with the child result:

 <plugin>
   <groupId>org.apache.felix</groupId>
   <artifactId>maven-bundle-plugin</artifactId>
   <version>1.4.0</version>
   <extensions>true</extensions>
   <configuration>
     <instructions>
       <Export-Package>org.apache.uima.annotator.bsf.*</Export-Package>
      
<Bundle-SymbolicName>org.apache.uima.bsf;${singleton}</Bundle-SymbolicName>
       <_nouses>true</_nouses>
       <Import-Package>org.apache.uima,*</Import-Package>
       <Embed-Dependency>*;scope=compile;inline=true</Embed-Dependency>
      
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
       <Eclipse-ExtensibleAPI>true</Eclipse-ExtensibleAPI>
       <Eclipse-BuddyPolicy>registered</Eclipse-BuddyPolicy>
     </instructions>
     <manifestLocation>META-INF</manifestLocation>
   </configuration>
 </plugin>


>  so I thought using Maven properties could be a solution in order to
> define some fixed values for <configuration> inside the parent POM.
>
> Parent POM:
> <properties>
>     <import-package>org.apache.uima,*</import-package>
>     <embed-dependency>*;scope=compile;inline=true</embed-dependency>
>     <singleton>singleton:=true</singleton>
>     <jre>J2SE-1.5</jre>
>     <ext-api>true</ext-api>
>     <buddy-policy>registered</buddy-policy>
>     <nouses>true</nouses>
>     <manifest-location>META-INF</manifest-location>
>   </properties>
>
> Inside the child POM only Export-package and Bundle-SymbolicName are
> defined:
> ...
>         <configuration>
>           <manifestLocation>${manifest-location}</manifestLocation>
>           <instructions>
>             <_nouses>${nouses}</_nouses>
>             <Export-Package>org.apache.uima.lucas.*</Export-Package>
>             <Import-Package>${import-package}</Import-Package>
>             <Embed-Dependency>${embed-dependency}</Embed-Dependency>
>
>  <Bundle-SymbolicName>org.apache.uima.lucas;${singleton}</Bundle-SymbolicName>
>
>  <Bundle-RequiredExecutionEnvironment>${jre}</Bundle-RequiredExecutionEnvironment>
>             <Eclipse-ExtensibleAPI>${ext-api}</Eclipse-ExtensibleAPI>
>             <Eclipse-BuddyPolicy>${buddy-policy}</Eclipse-BuddyPolicy>
>           </instructions>
>         </configuration>
> ..
>
> Waiting for your comments about it.
> Tommaso
>
> P.S.:
> In Apache Clerezza the AlchemyAPI and OpenCalais annotators are used at this
> moment to enable auto tagging of resources.
>   
Great! :-)

-Marshall

Re: Sandbox OSGi runtime

Posted by Tommaso Teofili <to...@gmail.com>.
2010/3/25 Marshall Schor <ms...@schor.com>

> Seems like a reasonable approach (caveat: I'm not really up-to-date with
> the use-cases).
>
> Is it possible to factor out any (i.e., most) of the felix bundle plugin
> configuration into the parent pom?


Good point Marshall.
I tried to do so but it seems the <configuration> tag cannot be defined
partially (something on the parent POM and something else inside the child
POM) so I thought using Maven properties could be a solution in order to
define some fixed values for <configuration> inside the parent POM.

Parent POM:
<properties>
    <import-package>org.apache.uima,*</import-package>
    <embed-dependency>*;scope=compile;inline=true</embed-dependency>
    <singleton>singleton:=true</singleton>
    <jre>J2SE-1.5</jre>
    <ext-api>true</ext-api>
    <buddy-policy>registered</buddy-policy>
    <nouses>true</nouses>
    <manifest-location>META-INF</manifest-location>
  </properties>

Inside the child POM only Export-package and Bundle-SymbolicName are
defined:
...
        <configuration>
          <manifestLocation>${manifest-location}</manifestLocation>
          <instructions>
            <_nouses>${nouses}</_nouses>
            <Export-Package>org.apache.uima.lucas.*</Export-Package>
            <Import-Package>${import-package}</Import-Package>
            <Embed-Dependency>${embed-dependency}</Embed-Dependency>

 <Bundle-SymbolicName>org.apache.uima.lucas;${singleton}</Bundle-SymbolicName>

 <Bundle-RequiredExecutionEnvironment>${jre}</Bundle-RequiredExecutionEnvironment>
            <Eclipse-ExtensibleAPI>${ext-api}</Eclipse-ExtensibleAPI>
            <Eclipse-BuddyPolicy>${buddy-policy}</Eclipse-BuddyPolicy>
          </instructions>
        </configuration>
..

Waiting for your comments about it.
Tommaso

P.S.:
In Apache Clerezza the AlchemyAPI and OpenCalais annotators are used at this
moment to enable auto tagging of resources.

Re: Sandbox OSGi runtime

Posted by Marshall Schor <ms...@schor.com>.
Seems like a reasonable approach (caveat: I'm not really up-to-date with
the use-cases).

Is it possible to factor out any (i.e., most) of the felix bundle plugin
configuration into the parent pom? 

-Marshall

On 3/25/2010 4:17 AM, Tommaso Teofili wrote:
> Back again,
>
> 2010/3/10 Tommaso Teofili <to...@gmail.com>
>   
>>  I am doing some tests with this approach using some of these bundled
>> annotators with Apache Clerezza.
>>
>>
>>     
> Tests seem to go well using OpenCalaisAnnotator and AlchemyAPIAnnotator
> bundles generated with Maven Felix plugin.
> I've temporarily put the POMs on a GC SVN [1] so that you can view and
> comment this approach.
> What do you think?
>   
> Cheers,
> Tommaso
>
> [1] :
> http://code.google.com/p/osgi-uima-sandbox/source/browse/#svn/trunk/osgi-uima-sandbox
>
>   

Re: Sandbox OSGi runtime

Posted by Tommaso Teofili <to...@gmail.com>.
Back again,

2010/3/10 Tommaso Teofili <to...@gmail.com>
>
>  I am doing some tests with this approach using some of these bundled
> annotators with Apache Clerezza.
>
>
Tests seem to go well using OpenCalaisAnnotator and AlchemyAPIAnnotator
bundles generated with Maven Felix plugin.
I've temporarily put the POMs on a GC SVN [1] so that you can view and
comment this approach.
What do you think?

Cheers,
Tommaso

[1] :
http://code.google.com/p/osgi-uima-sandbox/source/browse/#svn/trunk/osgi-uima-sandbox

Re: Sandbox OSGi runtime

Posted by Tommaso Teofili <to...@gmail.com>.
2010/3/6 Marshall Schor <ms...@schor.com>

>
>
> On 3/4/2010 3:00 AM, Tommaso Teofili wrote:
> > Hi Marshall
> >
> > 2010/3/3 Marshall Schor <ms...@schor.com>
> >
> >
> >> would it make sense to have individual osgi packaging of sandbox
> >> annotators?
> >>
> >>
> > Do you mean you prefer not to have a single module aggregating all
> > annotators in a single bundle and you'd prefer each annotator having its
> own
> > individual OSGi bundle?
> >
>
> Yes.  Some of the annotators have very large (could be 100's of
> megabytes, for instance) statistical models.
>

I just made myself a multi module Maven project containing one module for
each of the Sandbox annotators so that one can select which annotators to
install on an OSGi runtime but at the same time they are tied together
inside a unique project.
Each module contains only the POM which uses the Maven Felix plugin to
produce the annotator bundle (more or less like in uimaj-ep-runtime).
I am doing some tests with this approach using some of these bundled
annotators with Apache Clerezza.
Tommaso

Re: Sandbox OSGi runtime

Posted by Marshall Schor <ms...@schor.com>.

On 3/4/2010 3:00 AM, Tommaso Teofili wrote:
> Hi Marshall
>
> 2010/3/3 Marshall Schor <ms...@schor.com>
>
>   
>> would it make sense to have individual osgi packaging of sandbox
>> annotators?
>>
>>     
> Do you mean you prefer not to have a single module aggregating all
> annotators in a single bundle and you'd prefer each annotator having its own
> individual OSGi bundle?
>   

Yes.  Some of the annotators have very large (could be 100's of
megabytes, for instance) statistical models.

-Marshall
>
>   
>> (I'm assuming you're thinking about annotators, not about other things,
>> right?)
>>
>>     
> Yes, right.
>
> Cheers.
> Tommaso
>
>   

Re: Sandbox OSGi runtime

Posted by Tommaso Teofili <to...@gmail.com>.
Hi Marshall

2010/3/3 Marshall Schor <ms...@schor.com>

> would it make sense to have individual osgi packaging of sandbox
> annotators?
>

Do you mean you prefer not to have a single module aggregating all
annotators in a single bundle and you'd prefer each annotator having its own
individual OSGi bundle?


>
> (I'm assuming you're thinking about annotators, not about other things,
> right?)
>

Yes, right.

Cheers.
Tommaso

Re: Sandbox OSGi runtime

Posted by Marshall Schor <ms...@schor.com>.
would it make sense to have individual osgi packaging of sandbox annotators?

(I'm assuming you're thinking about annotators, not about other things,
right?)

-Marshall

On 3/3/2010 9:03 AM, Tommaso Teofili wrote:
> Hi all,
> what do you think of a uimaj module similar to uimaj-ep-runtime just for
> sandbox components (something like sanxbox-osgi-runtime)?
> This is useful when you want to use Sandbox components in an OSGi
> environment.
> Cheers.
> Tommaso
>
>   

Re: Sandbox OSGi runtime

Posted by Jörn Kottmann <ko...@gmail.com>.
Tommaso Teofili wrote:
> Hi all,
> what do you think of a uimaj module similar to uimaj-ep-runtime just for
> sandbox components (something like sanxbox-osgi-runtime)?
> This is useful when you want to use Sandbox components in an OSGi
> environment.
>   

Not sure how this can be done, since UIMA must be able to load
the AEs from an OSGi bundle, but then we have all the issues we
discussed a while back.

http://mail-archives.apache.org/mod_mbox/incubator-uima-dev/201001.mbox/<b9...@mail.gmail.com>

Jörn