[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] How to specify the configuration area for P2 ProvisioningAgent to locate the bundles.info

Normally this value should be modified by the profile registry when the profile is loaded from disk.
I don't know why it is not. I suspect this is probably because the install is not flagged as "roaming".You may want to take a look at the getProfile() method in SimpleProfileRegistry .

Pascal

On 2013-02-18, at 6:37 PM, Dileepa Jayakody wrote:

Hi Pascal,

Thanks a lot for the pointer.
I went through the code, and I saw that LazyManipulator in it's loadDelegate() sets the configurationFolder for the running profile;
launcherData.setFwConfigLocation(Util.getConfigurationFolder(profile));

The configuration folder is selected based on org.eclipse.equinox.p2.configFolder OR org.eclipse.equinox.p2.installFolder/configuration.

Unfortunately the 'org.eclipse.equinox.p2.installFolder value is hard-coded into my Profiles in ProfileRegistry during the build as below.
 
<profile id='WSO2CarbonProfile' timestamp='1361223701812'>
  <properties size='4'>
    <property name='org.eclipse.equinox.p2.installFolder' value='/media/Carbon_Volume/Ubuntu_Resources/carbon/multipleP2ProfileSupport/dileepa/kernel/trunk/distribution/kernel/target/WSO2Carbon/WSO2CarbonProfile'/>
    <property name='org.eclipse.equinox.p2.cache' value='/media/Carbon_Volume/Ubuntu_Resources/carbon/multipleP2ProfileSupport/dileepa/kernel/trunk/distribution/kernel/target/WSO2Carbon'/>
    <property name='org.eclipse.update.install.features' value='true'/>
    <property name='org.eclipse.equinox.p2.environments' value='osgi.nl=en_GB,osgi.ws=gtk,osgi.arch=x86,osgi.os=linux'/>
  </properties>
</profile>

I tried to override these values in launch.ini just like I can for p2.data.area, osgi.configuration.area. But it was not detected. Can you please suggest a way to override the hardcoded p2.installFolder value here so that P2 will correctly update the bundles.info file upon a provisioning action?

Thanks,
Dileepa


In my case could this be the a reason 

On Mon, Feb 18, 2013 at 7:55 PM, Pascal Rapicault <pascal@xxxxxxxxxxxxx> wrote:
The majority of the handling of the configuration files is done from the LazyManipulator class in the eclipse touchpoint, which is a facade for classes in equinox.fwkadmin.equinox bundles.

Pascal

On 2013-02-18, at 6:34 AM, Dileepa Jayakody wrote:

Hi All,

Can I please know how P2 ProvisioningAgent updates the configuration files after a feature installation?

At the moment in my new multi-profile target enviorment with a shared p2-data area, after a feature installation only the P2-Profile is updated with the newly installed features.
I also see that the new feature and plugins are properly extracted to ${install.area}/features and {install.area}/plugins directories but the relevant configuraton files (configuration/org.eclipse.equinox.simpleconfigurator/bundles.info and configuration/org.eclipse.update/platform.xml) are not updated with the new features and pluging entries.

Are these files located by the P2-Agent relative to the URI given when we create the provisioningAgent? (provisioningAgent = provisioningAgentProvider.createAgent(agentURI);)
What could be the possible reasons for the provisioning agent properly updating the Profile and not the configuration files after a feature installation?

Thanks,
Dileepa

How does the ProvisioningAgent update these files during a feature installation?

On Sun, Feb 17, 2013 at 2:09 AM, Dileepa Jayakody <dileepa@xxxxxxxx> wrote:
Hi All,

We use a P2 ProvisioningAgent to perform provisioning operations in our runtime. Our initial product distribution structure was similar to a generic Eclipse installation with (dropins, plugins, features, configuration and p2 directories).
Now we are looking at shipping multiple-profile installations in a single distribution using a shared p2 data area along with different configuration directories for each Profile, see the new layout at [1]. So now default the configuration directory is changed to have separate configuration directory per Profile.

AFAIU during the provisioning action, the P2 Agent updates the relevant Profile and also adds the newly installed bundles to the configuration/org.eclipse.equinox.simpleconfigurator/bundles.info
But with the new directory layout to support multiple-profile installations, after performing a provisioning action, only the Profile is updated with the newly installed IUs. The bundles.info in the relavant configuration directory is not updated.

Is there a way to provide the osgi.configuration.area argument to the P2 Agent so that it can find the bundles.info file to update after a provisioning action?
I have also added the code-segment here on how we are performing P2 provisioning actions using P2 API [2].
Any help/pointers on this is a life-saver!

Thanks,
Dileepa

[1] new layout;

repository/components/
|--ProfileA
|    /configuration
|       |--config.ini
|       |--org.eclipse.equinox.
simpleconfigurator/bundles.info
|
|--ProfileB
|    /configuration
|       |--config.ini
|       |--org.eclipse.equinox.simpleconfigurator/bundles.info 

repository/components/p2 {shared p2 data directory for created profiles}
|--org.eclipse.equinox.p2.engine
|          |--profileRegistry
|                |---ProfileA.profile
|                |---ProfileB.profile 


[2] The Provisioning code segment;

           String P2_AGENT_LOCATION = System.getProperty("carbon.home") + File.separator + "repository" + File.separator +"components" + File.separator + "p2";
           URI agentURI = getAgentURI(P2_AGENT_LOCATION);
           provisioningAgent = provisioningAgentProvider.createAgent(agentURI);
            IPlanner planner = (IPlanner)provisioningAgent.getService(IPlanner.SERVICE_NAME);
            setPlanner(planner);
            IMetadataRepositoryManager metadataRepositoryManager =
                    (IMetadataRepositoryManager)provisioningAgent.getService(IMetadataRepositoryManager.SERVICE_NAME);
            setMetadataRepositoryManager(metadataRepositoryManager);
            IArtifactRepositoryManager artifactRepositoryManager =
                    (IArtifactRepositoryManager)provisioningAgent.getService(IArtifactRepositoryManager.SERVICE_NAME);
            setArtifactRepositoryManager(artifactRepositoryManager);
            IProfileRegistry profileRegistry = (IProfileRegistry)provisioningAgent.getService(IProfileRegistry.SERVICE_NAME);
            setProfileRegistry(profileRegistry);
            IEngine engine = (IEngine)provisioningAgent.getService(IEngine.SERVICE_NAME);
            setP2Engine(engine);
            setProvisioningContext(new ProvisioningContext(provisioningAgent));
            
             provisioningAgent.registerService(IProvisioningAgent.INSTALLER_AGENT, provisioningAgentProvider.createAgent(null)); 
             ProvisioningContext context = ServiceHolder.getProvisioningContext();
             IEngine engine = ServiceHolder.getP2Engine();
             context.setMetadataRepositories(ServiceHolder.getMetadataRepositoryManager().getKnownRepositories(IRepositoryManager.REPOSITORIES_ALL));
             context.setArtifactRepositories(ServiceHolder.getArtifactRepositoryManager().getKnownRepositories(IRepositoryManager.REPOSITORIES_ALL));
             IStatus status = PlanExecutionHelper.executePlan(provisioningPlan, engine, context, new NullProgressMonitor());
--
Dileepa Jayakody,
Software Engineer, WSO2 Inc.
Lean . Enterprise . Middleware

Mobile : +94777-857616



--
Dileepa Jayakody,
Software Engineer, WSO2 Inc.
Lean . Enterprise . Middleware

Mobile : +94777-857616
_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev


_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev




--
Dileepa Jayakody,
Software Engineer, WSO2 Inc.
Lean . Enterprise . Middleware

Mobile : +94777-857616
_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev