You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by mgardiner <ga...@familysearch.org> on 2011/05/04 17:08:25 UTC

Continuous Delivery

How can we do continuous delivery with Apache Karaf?

Specifically, lets say I have a service hosted in Karaf deployed in
production and the service feature is version 1.0 but I wish to upgrade to
version 1.1.  I release 1.1 to a nexus repo making the artifacts available
for consumption in Karaf. How do we upgrade our current version (1.0) to
1.1?

Are KARs and / or EBAs the answer?

Will we be able to upgrade to a newer version of the KAR or EBA without
conflicts?

Also, when using KARs and EBAs can we deploy from Nexus or are we limited to
writing the KAR or EBA to the deploy directory?

Thanks.

-Mike-

--
View this message in context: http://karaf.922171.n3.nabble.com/Continuous-Delivery-tp2899218p2899218.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Continuous Delivery

Posted by Achim Nierbeck <bc...@googlemail.com>.
christian, this is also possible, but with uninstalling you don't have
both bundles available, which might still be wanted.
which I think is one of the greatest benefits of OSGi.

regards, Achim

2011/5/4 Christian Schneider <ch...@die-schneider.net>:
> Hi Mike,
>
> if you use feature files and I think it is a good idea to do so then you
> will install 1.0 in the following way:
>
> features:addurl mvn:org.yourorg/yourproject-features/1.0/xml
> features:install yourapp
>
> Then you release 1.1 and deploy it to the maven repo
>
> features:uninstall yourapp
> features:removeurl mvn:org.yourorg/yourproject-features/1.0/xml
> features:addurl mvn:org.yourorg/yourproject-features/1.1/xml
> features:install yourapp
>
> While this is not really perfect it works quite well. Of course it would be
> nice to just have one command to update
> to the new version.
>
> Christian
>
>
> Am 04.05.2011 17:08, schrieb mgardiner:
>>
>> How can we do continuous delivery with Apache Karaf?
>>
>> Specifically, lets say I have a service hosted in Karaf deployed in
>> production and the service feature is version 1.0 but I wish to upgrade to
>> version 1.1.  I release 1.1 to a nexus repo making the artifacts available
>> for consumption in Karaf. How do we upgrade our current version (1.0) to
>> 1.1?
>>
>> Are KARs and / or EBAs the answer?
>>
>> Will we be able to upgrade to a newer version of the KAR or EBA without
>> conflicts?
>>
>> Also, when using KARs and EBAs can we deploy from Nexus or are we limited
>> to
>> writing the KAR or EBA to the deploy directory?
>>
>> Thanks.
>>
>> -Mike-
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Continuous-Delivery-tp2899218p2899218.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
> --
> ----
> http://www.liquid-reality.de
>
>



-- 
--
*Achim Nierbeck*


Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead

Re: Continuous Delivery

Posted by Achim Nierbeck <bc...@googlemail.com>.
well if you do an features:uninstall it should uninstall the
corresponding bundles of that feature.
after that you should remove the old url, on the other hand you might
want your "old" bundle still be provided for a certain time till you
do a switch
and remove those old ones.

regards, Achim

2011/5/4 mgardiner <ga...@familysearch.org>:
> Wouldn't this end up having both versions installed in the container?  If I
> remember correctly removing the feature and featureurl does not remove the
> bundles associated with the feature.
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Continuous-Delivery-tp2899218p2899276.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
--
*Achim Nierbeck*


Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead

Re: Continuous Delivery

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Andreas,

I didn't see the whole thread, just replied :)

I hope it helps ;)

Regards
JB

On 05/04/2011 06:33 PM, Andreas Pieber wrote:
> I think there should also be a similar mechanism in Apache ACE (@JB,
> can you enlighten us? :))
>
> Kind regards,
> Andreas
>
> On Wed, May 4, 2011 at 5:53 PM, Guillaume Nodet<gn...@gmail.com>  wrote:
>> One thing I've been working on recently is a deployment agent for
>> fabric (see http://gnodet.blogspot.com/2011/05/introducing-fusesource-fabric.html).
>>   We've used a slightly different mechanism as the agent is responsible
>> for all the deployments so that it can actually upgrade all the
>> bundles, including karaf bundles and even the osgi framework itself.
>> This way, the agent can actually upgrade features to newer versions.
>> The downside is that you need to go through the agent for all
>> deployments.
>>
>> On Wed, May 4, 2011 at 17:42, bbolingbroke
>> <bo...@familysearch.org>  wrote:
>>> If your goal is to have zero downtime, then when you upgrade to 1.1, would
>>> you follow these steps?
>>>
>>> You release 1.1 and deploy it to the maven repo
>>>
>>> features:addurl mvn:org.yourorg/yourproject-features/1.1/xml
>>> features:install yourapp/1.1
>>> features:uninstall yourapp/1.0
>>> features:removeurl mvn:org.yourorg/yourproject-features/1.0/xml
>>>
>>>
>>> --
>>> View this message in context: http://karaf.922171.n3.nabble.com/Continuous-Delivery-tp2899218p2899341.html
>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://fusesource.com
>>
>> Connect at CamelOne May 24-26
>> The Open Source Integration Conference
>> http://camelone.com/
>>

Re: Continuous Delivery

Posted by Andreas Pieber <an...@gmail.com>.
I think there should also be a similar mechanism in Apache ACE (@JB,
can you enlighten us? :))

