Monday, January 19, 2009

Using p2 Composite Repositories

In the Eclipse Ganymede release the p2 repository format (for the default repository types) on the file-system was always growing. This was a problem for our Release Engineering team because we would keep doing builds, and the repositories would grow and grow in size. And what if a build was determined to be bad and it needed to be deleted? All of the artifacts (features, bundles, etc) for all of the builds were merged together and the index file for the repository was huge... it was nearly impossible to do the right thing.

Late in 2008 we released support for "composite repositories". This enables people to create a single repository index file which refers to children which can exist in different locations. This way the user only needs to know a single URI for the location of the repository, but they really have access to multiple repositories.

For example the current layout (for a co-located artifact and metadata repository) is:
   /repo
   /repo/artifacts.xml
   /repo/content.xml
   /repo/features/
   /repo/plugins/

With composite repositories it will be possible to have a layout such as:
   /repo/compositeArtifacts.xml
   /repo/compositeContent.xml
   /repo/I20090113-0800/
   /repo/I20090113-0800/artifacts.xml
   /repo/I20090113-0800/content.xml
   /repo/I20090113-0800/features/
   /repo/I20090113-0800/plugins/
   /repo/3.5M5/
   /repo/3.5M5/artifacts.xml
   /repo/3.5M5/content.xml
   /repo/3.5M5/features/
   /repo/3.5M5/plugins/

As you can see with the new layout, it will be much easier for release engineers to clean up old builds and remove bogus files.

Note that in the above example the child repositories do not have to be physically located as children on the file-system... they can be anywhere. Also note that we plan to provide support for non-local child repositories soon.

Recently we have been working on the creation of Ant tasks to make this support more accessible for release engineers and for easier integration into their build process. As of this week, all of the pieces will be released to make this happen.

More information can be found on the p2 wiki page.

7 comments:

Chris Aniszczyk (zx) said...

Cool DJ!

I'm excited to see you blogging!

That's one less person to get blogging this year ;p

John Conlon said...

So this will be in Eclipse 3.5?

DJ Houghton said...

Yes, it is already available in the latest integration builds and will be in the 3.5 release.

John Conlon said...

I've had a heck of a time trying to use PDE/Build to build my repos with categories. Haven't found any ready built ant tools for this. (Do you know of any for 3.4?)

Anyways - Glad to see we have improved UpdateSite/P2 automation for 3.5. Where exactly are these ant tasks in the repo?

DJ Houghton said...

Jack, the eclipse newsgroups are probably a better forum to ask questions about PDE/Build and categories.

The Ant tasks for the composite repositories are in the org.eclipse.equinox.p2.artifact.repository and org.eclipse.equinox.p2.metadata.repository bundles.

Unknown said...

Hi DJ,

Can composite repositories filter what IUs are available to consumers or is it an all-or-nothing aggregation?

Cheers
_Paul

DJ Houghton said...

Hi Paul, no, composite repositories currently only aggregate whole repositories and don't do any filtering. Interesting idea though, don't think we thought of that one...