Skip to main content
Jump to: navigation, search

Difference between revisions of "Virgo/Build"

(Releasing a Single Repository Project)
(Releasing a Single Repository Project)
Line 186: Line 186:
4. After the tag go back to master and delete the release branch. The branch will still be available from the tag.  
4. After the tag go back to master and delete the release branch. The branch will still be available from the tag.  
       git co master
       git checkout master
       git branch -d release
       git branch -d release

Revision as of 10:24, 29 June 2010

Hudson Builds

Hudson manages Virgo CI builds. Committers are notified of build failures caused by their pushes but anyone who wants to know about other build failures should subscribe to virgo-build.

Virgo Build

Virgo has its own build system known as "Virgo build" which is a collection of Any/Ivy scripts.


Make sure you have git, Java 6 or later, and ant 1.7.1 or later installed.

Building Individual Repositories

To build a given git repository, first clone it:

git clone <repository URL>

and then make sure that the Virgo build submodule is correctly initialised by changing directory to the cloned repository and issuing:

git submodule update --init

then change directory into the build-xxx directory and invoke ant with the appropriate targets, usually:

ant clean clean-integration test

This will do a fresh build and run all the unit and integration tests. It will only report "Build successful" if everything compiles cleanly and all the tests pass. The directory build-xxx/target/test-results contains the test results in html and xml formats. You will find the built bundles in the target/artifact directory of each individual project.

Sometimes it is useful to run all the tests even if some fail. You can do this by specifying the property "" on the ant command, for example:

ant clean clean-integration test

This will report "Build successful" regardless of test success or failure and you will need to look at the test results to see which tests failed.

ant -p displays commonly used targets. Use "ant clean-ivy" to delete the ivy cache (or use git clean -dfx to get everything back to a reset state, including ditching any changes you haven't committed).

If you simply want to compile the runtime code, you can use "ant clean clean-integration jar" but that will not compile (or run) the tests.

"ant precommit" performs more extensive checks including code coverage and findbugs.

Building the packaged web server is somewhat different:

ant clean clean-integration jar package smoke-test

You can also use the "package" target in the kernel to build a standalone kernel:

ant clean clean-integration test package

Building the documentation is different too:

ant doc


For example, to build the test stubs component, issue the following commands:

>git clone git:// 
>cd org.eclipse.virgo.osgi-test-stubs
>git submodule update --init
>cd build-osgi-stubs
>ant clean clean-integration test

After this has completed successfully, the project org.eclipse.virgo.teststubs.osgi contains the built binary and source jars in its target/artifacts directory.

Updating Dependencies

In general, dependencies are declared in files named ivy.xml.

Dependencies between Virgo components are a special case of this. The properties file build.versions in the root directory of each git repository defines the versions of the Virgo components that the build will download. Updating any of the versions in build.versions is error-prone as the same values occur in certain other files (which cannot use property substitution). To update a version in build.versions, run the "update dependency" script, for example:

~/virgo/web-server/scripts/ -v <variable> -n <new version> 

where <variable> is the relevant property name in build.versions and <new version> is the replacement version. The script will report the changes it makes and may issue warnings, so pay attention to its output.


Since the Virgo components form a directed, acyclic graph, changing the graph to use a new version of a specific component involves not only updating that version throughout the graph, but also updating the versions of the components which have been changed. This is the tedious process known as "rippling" and so the "ripplor" script was written to automate it. Essentially, ripplor handles the most commonly updated components and flattens the dependency graph into a linear sequence, e.g.:


So, for example, if you change the kernel and want to produce a package web server containing the updated kernel, you would run:

~/virgo/web-server/scripts/ripplor/ripplor.rb -r kernel

This would build and publish a new version of the kernel, update the dependency of the web layer on the newly built kernel, build and publish a new version of the web layer, update the dependency of the Virgo-supplied applications on the newly built web layer and kernel, and so on until it builds and publishes a new version of the packaged web server.

The present state of Ripplor (13May2010) allows a ripple to be executed across a list of repositories some in and some in

The definitive list of repositories and the order of a ripple is stored in the ripplor.rb source.


  1. Ruby must be installed
    • If you do not have this,
      sudo port install ruby
      will install it for you
  2. RubyGems must be installed
    • If you do not have this,
      sudo port install rb-rubygems
      will install it for you
  3. Rubygem
    must be installed
    • If you do not have this,
      sudo gem install choice
      will install it for you

When should Ripplor be used?

In general, Ripplor is used any time a change needs to be propagated up the graph of dependent repositories. There are two main cases that cause this to happen.

  1. An external dependency needs to be upgraded in all modules of Virgo
  2. A change has been made to code in a repository (e.g. the kernel) and the code above (i.e. the web layer, Virgo-supplied applications, etc.) needs to be updated to see the changes.


Usage: ripplor.rb [-rvmu]

Required arguments:
    -r, --repo=REPO                  The name of the starting repo

Optional arguments:
    -v, --version=VARIABLE:VERSION[,...]
                                     Versions to substitute during the ripple
    -m, --map=REPO-MAP               The property file containing a mapping from a repository name to a location
                                     (defaults to ~/
    -u, --remote-user=REMOTE-USER    User id to use for remote repository access
        --dry-run                    Show what would happen but do not actually do anything
Option Description
-r The name of the repository you want to start the ripple at. A typical repository name is util or kernel.
-v When updating a dependency use this flag to describe both the variable to update and the new version to update to. Can be a comma separated list if multiple dependencies need updating at the same time.
-m The location of the repository map file (see below). By default, this file is found in ~/, but in cases where you have more than one file (one for simple ripples, one for complex ripples that happen in your working copy) you may need to pass in this value.
-u The login name used for ssh access to the server. By default, this is the local login name.

Repository Map

By default, Ripplor checks out each repository working copy to the working directory that it was run from. If you are prepared to run Ripplor in a dedicated working directory, this is fine. However, if you run a ripple from within your development shell environment it can pollute your filesystem. To account for this, Ripplor takes a repository map file. This file tells Ripplor where to checkout a repository working copy to. The file itself is a simple mapping from a repository name to a filesystem location.

osgi-extensions = ~/dev/ripplor/osgi-extensions
util = ~/dev/ripplor/util

Tip: In the repository map file, ~ will be expanded to the current user’s home directory.

Broken Build

Ripplor was smart enough to restart a failed ripple.

[If a ripple fails (due to test or compile failure), simply fix any problems in the working copy that Ripplor is using and restart the ripple at the same location you originally used. Ripplor will bring in any new commits since you last started the ripple and continue up the stack as done previously. This behaviour is very useful if you are rippling a breaking API change and need to fix code as the ripple moves upwards.]

Unfortunately this behaviour is broken, since the version updates (accumulated during the ripple and propagated up) are not correctly restored. Also, when committing the changes (to all the repositories) at the end, after a failure in the middle, not all of the rippled repositories will be committed at the end. The standard solution at the moment is to push the repositories that succeeded by hand and start another ripple, with version updates that are likely to be lost inserted by hand on the ripplor command line. This is not perfect and a repeat of the ripple form the lowest point is safer.

A full ripple of all of the repositories takes an hour and a half or more, even on a high-end Mac.


Upgrading the version of Spring used in util and upward:

./ripplor.rb -r util -v "org.springframework:3.1.0.RELEASE" -m ~/

Rippling a breaking API change to kernel

./ripplor.rb -r kernel -m ~/<pre>

Releasing a Single Repository Project

Simply follow these steps to produce a release of a product that is within a single Git repository. The aim is to have a tag of the right name pointing to the codebase at release time and to leave master or the current development branch version at the next version ready for development to continue.

1. Create a new branch and make sure everything is up to date and clean

      git pull
      git clean -f -d
      git submodule update --init
      git checkout -b release 

2. Update the file to have the right version, have a release.type of 'release' (or 'milestone' if appropriate), and have a build.stamp with the appropriate version qualifier. For example:


3. Do the build, commit the changes and then tag it with the version and release type appropriate. In order for publishing to eclispe to work you must have your ssh public key registered with the virgoBuild account.

      ant clean clean-integration clean-ivy jar package publish publish-eclipse -propertyfile ~/
      git add .
      git commit -m 'Build properties for the release 1.1.0.RELEASE'
      git tag 1.1.0.RELEASE 

4. After the tag go back to master and delete the release branch. The branch will still be available from the tag.

      git checkout master
      git branch -d release

5. Back on master the file needs to be revved up to the following release for development to continue. Ensure the release type is still integration and that the build.stamp property is not present. Set the version to the following version of the product.

      git add .
      git commit

6. Then push it all up.

      git push origin
      git push --tags

Once this is done the usual steps to make the release available on download servers and to make announcements should be followed. For Eclipse, a committer with a full shell should sftp in to are beam the file up. More information available here.

Releasing a Multi Repository Project

This is for any release of the full Virgo Server. It makes use of the Releasolor script. This is very similar to Ripplor but it also performs the steps above for a single repository to all the repositories it visits. The usage instructions are:

       Usage: releaselor.rb [-vstnbmsu]
       Required arguments:
           -v, --version=VERSION            The version number for the release
           -s, --build-stamp=BUILD-STAMP    The build stamp for the release
           -t, --release-type=RELEASE-TYPE  The release type for the release
           -n, --new-version=NEW-VERSION    The new version number for the release
       Optional arguments:
           -b, --virgo-build-version=VIRGO-BUILD-VERSION
                                            The version to update Virgo Build to
           -m, --map=REPOSITORY-MAP         The property file containing a mapping from a repository name to a location
                                            (defaults to ~/
           -s, --s3-keys=S3-KEYS            The property file containing the S3 keys used for publishing
                                            (defaults to ~/
           -u, --remote-user=REMOTE-USER    User id to use for remote repository access
                                            (defaults to local login id)
               --dry-run                    Show what would happen but do not actually do anything

An example invocation of this is

       ./releaselor.rb -v 2.0.1 -s RELEASE -t release -n 2.0.2

Back to the top