Kind regards,
Andreas

On Wed, May 4, 2011 at 5:53 PM, Guillaume Nodet <gn...@gmail.com> wrote:
> One thing I've been working on recently is a deployment agent for
> fabric (see http://gnodet.blogspot.com/2011/05/introducing-fusesource-fabric.html).
>  We've used a slightly different mechanism as the agent is responsible
> for all the deployments so that it can actually upgrade all the
> bundles, including karaf bundles and even the osgi framework itself.
> This way, the agent can actually upgrade features to newer versions.
> The downside is that you need to go through the agent for all
> deployments.
>
> On Wed, May 4, 2011 at 17:42, bbolingbroke
> <bo...@familysearch.org> wrote:
>> If your goal is to have zero downtime, then when you upgrade to 1.1, would
>> you follow these steps?
>>
>> You release 1.1 and deploy it to the maven repo
>>
>> features:addurl mvn:org.yourorg/yourproject-features/1.1/xml
>> features:install yourapp/1.1
>> features:uninstall yourapp/1.0
>> features:removeurl mvn:org.yourorg/yourproject-features/1.0/xml
>>
>>
>> --
>> View this message in context: http://karaf.922171.n3.nabble.com/Continuous-Delivery-tp2899218p2899341.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>
> Connect at CamelOne May 24-26
> The Open Source Integration Conference
> http://camelone.com/
>

Re: Continuous Delivery

Posted by mgardiner <ga...@familysearch.org>.
Here's what I am seeing.  When I do the features:uninstall it does remove my
feature and my bundles associated with the feature but not the features and
bundles I depended on.

Example, I have an ActiveMQ configuration feature I created that depends on
the activemq-karaf feature.  When I uninstall my feature does get
uninstalled but ActiveMQ does not.  Maybe providing a features:uninstall -d
or something where all dependent features and bundles would also be
uninstalled.

It would also be nice to have a features:update that would automatically
remove the old version and install the version specified in the url.

One issue I see with installing the new version before uninstalling the old
version is when the service is using ports. For example, when using the
Activemq features we bind to 61616 so if I try to install a new version
before uninstall the old then I get a port already is use exception.

Thoughts?  

--
View this message in context: http://karaf.922171.n3.nabble.com/Continuous-Delivery-tp2899218p2899663.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Continuous Delivery

Posted by Guillaume Nodet <gn...@gmail.com>.
One thing I've been working on recently is a deployment agent for
fabric (see http://gnodet.blogspot.com/2011/05/introducing-fusesource-fabric.html).
 We've used a slightly different mechanism as the agent is responsible
for all the deployments so that it can actually upgrade all the
bundles, including karaf bundles and even the osgi framework itself.
This way, the agent can actually upgrade features to newer versions.
The downside is that you need to go through the agent for all
deployments.

On Wed, May 4, 2011 at 17:42, bbolingbroke
<bo...@familysearch.org> wrote:
> If your goal is to have zero downtime, then when you upgrade to 1.1, would
> you follow these steps?
>
> You release 1.1 and deploy it to the maven repo
>
> features:addurl mvn:org.yourorg/yourproject-features/1.1/xml
> features:install yourapp/1.1
> features:uninstall yourapp/1.0
> features:removeurl mvn:org.yourorg/yourproject-features/1.0/xml
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Continuous-Delivery-tp2899218p2899341.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Connect at CamelOne May 24-26
The Open Source Integration Conference
http://camelone.com/

Re: Continuous Delivery

Posted by bbolingbroke <bo...@familysearch.org>.
If your goal is to have zero downtime, then when you upgrade to 1.1, would
you follow these steps?

You release 1.1 and deploy it to the maven repo 

features:addurl mvn:org.yourorg/yourproject-features/1.1/xml 
features:install yourapp/1.1
features:uninstall yourapp/1.0
features:removeurl mvn:org.yourorg/yourproject-features/1.0/xml 


--
View this message in context: http://karaf.922171.n3.nabble.com/Continuous-Delivery-tp2899218p2899341.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Continuous Delivery

Posted by mgardiner <ga...@familysearch.org>.
Wouldn't this end up having both versions installed in the container?  If I
remember correctly removing the feature and featureurl does not remove the
bundles associated with the feature.

--
View this message in context: http://karaf.922171.n3.nabble.com/Continuous-Delivery-tp2899218p2899276.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Continuous Delivery

Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Mike,

if you use feature files and I think it is a good idea to do so then you 
will install 1.0 in the following way:

features:addurl mvn:org.yourorg/yourproject-features/1.0/xml
features:install yourapp

Then you release 1.1 and deploy it to the maven repo

features:uninstall yourapp
features:removeurl mvn:org.yourorg/yourproject-features/1.0/xml
features:addurl mvn:org.yourorg/yourproject-features/1.1/xml
features:install yourapp

While this is not really perfect it works quite well. Of course it would 
be nice to just have one command to update
to the new version.

Christian


Am 04.05.2011 17:08, schrieb mgardiner:
> How can we do continuous delivery with Apache Karaf?
>
> Specifically, lets say I have a service hosted in Karaf deployed in
> production and the service feature is version 1.0 but I wish to upgrade to
> version 1.1.  I release 1.1 to a nexus repo making the artifacts available
> for consumption in Karaf. How do we upgrade our current version (1.0) to
> 1.1?
>
> Are KARs and / or EBAs the answer?
>
> Will we be able to upgrade to a newer version of the KAR or EBA without
> conflicts?
>
> Also, when using KARs and EBAs can we deploy from Nexus or are we limited to
> writing the KAR or EBA to the deploy directory?
>
> Thanks.
>
> -Mike-
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Continuous-Delivery-tp2899218p2899218.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
----
http://www.liquid-reality.de


Re: Continuous Delivery

Posted by mgardiner <ga...@familysearch.org>.
Thanks for the info.  I will look into these recommendations.

--
View this message in context: http://karaf.922171.n3.nabble.com/Continuous-Delivery-tp2899218p2899713.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Continuous Delivery

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Mike,

You have three ways to do it:

1/ Using software management in AutoDeploy 
(http://buildprocess.sourceforge.net), you have agent which is able to 
run any commands on the target Karaf. It's a little bit archaic but it 
works ;) (I use it for ServiceMix 3/4 and Karaf in production right now).

2/ Using Apache ACE
ACE is a complete provisioning and deployment platform for OSGi, also 
using agent. Currently, ACE manage provisioning of bundles/config. I'm 
working on ACE to add Karaf as runtime (a ACE distribution will run on 
Karaf) and support Karaf resources (features, KAR, etc).
We're going to release ACE 0.8 very soon. For ACE 1.0, Karaf presence 
should higher ;)
I submitted to make a talk at ApacheCon about Karaf and ACE.

3/ Using Fuse Fabric
It's quite the same as ACE but implementing directly for Karaf (ACE is 
more OSGi generic and based on ConfigAdmin specification, that's why I'm 
working on ACE :)).

Regards
JB


On 05/04/2011 05:08 PM, mgardiner wrote:
> How can we do continuous delivery with Apache Karaf?
>
> Specifically, lets say I have a service hosted in Karaf deployed in
> production and the service feature is version 1.0 but I wish to upgrade to
> version 1.1.  I release 1.1 to a nexus repo making the artifacts available
> for consumption in Karaf. How do we upgrade our current version (1.0) to
> 1.1?
>
> Are KARs and / or EBAs the answer?
>
> Will we be able to upgrade to a newer version of the KAR or EBA without
> conflicts?
>
> Also, when using KARs and EBAs can we deploy from Nexus or are we limited to
> writing the KAR or EBA to the deploy directory?
>
> Thanks.
>
> -Mike-
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Continuous-Delivery-tp2899218p2899218.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Continuous Delivery

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Mike,

it's quite easy to deploy new versions of your bundles.

In your first example it should be something like the following in the
karaf shell:

osgi:install mvn:groupId/artefactId/version

if the kar or eba is available you might install it that way too.
For the eba's you need to make sure you have all you need installed
which is provided by aries.

Regards, Achim

2011/5/4 mgardiner <ga...@familysearch.org>:
> How can we do continuous delivery with Apache Karaf?
>
> Specifically, lets say I have a service hosted in Karaf deployed in
> production and the service feature is version 1.0 but I wish to upgrade to
> version 1.1.  I release 1.1 to a nexus repo making the artifacts available
> for consumption in Karaf. How do we upgrade our current version (1.0) to
> 1.1?
>
> Are KARs and / or EBAs the answer?
>
> Will we be able to upgrade to a newer version of the KAR or EBA without
> conflicts?
>
> Also, when using KARs and EBAs can we deploy from Nexus or are we limited to
> writing the KAR or EBA to the deploy directory?
>
> Thanks.
>
> -Mike-
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Continuous-Delivery-tp2899218p2899218.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
--
*Achim Nierbeck*


Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead