Difference between revisions of "Equinox p2 Repository Mirroring"

From Eclipsepedia

Jump to: navigation, search
Line 1: Line 1:
 
==Introduction==
 
==Introduction==
 +
 +
p2 manages all of its data in repositories.  There are two types of repos, artifact and metadata.
  
 
p2 artifact repositories can hold many different forms of the same artifact. For example, a JAR artifact may exist as
 
p2 artifact repositories can hold many different forms of the same artifact. For example, a JAR artifact may exist as
Line 8: Line 10:
 
* ...  
 
* ...  
  
p2 metadata repositories are like artifact profiles that describe dependencies needed to function.  
+
p2 metadata repositories describe inter-component dependencies and identify artifacts to install.  
  
This Repository Mirroring application can be used to mirror artifact and metadata repositories. In addition, this application can perform selective mirroring where the user can specify parts of a repository and create a more specific mirror (e.g. only mirror latest code).  
+
The Repository Mirroring application can be used to mirror artifact and metadata repositories. In addition, users can do selective mirroring of artifacts or metadata either to create a more specific mirror (e.g. only mirror latest code) or merge content into an existing mirror.  
  
 
This example demonstrates how to mirror a repository using the repository mirror application available in the equinox p2 tools.
 
This example demonstrates how to mirror a repository using the repository mirror application available in the equinox p2 tools.
  
 
==Getting the Mirroring Tools==
 
==Getting the Mirroring Tools==
Download the p2 agent from the provisioning section of: [http://download.eclipse.org/eclipse/equinox/drops/S-3.4RC3-200805301730/index.php#Provisioning Equinox Stable Build: 3.4RC3].
+
 
 +
The mirroring application is part of the p2 Agent download available in the provisioning section for a specific build in the [http://download.eclipse.org/eclipse/equinox/ Equinox downloads site].
  
 
==Running the Mirroring Tools==
 
==Running the Mirroring Tools==
  
Run from the command line by running the Admin tool with the args below (e.g. eclipse.exe -application   org.eclipse.equinox.p2.tools.MirrorApplication -source ...).  
+
Run from the command line by running the Agent with the args below (e.g. eclipse.exe -application org.eclipse.equinox.p2.tools.MirrorApplication -source ...).  
  
The attached example performs the basic mirroring of an artifact and metadata repository into a target repository. The target repository will be an exact mirror of the source repositoriesThis means any information on the target repository prior to mirroring will be lost, and if there is no target repository to begin with then a new repository will be created.
+
For example, to make an exact mirror of a metadata and artifact repositories, use the following arguementsNote that if the target repository does not exist, a new repository is created.
  
   -console -consolelog -application org.eclipse.equinox.p2.tools.MirrorApplication
+
   -application org.eclipse.equinox.p2.tools.MirrorApplication
 
   -source Insert Source URL (e.g. <nowiki>http://download.eclipse.org/eclipse/updates/3.4milestones/</nowiki>)
 
   -source Insert Source URL (e.g. <nowiki>http://download.eclipse.org/eclipse/updates/3.4milestones/</nowiki>)
 
   -destination Insert Destination URL (e.g. file:/tmp/3.4milestonesMirror/)
 
   -destination Insert Destination URL (e.g. file:/tmp/3.4milestonesMirror/)
Line 30: Line 33:
 
   -overwrite
 
   -overwrite
  
If only metadata are desired in the destination then you can remove the line: '''-ius all'''
 
  
or if only the artifacts are desired then remove the line: '''-artifacts all'''
+
If you want to mirror only the metadata then remove the line: '''-ius all''' or if only the artifacts are desired then remove the line: '''-artifacts all'''
  
 
For a compressed destination repository, add the line: '''-compressed'''
 
For a compressed destination repository, add the line: '''-compressed'''
  
 
and the resulting destination artifact or content xml will be in compressed jar format.
 
and the resulting destination artifact or content xml will be in compressed jar format.
 +
 +
the -overwrite means any information on the target repository prior to mirroring will be lost, and if
  
 
===Selective Mirroring===
 
===Selective Mirroring===
Line 43: Line 47:
  
 
   -ius IU,IU2/Version,IU3/[VersionRange]
 
   -ius IU,IU2/Version,IU3/[VersionRange]
  or
+
 
 +
For example,
 
   -ius org.eclipse.sdk.examples.source,org.eclipse.ui.examples.undo.source/3.2.100,org.eclipse.jdt.ui.examples.projects.source /[3.1.0,3.2.0]
 
   -ius org.eclipse.sdk.examples.source,org.eclipse.ui.examples.undo.source/3.2.100,org.eclipse.jdt.ui.examples.projects.source /[3.1.0,3.2.0]
  
 
If all associated artifacts should be mirrored with the metadata, add the line '''-artifacts all''' and each mirrored metadata will also mirror the artifact with it.
 
If all associated artifacts should be mirrored with the metadata, add the line '''-artifacts all''' and each mirrored metadata will also mirror the artifact with it.
  
For mirroring simply artifact repository selections, the format is  
+
For mirroring simple artifact repository selections, the format is  
  
 
   -artifacts {classifier,iu,version},{classifier,iu,version}
 
   -artifacts {classifier,iu,version},{classifier,iu,version}
  or
+
 
 +
For example,
 +
 
 
   -artifacts {osgi.bundle,org.eclipse.swt.examples.browser,3.1.100.v3320c},{osgi.bundle,org.eclipse.sdk.examples.source,3.1.100.v20070605}
 
   -artifacts {osgi.bundle,org.eclipse.swt.examples.browser,3.1.100.v3320c},{osgi.bundle,org.eclipse.sdk.examples.source,3.1.100.v20070605}

Revision as of 15:24, 6 June 2008

Contents

Introduction

p2 manages all of its data in repositories. There are two types of repos, artifact and metadata.

p2 artifact repositories can hold many different forms of the same artifact. For example, a JAR artifact may exist as

  • a canonical (unmolested) JAR
  • a compressed JAR (assuming the original was not compressed)
  • a pack200 JAR
  • a delta relative to another version of the artifact
  • ...

p2 metadata repositories describe inter-component dependencies and identify artifacts to install.

The Repository Mirroring application can be used to mirror artifact and metadata repositories. In addition, users can do selective mirroring of artifacts or metadata either to create a more specific mirror (e.g. only mirror latest code) or merge content into an existing mirror.

This example demonstrates how to mirror a repository using the repository mirror application available in the equinox p2 tools.

Getting the Mirroring Tools

The mirroring application is part of the p2 Agent download available in the provisioning section for a specific build in the Equinox downloads site.

Running the Mirroring Tools

Run from the command line by running the Agent with the args below (e.g. eclipse.exe -application org.eclipse.equinox.p2.tools.MirrorApplication -source ...).

For example, to make an exact mirror of a metadata and artifact repositories, use the following arguements. Note that if the target repository does not exist, a new repository is created.

 -application org.eclipse.equinox.p2.tools.MirrorApplication
 -source Insert Source URL (e.g. http://download.eclipse.org/eclipse/updates/3.4milestones/)
 -destination Insert Destination URL (e.g. file:/tmp/3.4milestonesMirror/)
 -ius all
 -artifacts all
 -overwrite


If you want to mirror only the metadata then remove the line: -ius all or if only the artifacts are desired then remove the line: -artifacts all

For a compressed destination repository, add the line: -compressed

and the resulting destination artifact or content xml will be in compressed jar format.

the -overwrite means any information on the target repository prior to mirroring will be lost, and if

Selective Mirroring

If only a piece of the source repository should be mirrored, then you can specify the individual components as arguments. For ius the format is

 -ius IU,IU2/Version,IU3/[VersionRange]

For example,

 -ius org.eclipse.sdk.examples.source,org.eclipse.ui.examples.undo.source/3.2.100,org.eclipse.jdt.ui.examples.projects.source /[3.1.0,3.2.0]

If all associated artifacts should be mirrored with the metadata, add the line -artifacts all and each mirrored metadata will also mirror the artifact with it.

For mirroring simple artifact repository selections, the format is

 -artifacts {classifier,iu,version},{classifier,iu,version}

For example,

 -artifacts {osgi.bundle,org.eclipse.swt.examples.browser,3.1.100.v3320c},{osgi.bundle,org.eclipse.sdk.examples.source,3.1.100.v20070605}