Hi All,

Please see this blog-post :
http://dileepajayakody.blogspot.com/2013/03/multiple-p2-profile-support-in-carbon.html
to
get details on the POC done to support multiple-profiles.

The things to do;
1.Fix the problem of feature installations with copying resources to the
target. (the problem is with relative paths of the copying resources in the
new multi-profile target)
2. Maintain the running Profile when restarting the server.
3. (Improvement) Adding a new goal to merge materialize-product and
p2-profile-gen goals so that it can be done in 1 execution cycle.

Thanks,
Dileepa

On Wed, Feb 20, 2013 at 1:26 AM, Dileepa Jayakody <[email protected]> wrote:

>
>
> On Tue, Feb 19, 2013 at 8:20 AM, Dileepa Jayakody <[email protected]>wrote:
>
>> Hi All,
>>
>> I continued with the 1st option of updating the relative paths for
>> source,destination in p2.inf of platform features in the new multi-profile
>> target directory structure.
>> Based on that I have done below changes to kernel in the scratch area;
>>
>> 1. carbon-p2-plugin [1]
>> Updated the p2-director launcher arguments to support multiple-profile
>> installations with a shared p2 area, in MaterialzeProductMojo and
>> ProfileGenMojo
>>  -destination : targetPath/${profile}
>>  -shared : targetPath/p2
>>
>> targetPath is: $CARBON_HOME/repository/components
>>
>> 2. carbon.server [2]
>> CarbonLauncher changes: At startup osgi-runtime arguments are passed
>> according on the running profile
>> osgi.install.area : repository/components/${profile}
>> osgi.configuration.area : repository/components/${profile}/configuration
>> eclipse.p2.data.area : repository/components/p2 (not changed as we are
>> using a shared p2 area for all profiles)
>>
>> Main class change : if no profile is given as a startup parameter, carbon
>> will start with the default profile : WSO2CarbonProfile
>>
>> 3. Product p2-profile-gen [3]
>> Please see how a new Profile can be installed into the distribution in a
>> product's p2-profile-gen.
>> I have changed the carbon product p2-profile-gen [3] module, to install a
>> new Profile : WSO2SampleProfile that has tryit, soaptracer features
>> installed in addition to the carbon.runtime and carbon.core features.
>>
>> Below steps should be performed to install a new Profile in
>> p2-profile-gen;
>> 1. Publish the product configuration file (eg:carbon.product) with the
>> initial runtime configurations.
>> (A product configuration is required to materialize the minimal runtime
>> before installing features)
>> 2. Materialize the new Profile using above .product configuration file
>> 3. Install features to the new profile
>>
>> Please find the carbon distribution at [4] which has WSO2CarbonProfile,
>> WSO2SampleProfile pre-installed.
>> You can start Carbon to load a profile by giving profile argument at
>> startup (eg: ./wso2server.sh -Dprofile=WSO2SampleProfile)
>>
>> Feature installation in the multi-profile environment is not yet working
>> as it only updates the relevant Profile but not the relevant 
>> bundles.infofile.
>> The reason for this is that org.eclipse.equinox.p2.installFolder value
>> gets hard-coded in the Profile during build time and p2 cannot locate the
>> bundles.info file in the modified directory structure. Need to fix this.
>>
>
> Above issue was fixed by passing "-roaming" argument to the p2-director in
> the carbon-p2-plugin.
> With -roaming enabled, org.eclipse.equinox.p2.installFolder value is
> modified by the profile registry when the profile is loaded from disk.
> Now when we install new features to a Profile they are maintained
> separately under the repository/components/${Profile} directory.
>
> Now the problem is with relative paths defined in features p2.inf files
> (eg: 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);).
>
> In the new multi-profile target, the installFolder will point the
> components/{Profile} directory and source and destination directory paths
> given above will be invalid. Need to find a solution on how we can install
> features both during build-time and runtime by correctly giving the
> source,destination directory path to P2.
>
> Thanks,
> Dileepa
>
>
>>  The related jira  : https://wso2.org/jira/browse/CARBON-14064
>>
>> Thanks,
>> Dileepa
>>
>>
>> [1] https://svn.wso2.org/repos/wso2/scratch/dileepa/carbon-p2-plugin
>> [2]
>> https://svn.wso2.org/repos/wso2/scratch/dileepa/kernel/trunk/core/org.wso2.carbon.server
>> [3]
>> https://svn.wso2.org/repos/wso2/scratch/dileepa/kernel/trunk/distribution/product/modules/p2-profile-gen/pom.xml
>> [4]
>> https://svn.wso2.org/repos/wso2/scratch/dileepa/wso2carbon-4.1.0-SNAPSHOT.zip
>>
>>
>
>
> --
> 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
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to