Hi All, On Fri, Feb 15, 2013 at 4:08 PM, Dileepa Jayakody <dile...@wso2.com> wrote:
> Hi All, > > After some discussions with p2-dev guys on how to support multiple product > installations in a single distribution, the previous directory structure > had to be slightly modified to provide separate configuration directory per > installed Product. > (Here a P2-Profile represents a separate Product; eg: WSO2CarbonProfile > represents the carbon product, WSO2ASProfile represents the AppServer > product ) > > So the modified distribution structure now looks like below; > *repository/components/* > |--WSO2CarbonProfile > | /configuration > | |--config.ini > | |--org.eclipse.equinox.simpleconfigurator/bundles.info (bundle > set to load Carbon product) > | > |--WSO2ASProfile > | /configuration > | |--config.ini > | |--org.eclipse.equinox.simpleconfigurator/bundles.info (bundle > set to load AS product) * > > repository/components/p2 *{shared p2 data directory for above created > profiles} > |--org.eclipse.equinox.p2.engine > | |--profileRegistry > | |---WSO2CarbonProfile.profile {profile state of Carbon} > | |---WSO2ASProfile.profile {profile state of AS} > > To generate the above target distribution structure using carbon-p2-plugin > we should parse the correct arguments to the p2-director [1]. P2-director > is the tool we invoke underneath carbon-p2-plugin to perform provisioning > actions and build our product distributions. > > We can parse below arguments to p2-director to create a shared > installation in our product build; > *-shared* ${carbon.components.dir}/p2 > *-destination* ${carbon.components.dir}/{ProfileID} > > When giving -destination separately for each Profile (eg: -destination /media/Carbon_Volume/carbon/platform/branches/4.0.0/products/bam2/2.1.0/modules/p2-profile-gen/target/wso2carbon-core-4.0.6/repository/components/WSO2BAMReceiverProfile) and installing features, an error occurs[1] for features having p2 instructions to copy files to target directories. The issue is with the variable ${installFolder} used by the instructions. It defaults to the destination of the current profile : ${carbon.home}/repository/components/${profile} and the relative path to find the source and target becomes invalid for instructions like below in the multi-profile target environment: org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/features/org.wso2.carbon.cassandra.dataaccess_${feature.version}/conf/cassandra-component.xml,target:${installFolder}/../conf/etc/cassandra-component.xml,overwrite:true); So the 2 options to rectify this installation issue are; 1. Change our features' p2.inf files to define the relative paths of source and destination in the new multi-profile target environment. 2. Invoke p2-director with -destination : ${carbon.home}/repository/components/ in p2-profile-gen phase (as we normally do), without specifying it per each Profile and do a manual file operation to move generated directories under the ${carbon.home}/repository/${Profile} after the the profile-gen operation is executed. What could be the better option here? Thanks, Dileepa [1] Error : An error occurred while configuring the installed items session context was:(profile=WSO2BAMReceiverProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Configure, operand=null --> [R]org.wso2.carbon.cassandra.dataaccess.feature.group 4.0.5, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.CopyAction). I/O Error while copying /media/Carbon_Volume/carbon/platform/branches/4.0.0/products/bam2/2.1.0/modules/p2-profile-gen/target/wso2carbon-core-4.0.6/repository/components/WSO2BAMReceiverProfile/features/org.wso2.carbon.cassandra.dataaccess_4.0.5/conf/cassandra-component.xml - see details. Caused by: java.io.IOException: Source: /media/Carbon_Volume/carbon/platform/branches/4.0.0/products/bam2/2.1.0/modules/p2-profile-gen/target/wso2carbon-core-4.0.6/repository/components/WSO2BAMReceiverProfile/features/org.wso2.carbon.cassandra.dataaccess_4.0.5/conf/cassandra-component.xmldoes not exists > -shared parameter indicates that the installed products share the same > p2-data area to store/retrieve the P2-Profile related information > -destination is the installation path given for each product. (For each > Product profile we can change this -destination argument like > {carbon.home}/repository/components/WSO2CarbonProfile, > {carbon.home}/repository/components/WSO2ASProfile) > > example invocation of p2-director to install carbon.core.feature to > WSO2CarbonProfile in a shared installation: > > -nosplash -application org.eclipse.equinox.p2.director -metadataRepository > file:/media/Carbon_Volume/Ubuntu_Resources/carbon/kernel/branches/4.0.0/distribution/kernel/4.0.6/target/p2-repo > -artifactRepository > file:/media/Carbon_Volume/Ubuntu_Resources/carbon/kernel/branches/4.0.0/distribution/kernel/4.0.6/target/p2-repo > -profileProperties org.eclipse.update.install.features=true -installIU > org.wso2.carbon.core.feature.group/4.0.6, -bundlepool > /media/Carbon_Volume/Ubuntu_Resources/carbon/kernel/branches/4.0.0/distribution/kernel/4.0.6/target/WSO2Carbon > * -shared > /media/Carbon_Volume/Ubuntu_Resources/carbon/kernel/branches/4.0.0/distribution/kernel/4.0.6/target/WSO2Carbon/p2 > * * > -destination > /media/Carbon_Volume/Ubuntu_Resources/carbon/kernel/branches/4.0.0/distribution/kernel/4.0.6/target/WSO2Carbon/WSO2CarbonProfile > * *-profile WSO2CarbonProfile* > > * > How to generate the target product structure * > > To see how we can generate this structure for multiple-profiles we should > first look at how the product distributions are created currently via > carbon-p2-plugin using default WSO2CarbonProfile > > 1. In Kernel distribution [2] ; > We first constitute the carbon product using the carbon product > configuration file: *carbon.product* [3]. > carbon.product file has the initial configurations of the osgi-bundles to > start and other required configurations necessary to generate the > config.ini (the main configuration file for an eclipse product) > It also defines the minimal equinox runtime-feature to be installed first > into the default WSO2Carbon profile. > > So in the first 2 phases in carbon-p2-plugin (publish-product, > materialize-product) we invoke the p2-director to use above carbon.product > and materialize the default WSO2CarbonProfile with a minimal runtime. > > Then in profile-gen phase we install carbon.feature to the > WSO2CarbonProfile. > > 2. In product distributions; > We extract the carbon-core distribution and install additional features to > the existing default WSO2CarbonProfile in profile-gen phase. > > When supporting multiple-profiles, we have to first do the process of > materializing the a Profile, before installing features to it.This can be > achieved using a separate product configuration file and installing > features to the Profile afterwards. Which means for each new P2Profile we > are going to introduce we need to have a separate product configuration > file to do the initial materializing part. (eg: as.product, bam.product etc) > > Since this is a repetitive task, I looked at alternative ways of achieving > the initial profile materializing part by cloning the defaultProfile and > using it as the base to generate new Profiles. Raised the question in > p2-dev list also. Found out that this functionality is not currently > supported by P2 as per [4]. > > So to support multiple profiles in our product builds can we proceed with > using a .product configuration file *per* Profile to perform the initial > materializing part? > > For example in this way, if we are going to create a BAM product with > different profiles such as Receiver, Analyzer, Dashboard etc, per each > profile we need to materialize bam-receiver.product, bam-analyzer.product, > bam-dashboard.product and construct the Profiles separately. > > Can someone suggest a better approach in achieving this? > > Thanks, > Dileepa > > > [1] > http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.html > [2] > https://svn.wso2.org/repos/wso2/carbon/kernel/trunk/distribution/kernel/pom.xml > [3] > https://svn.wso2.org/repos/wso2/carbon/kernel/trunk/distribution/kernel/carbon.product > [4] https://bugs.eclipse.org/bugs/show_bug.cgi?id=287619 > > > On Thu, Jan 31, 2013 at 11:09 AM, Pradeep Fernando <prad...@wso2.com>wrote: > >> Excellent progress!! >> >> --Pradeep >> >> >> On Thu, Jan 31, 2013 at 11:08 AM, Dileepa Jayakody <dile...@wso2.com>wrote: >> >>> Hi Pradeep and All, >>> >>> To give a brief introduction on this; the purpose of this implementation >>> is to be able to pre-provision several products in to one distribution and >>> select the product to load at startup. >>> Each product can be considered a separate Product profile and at startup >>> by passing an argument like -Dprofile={Product.Profile} we should be able >>> to load the required product. >>> >>> After doing some background research on Equinox configurations I did a >>> POC by manually constructing the product distribution structure to support >>> this (as shown below), and point the equinox.configuration directory to >>> relevant {Profile}configuration directory at startup. This will load the >>> set of bundles relevant to the given Product.Profile. >>> >>> *Things to do;* >>> Need to look at on how to support feature installations separately to >>> the loaded Profile. Currently after loading a particular profile and >>> installing features the newly added bundle entries are not persisted. >>> I'm currently working on changing the carbon-p2-plugin goals to >>> construct the modified product distribution structure. >>> Will update the thread on the progress. >>> * >>> >>> Modified Product structure to support multiple-profiles* >>> *repository/components/configuration *{equinox configuration directory} >>> | >>> |--WSO2CarbonProfile >>> | |--config.ini >>> | |--org.eclipse.equinox.simpleconfigurator/bundles.info {bundle set >>> to load Carbon product} >>> |--WSO2ASProfile >>> | |--config.ini >>> | |--org.eclipse.equinox.simpleconfigurator/bundles.info {bundle set >>> to load AS product} >>> >>> *repository/components/p2 *{p2 data directory} >>> |--org.eclipse.equinox.p2.engine >>> | |--profileRegistry >>> | |---WSO2CarbonProfile.profile {p2 state of Carbon} >>> | |---WSO2ASProfile.profile {p2 state of AS} >>> >>> Thanks, >>> Dileepa >>> >>> >>> >>> On Thu, Jan 31, 2013 at 8:38 AM, Pradeep Fernando <prad...@wso2.com>wrote: >>> >>>> Hi, >>>> >>>> Dileepa working on the $subject. >>>> >>>> @Dileepa : can you please provide a brief update :) >>>> >>>> >>>> thanks, >>>> --Pradeep >>>> >>>> >>>> >>> >>> >>> -- >>> Dileepa Jayakody, >>> Software Engineer, WSO2 Inc. >>> Lean . Enterprise . Middleware >>> >>> Mobile : +94777-857616 >>> >> >> >> >> -- >> *Pradeep Fernando* >> Member, Management Committee - Platform & Cloud Technologies >> Senior Software Engineer;WSO2 Inc.; http://wso2.com >> >> blog: http://pradeepfernando.blogspot.com >> m: +94776603662 >> > > > > -- > Dileepa Jayakody, > Software Engineer, WSO2 Inc. > Lean . Enterprise . Middleware > > Mobile : +94777-857616 > -- Dileepa Jayakody, Software Engineer, WSO2 Inc. Lean . Enterprise . Middleware Mobile : +94777-857616
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev