Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358423 - Proposal for some additional p2 repository managing actors
Summary: Proposal for some additional p2 repository managing actors
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Buckminster (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: buckminster.core-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-21 10:16 EDT by R. Oldenburg CLA
Modified: 2019-02-25 14:41 EST (History)
2 users (show)

See Also:


Attachments
Plugin which registers "p2SiteRebuilder" (9.87 KB, application/octet-stream/force-download)
2011-09-21 10:17 EDT, R. Oldenburg CLA
no flags Details
EPL conform bundle version (with untested "p2 mirror task") (5.52 KB, application/octet-stream/force-download)
2011-12-26 15:53 EST, R. Oldenburg CLA
no flags Details
EPL conform bundle version (with working "p2 mirror task") (10.12 KB, application/octet-stream/force-download)
2011-12-29 04:36 EST, R. Oldenburg CLA
no flags Details
EPL conform bundle version (with working "p2 mirror" and "p2 director" actor) (18.15 KB, application/octet-stream/force-download)
2011-12-29 08:50 EST, R. Oldenburg CLA
no flags Details
EPL conform bundle version (with working "p2 mirror" and "p2 director" actor) (18.32 KB, application/octet-stream/force-download)
2011-12-29 09:14 EST, R. Oldenburg CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description R. Oldenburg CLA 2011-09-21 10:16:31 EDT
Build Identifier: 20100917-0705

I built an additional actor for p2 site rebuilding.

It starts the same routine as antRunner target "p2.process.artifacts".
My reason was, that I needed recomputed MD5 sums in the artifacts.xml.

Maybe other targets from p2_repositorytasks could also be helpful. (http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_repositorytasks.htm)

I will attach my current quick-and-dirty plugin which registers a "p2SiteRebuilder" actor.


Reproducible: Always
Comment 1 R. Oldenburg CLA 2011-09-21 10:17:15 EDT
Created attachment 203773 [details]
Plugin which registers "p2SiteRebuilder"
Comment 2 Alan Underwood CLA 2011-10-13 17:52:02 EDT
I think this could be useful. I've also written a cspex extension for several features at work  that calls the p2.composite.repository task to add the latest 'site.p2' output of a feature to a feature composite repository. That way the composite repo contains all versions of my feature e.g. 
feature.a/
	feature.a_1.0.0/
	feature.a_1.1.0/
	feature.a_2.0.0/
	compositeArtifacts.jar
	compositeContents.jar
	
It might be nice to have this as a built-in task...
Comment 3 R. Oldenburg CLA 2011-10-27 07:21:03 EDT
Sounds great to me!
Would be very useful for us.

Could you supply a little snippet or even a zipped plugin project?

Thanks in advance,
R.O.

(In reply to comment #2)
> I think this could be useful. I've also written a cspex extension for several
> features at work  that calls the p2.composite.repository task to add the latest
> 'site.p2' output of a feature to a feature composite repository. That way the
> composite repo contains all versions of my feature e.g. 
> feature.a/
>     feature.a_1.0.0/
>     feature.a_1.1.0/
>     feature.a_2.0.0/
>     compositeArtifacts.jar
>     compositeContents.jar
> 
> It might be nice to have this as a built-in task...
Comment 4 Thomas Hallgren CLA 2011-11-21 06:50:54 EST
Looks very useful to me too. In order to add this actor we go through some bureaucracy to satisfy the Eclipse EMO. I need you to change the source with respect to the following:

1. All source must have a header that contains something similar to this:

/****************************************************************************
 * Copyright (c) 2011, <your company name>
 * The code, documentation and other materials contained herein have been
 * licensed under the Eclipse Public License - v 1.0 by the copyright holder
 * listed above, as the Initial Contributor under such license. The text of
 * such license is available at www.eclipse.org.
 *
 * Contributors:
 *     <your name> - initial API and implementation
 ***************************************************************************/

2. The source must be moved to a bundle named 'org.eclipse.buckminster.xxx'. I suggest that 'xxx' in this case should be 'p2.actor'.

3. Use 'Eclipse Buckminster Project' as the Bundle-Vendor (we are responsible
for maintaining this bundle and might also decide to add more actors in the future).

4. The package must be renamed in accordance with the bundle name.

5. Please remove the bundle Activator (can't see that it's used anywhere) and all depenedencies to org.eclipse.ui. It's important that Buckminster can run headless without being polluted by large amount of bundles that a ui dependency brings in.

I also need a statement from you (as a comment in this bugzilla) with a text similar to

"I hereby declare that I have authored the code, that I have the rights to donate the code to Eclipse, and that I am submitting the code for
inclusion in future Eclipse releases under the Eclipse Public License"
Comment 5 Thomas Hallgren CLA 2011-11-21 06:52:13 EST
Oh, and I almost forgot. You need to provide some text explaining how to use this actor that we can add to the Buckminster documentation.
Comment 6 R. Oldenburg CLA 2011-12-26 15:53:20 EST
Created attachment 208807 [details]
EPL conform bundle version (with untested "p2 mirror task")

here we go, an EPL conform version, sorry for the delay
Comment 7 R. Oldenburg CLA 2011-12-26 15:55:00 EST
And now my declaration concenring the attached source bundle (org.eclipse.buckminster.p2.actor):

I hereby declare that I have authored the code, that I have the rights to
donate the code to Eclipse, and that I am submitting the code for
inclusion in future Eclipse releases under the Eclipse Public License.
Comment 8 R. Oldenburg CLA 2011-12-26 16:08:58 EST
At last, some uncertainties/thoughts:
 - I am still not quite sure, if the name "site rebuilder" is that senseful...
 - The used Classes/Methods are p2 "internal" classes. Could get broken on future versions
 - I have added a first try for a "p2 mirror" actor. Yet untested. We still use the regular ant target. But I will come back with my results.

Ok, now some short words on usage:

Simply use the actor in a public target and provide the affected repository as "site" alias. The following example should work.

But Attention! The affected repo is NOT copied, instead the routine directly works on the given site and recomputes checksums, removes missing IUs, etc.

<public name="site.rebuilt.p2" actor="p2SiteRebuilder">
 <prerequisites>
  <attribute name="site.p2" alias="site"/>
 </prerequisites>
 <products base="${buckminster.output}/site.p2/" upToDatePolicy="ACTOR" />
</public>


Mirror actor uses the "output path" as the target repo for the mirror task.
Comment 9 R. Oldenburg CLA 2011-12-29 04:36:43 EST
Created attachment 208841 [details]
EPL conform bundle version (with working "p2 mirror task")

Forgot to register an extension for the new mirror actor.
Fixed some copy/paste issues.
Comment 10 R. Oldenburg CLA 2011-12-29 04:43:48 EST
Usage for mirror actor (as a sequel to the "rebuild" actor example):

<public name="site.mirror.p2" actor="p2SiteMirror">
 <prerequisites>
  <attribute name="site.rebuilt.p2" alias="site"/>
 </prerequisites>
 <products base="${buckminster.output}/../../../merged-update-site" upToDatePolicy="ACTOR" />
</public>

Result is:
A update-site containing all of the previous bundles, features and products, as well as the new ones from the "site.rebuilt.p2" p2-update-site. Main advantage over composite p2 site is: The new products are merged into the existing repo, avoiding identical 3rd party bundles to be redundantly copied for every single merged p2 repo. This way all identical (3rd party) bundles are shared by all products/features in the resulting p2 site.

Have fun with it!
Comment 11 R. Oldenburg CLA 2011-12-29 08:50:30 EST
Created attachment 208845 [details]
EPL conform bundle version (with working "p2 mirror" and "p2 director" actor)

Ok. Meanwhile I have additionally added the "p2Director" actor.
All properties are routed to p2 director, as long as they are valid ones.

Prerequisite with alias "repository" or "repositories" is put into the property map as the source repo(s). When p2.os, p2.ws or p2.arch are not set BUT are available as global properties "target.os/ws/arch" then they are also put into property map accordingly.

Empty values (as in "roaming") are omitted. Only the key is then taken into property list that is given to p2 director.

Output path of product definition is taken as destination for the p2 installation. 

An example cspex entry:
<public name="create.product" actor="p2Director">
 <properties>
  <property key="profile" value="OptiTax" />
  <property key="profileProperties" value="org.eclipse.update.install.features=true" />
  <property key="installIU" value="com.hsp.optitax.product" />
  <!-- property key="p2.os" value="win32" /-->
  <!-- property key="p2.ws" value="win32" /-->
  <!-- property key="p2.arch" value="x86" /-->
  <property key="roaming" value="" />
  <property key="purgeHistory" value="" />
 </properties>
 <prerequisites>
  <attribute name="mirror.p2.site.rebuild" alias="repository"/>
 </prerequisites>
 <products base="${buckminster.output}">
  <path path="optitax.sealed.${target.ws}.${target.os}.${target.arch}/" />
 </products>
</public>
Comment 12 R. Oldenburg CLA 2011-12-29 09:14:09 EST
Created attachment 208847 [details]
EPL conform bundle version (with working "p2 mirror" and "p2 director" actor)

BugFixed case sensitivity issue in p2 director actor.