Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Equinox p2 PDE Integration"

m
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:Equinox p2]]  
+
[[Category:Equinox p2|PDE]] [[Category:PDE]] [[Category:PDE/Build]]
 
This page is intended to document changes required in the PDE component to support integration of p2 tooling into the platform.
 
This page is intended to document changes required in the PDE component to support integration of p2 tooling into the platform.
  
 
These items should be addressed in the 3.4 time frame.  The current priority is to make progress in all areas to support the smooth introduction of p2 tooling into the platform.  P2 tooling must be able to work with PDE.  More complete solutions can be looked at afterwards.
 
These items should be addressed in the 3.4 time frame.  The current priority is to make progress in all areas to support the smooth introduction of p2 tooling into the platform.  P2 tooling must be able to work with PDE.  More complete solutions can be looked at afterwards.
  
== Update Manager Tooling ==  
+
== 3.4 Plan ==  
  
Users will see little difference in UI of the update manager for 3.4. However, p2 will require additional work be accomplished by the update manager.
+
# Support p2 metadata creation during site building, feature building, plugin export, product export
 +
# Allow target provisioning from p2 repositories
 +
# Separate installable bundles and source bundles when launching
 +
# Read p2 bundles.txt data on startup to build target platform (completed 3.4 M4)
 +
# Write p2 bundles.txt data on Eclipse launches (completed 3.4 M5)
 +
# Write p2 bundles.txt data on OSGi launches with start level data (completed 3.4 M5)
  
=== Site Editor ===  
+
== Metadata Creation ==  
  
There already exists a site editor that allows update sites to be converted to the p2 equivalent. The site editor generates metadata for p2.
+
See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=216637|Bug 216637]
  
We want the ability to provide the metadata generator with 'advice'. This advice allows p2 to know more about how to install/launch IUsFor example, the start level could be specified, or a port to run on.  We want to prompt for this information.
+
PDE Build will have support to generate p2 metadata in 3.4 M5PDE UI must update the site builder, feature builder, plugin export, and product export tooling to invoke the PDE Build support.
  
=== Feature Editors ===
+
The properties that must be set are as follows:
 +
<ul>
 +
<li>generate.p2.metadata = true</li>
 +
<li>p2.metadata.repo = file://${buildDirectory}/repo</li>
 +
<li>p2.artifact.repo = file://${buildDirectory}/repo</li>
 +
<li>p2.flavor = tooling</li>
 +
<li>p2.publish.artifacts = false</li>
 +
</ul>
  
Change tooling to build for P2.
+
There will be no changes to the editors UI.  Metadata generation will be transparent to the user and always take place in a p2 hosts.  We may add an option in the preferences to turn off metadata generation as it may cause problems for certain RCP development scenarios.
  
=== Install Handlers ===  
+
== p2 Target Provisioning ==  
  
=== Site Builders ===
+
See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=204347 Bug 204347]
 +
 
 +
PDE UI added an extension point in the 3.3 timeframe that allows implementors to add new target provisioners to the list available when pressing the Add... button on the Target Platform preference page.  The extension point allows a wizard page contribution and expects a directory to be returned.  This directory should contain any new bundles that should be added to the target platform.
 +
 
 +
Currently the target provisioner has support for loading from the file system and update sites.  The file system option will remain the same.  The update site provisioner is very limited in features and will be removed.  The new provisioner, which will support p2 repositories, will also be able to provision from update sites using support already available in p2.
 +
 
 +
We are hoping to reuse viewers and other UI support from other areas of p2.  The UI will allow users to browse through the features/groups of a repository (or update site) and select what to add to the target.  The bundles/artifacts associated with the selected features/groups will be downloaded to a directory and this directory will be returned to PDE UI.
 +
 
 +
Code for this feature will be added in org.eclipse.equinox.p2.target.
 +
 
 +
There already exists a site editor that allows update sites to be converted to the p2 equivalent.  The site editor generates metadata for p2.
 +
 
 +
We want the ability to provide the metadata generator with 'advice'.  This advice allows p2 to know more about how to install/launch IUs.  For example, the start level could be specified, or a port to run on.  We want to prompt for this information.
  
== PDE Launch Tooling ==  
+
== Separate installable bundles and source bundles ==
  
=== Old Way ===
+
See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=217304| Bug 217304]
  
PDE tooling would check if the launch uses the Update ConfiguratorIf so, it is update manager awareA platform.xml is written listing all of the bundles in the launch. This is the most common use case (90%).
+
In 3.4 PDE introduced the concept of source bundles where source can be packaged in OSGi bundles instead of featuresBecause they are OSGi bundles and are in the plugins directory, Eclipse installs them on startupp2 would like to avoid installing them, as they contain no code. To do this they will not be added to the bundles.txt.
  
If the launch does not use the Update Configurator, the bundles OSGi uses are determines from config.iniConfig.ini lists each bundle that should be run along with start levelsIt is more flexible than the Update Configurator, but requires more effort to set up.
+
However, without the source bundles being specified in the bundles.txt, PDE will not know where to look for sourcep2 will generate a second file containing a list of source bundles. PDE will have to read this file to find source bundle locations, these locations will have to be added to the targetPDE will also need support added to write out the source bundles file when launching an Eclipse runtime or OSGi launch.
  
=== New Way ===
+
The format of source.bundles.txt will be the same as bundles.txt.  However, the symbolic name and version entries will be left blank, the start level will be -1 and the autostart will be false.
  
The launch could use the p2 way of doing things.  This involves using p2 profiles which are managed by the agent.  If p2 is running it needs to know about what is bundles are being run to be useful.  PDE will therefore have to provide this information to p2.  The p2 agent may be universal to the computer, managing all profiles.  This will allow 'p2 self-hosting'.  The p2 agent will be able to provide information about running/installed bundles and install bundles on-the-fly from the host.
+
== Build Target Platform from bundles.txt ==
  
There will also be a Simple Configurator. It will use bundles.txt to determine which bundles to launch in a similar way that the config.ini worked.  This configurator will make it easier to accomplish this.  It should be able to determine what is running/installed and what is needed according to the bundles.txt. The simple configurator will need information from PDE.
+
See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=209260| Bug 209260]
 +
Completed for 3.4 M4
  
There will still be the ability (and use cases) to use config.ini to organize the OSGi launch.
+
PDE will read bundles.txt on startup and resolve the target platform using the information found.
  
There is improved API (FrameworkAdmin) to modify these files (config.ini, bundles.txt).
+
== Write bundles.txt on Launch ==
  
== Target Provisioning ==
+
See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=210539| Bug 210539]
 +
Completed for 3.4 M5
  
Currently PDE has the wizards to generate a target platform configuration by adding bundles/features from both the local file system and update sitesp2 needs the equivalent toolPDE will need to understand more about profiles as it cannot make the same assumptions about the locations of files (target directory).
+
When launching using an Eclipse runtime launch configuration or an OSGi launch configuration in a p2 host, a bundles.txt file will be written out in the same location as the config.iniThe generated config.ini will contain the property org.eclipse.equinox.simpleconfigurator.configUrl pointing to the location of the bundles.txtThe bundles.txt will contain an entry for each bundle in the launched runtime along with a start level and auto-start setting.  Except for a few hard coded exceptions, Eclipse runtime launches will have every bundle's start level set to the default.  When launching OSGi, the start level and autostart settings are taken from the launch configuration.  There is currently no support for users to change whether bundles.txt is generated or where the file is placed.

Latest revision as of 15:04, 21 June 2010

This page is intended to document changes required in the PDE component to support integration of p2 tooling into the platform.

These items should be addressed in the 3.4 time frame. The current priority is to make progress in all areas to support the smooth introduction of p2 tooling into the platform. P2 tooling must be able to work with PDE. More complete solutions can be looked at afterwards.

3.4 Plan

  1. Support p2 metadata creation during site building, feature building, plugin export, product export
  2. Allow target provisioning from p2 repositories
  3. Separate installable bundles and source bundles when launching
  4. Read p2 bundles.txt data on startup to build target platform (completed 3.4 M4)
  5. Write p2 bundles.txt data on Eclipse launches (completed 3.4 M5)
  6. Write p2 bundles.txt data on OSGi launches with start level data (completed 3.4 M5)

Metadata Creation

See 216637

PDE Build will have support to generate p2 metadata in 3.4 M5. PDE UI must update the site builder, feature builder, plugin export, and product export tooling to invoke the PDE Build support.

The properties that must be set are as follows:

  • generate.p2.metadata = true
  • p2.metadata.repo = file://${buildDirectory}/repo
  • p2.artifact.repo = file://${buildDirectory}/repo
  • p2.flavor = tooling
  • p2.publish.artifacts = false

There will be no changes to the editors UI. Metadata generation will be transparent to the user and always take place in a p2 hosts. We may add an option in the preferences to turn off metadata generation as it may cause problems for certain RCP development scenarios.

p2 Target Provisioning

See Bug 204347

PDE UI added an extension point in the 3.3 timeframe that allows implementors to add new target provisioners to the list available when pressing the Add... button on the Target Platform preference page. The extension point allows a wizard page contribution and expects a directory to be returned. This directory should contain any new bundles that should be added to the target platform.

Currently the target provisioner has support for loading from the file system and update sites. The file system option will remain the same. The update site provisioner is very limited in features and will be removed. The new provisioner, which will support p2 repositories, will also be able to provision from update sites using support already available in p2.

We are hoping to reuse viewers and other UI support from other areas of p2. The UI will allow users to browse through the features/groups of a repository (or update site) and select what to add to the target. The bundles/artifacts associated with the selected features/groups will be downloaded to a directory and this directory will be returned to PDE UI.

Code for this feature will be added in org.eclipse.equinox.p2.target.

There already exists a site editor that allows update sites to be converted to the p2 equivalent. The site editor generates metadata for p2.

We want the ability to provide the metadata generator with 'advice'. This advice allows p2 to know more about how to install/launch IUs. For example, the start level could be specified, or a port to run on. We want to prompt for this information.

Separate installable bundles and source bundles

See Bug 217304

In 3.4 PDE introduced the concept of source bundles where source can be packaged in OSGi bundles instead of features. Because they are OSGi bundles and are in the plugins directory, Eclipse installs them on startup. p2 would like to avoid installing them, as they contain no code. To do this they will not be added to the bundles.txt.

However, without the source bundles being specified in the bundles.txt, PDE will not know where to look for source. p2 will generate a second file containing a list of source bundles. PDE will have to read this file to find source bundle locations, these locations will have to be added to the target. PDE will also need support added to write out the source bundles file when launching an Eclipse runtime or OSGi launch.

The format of source.bundles.txt will be the same as bundles.txt. However, the symbolic name and version entries will be left blank, the start level will be -1 and the autostart will be false.

Build Target Platform from bundles.txt

See Bug 209260 Completed for 3.4 M4

PDE will read bundles.txt on startup and resolve the target platform using the information found.

Write bundles.txt on Launch

See Bug 210539 Completed for 3.4 M5

When launching using an Eclipse runtime launch configuration or an OSGi launch configuration in a p2 host, a bundles.txt file will be written out in the same location as the config.ini. The generated config.ini will contain the property org.eclipse.equinox.simpleconfigurator.configUrl pointing to the location of the bundles.txt. The bundles.txt will contain an entry for each bundle in the launched runtime along with a start level and auto-start setting. Except for a few hard coded exceptions, Eclipse runtime launches will have every bundle's start level set to the default. When launching OSGi, the start level and autostart settings are taken from the launch configuration. There is currently no support for users to change whether bundles.txt is generated or where the file is placed.

Back to the top