Deploying the artifact/bundle to the remote Fuse Server Profile

342 views
Skip to first unread message

Bala Gurram

unread,
Aug 15, 2014, 5:34:16 PM8/15/14
to fab...@googlegroups.com
Hello,

I would like to deploy the artifact/bundle to the Fuse profile- How do I do that ?

Current process--Deploy the bundle using the Fabric Console. 

Here are sequence of steps happen in my new deploy process through automation-

1-Developers check-in the code to git, Jenkins builds the artifact and saves to nexus repository 

2-I would like to deploy the artifact available in nexus repository to Fuse Server profile using fabric8 plugin or some other process.

Step1 and Step2 are completely independent processes (2 different Jenkins jobs)

-I am running this simple test in my local windows env first before I do it on remote Fuse Server.

I am trying to use the fabric8 mavern plugin - I could not understand what are the different entries goes to pom file for just the fabric8:deploy goal  since the artifact is already built before.

The below command is expecting the pom file for plugin information.

mvn fabric8:deploy -Dprofile=sample-1 -Dversion=1.0 -Dbundles=mvn:org.apache.camel/camel-quartz/ 

Is there is an easy process that I can follow to achieve my task.

Thanks,
Bala Gurram





Christian Posta

unread,
Aug 17, 2014, 5:35:03 PM8/17/14
to Bala Gurram, fab...@googlegroups.com
Fabric8 deploys modules/artifacts to a running container by a "provisioning" process and this is automated by default. You don't "deploy artifacts to Fabric8" per-se. You describe what a deployment, or group of deployments, should look like with a Profile (http://fabric8.io/gitbook/profiles.html) (including which artifacts should be deployed) and you allow the Fabric8 deployment agent to provision the containers. So if you have your artifacts stored in a Nexus/Maven repo, then this should all work fairly smoothly.

The purpose of the fabric8 maven plugin is really to generate a profile from a Maven project. So for example, fabric8:deploy will generate a profile that specifies to use the artifact built as part of the maven project plus any other bundles, features, configuration, etc required for the profile to run correctly. This will take a bit of trial and error at the moment until we come up with a cleaner way to do this (determine which features/parent profiles are appropriate for a given profile/maven project). You can set fabric:watch * to help speed this up as described here: 


Once you've figured out the correct profile for your deployment, you can automate the process of provisioning. You can build the profiles from your project as archive/zip files using fabric8:zip and store them to your maven repo. Then you can import them to a running Fabric with the profile:import command as described here:


Then what happens is you worry about the profiles and applying them to container and Fabric8 worries about downloading the binaries/artifacts from your maven repo as part of the provisioning process.

Hope that helps...



--
You received this message because you are subscribed to the Google Groups "fabric8" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Christian Posta
twitter: @christianposta

Bala Gurram

unread,
Aug 17, 2014, 11:29:21 PM8/17/14
to fab...@googlegroups.com, bala....@gmail.com
Hello Christian,

Thank you so much for your reply!

From what you are saying, I could not update the fuse profile with the mavern artifact using fabric8 profile, but from this link below, it is stating create or update a profile from a mavern project ...what I am doing is, trying to update the profile with the latest artifact generated from the mavern project when ever I want to update the profile. May be I am missing something here..


"Fabric8 Maven Plugin

This maven plugin makes it easy to create or update a fabric profile from your maven project.

When you deploy your project to a fabric profile with this plugin the following takes place:

  • uploads any artifacts into the fabric's maven repository
  • lazily creates the fabric profile or version you specify
  • adds/updates the maven project artifact into the profile configuration"
Please provide your comments on this.

Thanks,
Bala G

James Rawlings

unread,
Aug 18, 2014, 8:09:21 AM8/18/14
to Bala Gurram, fab...@googlegroups.com
Hi Bala,

It’s a bit work in progress at the moment but I’ve created a fabric8 branch on an old example of mine which might help you.  It’s not all working yet but it uses the maven plugin and requirements to create the entire fabric - no CLI :)


I’m currently working on some docs that explains this example in a bit more detail.  It creates new profiles defined in each pom and updated artefacts once initially created with each fabric8:deploy. 

Example pom..

<properties>
<fabric8.features>camel-amq</fabric8.features>
<fabric8.maximumInstances>1</fabric8.maximumInstances>
<fabric8.minInstanceCount>1</fabric8.minInstanceCount>
<fabric8.parentProfiles>feature-camel-jms</fabric8.parentProfiles>
<fabric8.profile>producer-profile</fabric8.profile>
<fabric8.useResolver>true</fabric8.useResolver>
</properties>


Is this the kind of thing you’re looking for?

Cheers, James.


I am trying to use the fabric8 mavern plugin - I could not understand what are the different entries goes to pom file for just thefabric8:deploy goal  since the artifact is already built before.

The below command is expecting the pom file for plugin information.

mvn fabric8:deploy -Dprofile=sample-1 -Dversion=1.0 -Dbundles=mvn:org.apache.camel/camel-quartz/ 

Is there is an easy process that I can follow to achieve my task.

Thanks,
Bala Gurram






-- 
You received this message because you are subscribed to the Google Groups "fabric8" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



-- 
Christian Posta
twitter: @christianposta

Bala Gurram

unread,
Aug 19, 2014, 10:00:18 AM8/19/14
to fab...@googlegroups.com, bala....@gmail.com
Hello James,

My goal is to update the artifact on remote fuse server profile. First time profile provisioning is done through the fabric management console. I am looking subsequent artifact updates through automation when ever I need to update the profile with new artifact/code. 

Looks like this is very close to what I am looking for- Sorry I missed to get it first. 

To understand better - I need to have the fabric 8 on my local machine to connect to fuse instance on my remote machine and do the artifact update using the plugin ? Help me understand better. 

Thanks,
Bala

Christian Posta

unread,
Aug 19, 2014, 7:15:50 PM8/19/14
to bala gurram, fab...@googlegroups.com



On Tue, Aug 19, 2014 at 11:27 AM, bala gurram <bala....@gmail.com> wrote:
Hello Christian,

Thanks for your reply! I like both approaches.

First, you can update the bundle version in the profile that you currently have deployed:
Let us take the First approach, How do I update the bundle version in the profile ? Could you point me to the document or instructions I need to follow.

Sure. There's the profile-edit commands from the command line, or you can click the wiki tab and find the profile you want to edit, then click the module/bundle tab and edit it.
 

In my case: 

-1) Fuse is running on the remote machine (Machine-1)
-2) My automation (script/process) runs on different machine (Machine-2) to update the bundle version in the profile
   (please provide instructions or doc for this step)

Yah, use the command line then. 

 What do you mean by use profiles? Please elaborate.

 


Thanks,
Bala G



On 19 August 2014 11:51, Christian Posta <christi...@gmail.com> wrote:



On Tue, Aug 19, 2014 at 7:00 AM, Bala Gurram <bala....@gmail.com> wrote:
Hello James,

My goal is to update the artifact on remote fuse server profile. First time profile provisioning is done through the fabric management console. I am looking subsequent artifact updates through automation when ever I need to update the profile with new artifact/code. 

There are two ways depending on your needs.
First, you can update the bundle version in the profile that you currently have deployed. Then Fabric8 will update itself on the containers the profile is deployed to. The changes you make are all versioned (git in the backend) so you can see history, etc.
The second way would be to make a new version of your profiles and update the version of your bundle in that new profile. Then deploy that new profile to a new container. Note, all of this updating the artifact is predicated on the fact that if you have changes to your artifact, you increment the version number. You don't ever replace artifacts/bundles/modules in place with the same version. Eg, if artifact version 1.0 is currently deployed, any subsequent deployment would be of version 1.1, 1.2, etc of your artifact. You wouldn't update 1.0 and push it out again as 1.0.
 

Looks like this is very close to what I am looking for- Sorry I missed to get it first. 

To understand better - I need to have the fabric 8 on my local machine to connect to fuse instance on my remote machine and do the artifact update using the plugin ? Help me understand better. 

You don't use the plugin for this. You use profiles.



--
Bala Gurram

Christian Posta

unread,
Aug 20, 2014, 5:59:42 PM8/20/14
to bala gurram, fab...@googlegroups.com
On Tue, Aug 19, 2014 at 8:18 PM, bala gurram <bala....@gmail.com> wrote:
Hello Christian,

Please see my query in green--Again thanks for your reply! 

Thanks for your reply! I like both approaches.

First, you can update the bundle version in the profile that you currently have deployed:
Let us take the First approach, How do I update the bundle version in the profile ? Could you point me to the document or instructions I need to follow.

Sure. There's the profile-edit commands from the command line, or you can click the wiki tab and find the profile you want to edit, then click the module/bundle tab and edit it.
 

In my case: 

-1) Fuse is running on the remote machine (Machine-1)
-2) My automation (script/process) runs on different machine (Machine-2) to update the bundle version in the profile
   (please provide instructions or doc for this step)

Yah, use the command line then. 

To go for command line option, 
-I need to establish the connection to fuse server running on Machine 1 from Machine 2, How do I do that ?
-Do you have any sample piece of steps to connect to Machine 2 fuse instance from another machine and run these profile-edit commands on machine 2 by passing the updated bundle information and profile in the commands.
What steps I need to follow to get this done ? I really appreciate your help on this.

Well, that's the beauty of Fabric8, you don't have to log into each machine. Profiles and configuration management is handled centrally. You edit the profiles from one of the "registry" servers and then profiles update themselves remotely (or you can create new versions of the profile and push them out as part of a new deployment or incremental upgrade).
 

 
 What do you mean by use profiles? Please elaborate.


I got better understanding of how profiles work from doc. how to run from another machine is my big ??

Take a look at some of the videos from here: http://fabric8.io/articles/index.html

Basically, you'll create a fabric8 node and use that to create containers on remote machines. Then you can apply profiles to those remote machines and they'll follow the fabric8 provisioning process.
Reply all
Reply to author
Forward
0 new messages