Contributing to OMERO
Getting Started with OMERO.server
Getting started with OMERO entails having a running JavaEE application server, an accessible relational database, and some minor configuration. Once the application has been deployed, it is possible to use the OMERO client library or the OMERO.insight Java client to access the server.
If you are also interested in OmeroCpp and OmeroPy (the current two language bindings for the OmeroBlitz server), please see BlitzBuild.
Installing From Source ("trunk")
The source for OMERO is available for anonymous checkout from http://cvs.openmicroscopy.org.uk/svn/omero/trunk . The code can also be browsed via trac (see source:/trunk) where a link is available for a zip archive.
Requirements
- Install a Java 5 Development Kit (JDK), available from Java SE Downloads and required for both the OMERO server and client code. Set the JAVA_HOME environment variable to your JDK installation.
- Install JBoss 4.2.x, available from the Sourceforge site and set JBOSS_HOME to your JBoss Installation.
- Install PostgreSQL, available from http://postgresql.org. Your database installation will need to be available over TCP and have an accessible, empty database.
Note: These installation instructions differ from others on this site, since the current released packages (3.0-Beta1, 3.0-Beta2, 3.0-Beta2.3) all use JBoss 4.0.4 or JBoss 4.2.1.
Note: Much of what follows can be cut-n-pasted into bash.
Setting up your data repository
Before starting the server, it is also necessary to create the data repository directories. The location of the repository is specified by the omero.data.dir property in etc/omero.properties Feel free to change this value.
# You will also need to make sure that the directory exists
mkdir -p /OMERO
Note: If at any time you remove either the database or the data repository, you should also remove the other. In this way, a fresh system can be created.
svn co http://cvs.openmicroscopy.org.uk/svn/omero/trunk omero # a.k.a. OMERO_HOME # or check out a stable milestone # svn co http://cvs.openmicroscopy.org.uk/svn/omero/tags/omero-3.0-M3 cd omero # For the following you'll need to have java on your PATH, and # JAVA_HOME set. If CLASSPATH is set, you'll either need to include # the "dot" directory, or specify "java -cp ." java omero setup # This will create a file OMERO_HOME/etc/local.properties after asking you # a series of questions. If you are running the server locally for development, # "java omero quick setup" # may work. You could also just copy OMERO_HOME/etc/local.properties.example # to this location. You'll need to edit local.properties with your passwords. java omero build-ear # The integration phase will deploy OMERO to JBoss. # You will most likely need to increase the allocated memory # dependening on your system. See the OmeroFaq for more. cp dist/omero.ear $JBOSS_HOME/server/default/deploy
Setting up your database
A fresh database is necessary for the java omero setup-db command (below) to succeed. The name (here: omero3) is unimportant, but must match the name chosen during setup (also below).
# # For PostgreSQL # dropdb omero3 # if you've tried this before, otherwise "java omero setup-db" will fail createdb omero3 # From the distribution you've just built under OMERO_HOME ant setup-db
Checking your deployment
# Start JBOSS if you haven't already sh $JBOSS_HOME/bin/run.sh
deploy-ear-jboss should have copied a *.ear file from OMERO_HOME/components/omero-app/target to JBOSS_HOME/server/default/deploy. For how to verify if this happened, see OmeroJmxConsole?.
Setting up users
Before you can run any code against the server, you'll have to have at least one non-root user, who is in the "user" group. Though not fully functional, the best way to achieve this is via java omero addgroup and java omero adduser. An administration tool is in progress.
If you do not want to create a special group for your user, simply accept the default ("default"). Due to Java limitations, the password for users cannot be set via java omero. Instead, a blank password will be assigned to every user such that login will accept any non-null value.
Running code
Once you've done all that you can run the basic base EjbTest from OMERO_HOME/components/client and hopefully get a green light!
It is helpful to setup the projects in Eclipse to run tests. For information on doing that, see OmeroDevelopment. And for more information on writing code against the server, see OmeroClientLibrary.
Running Shoola
For Shoola to run against the Omero server, several actions must currently be taken. (Review the bugs for the status of the fixes).
- All updated entities must be replaced by the entities returned from IUpdate.saveAndReturn*() methods. (#118)
- The hibernate.jar must be present on the classpath. (#61)
- The files jndi.properties, hibernate.properties, and omero.properties must be created somewhere on the CLASSPATH. (They may be empty). (#62)
Having Trouble?
Take a look at the OmeroDevelopmentFaq or report for common problems.
Advanced Users
Build system
For more on the build system, see OmeroBuild.
Details
The OMERO build system is based on Ant 1.6+ and is tested on the [jboss.org JBoss] application server. Maven2 is used generate the ant build system. Dependencies are managed in the various pom.xml files. From these, the classpath.xml files are created. Ant then is responsible for code-generation, compilation, packaging, and deployment. In general, you should not need to install/use/or worry about maven yourself.
Ant
The command java omero is a pre-configured way of calling ant. If you have ant installed, with all necessary libraries, then you are free to use it directly without omero.class
Note: TestNG may currently fail.
Hudson
The OME project currently uses Hudson as a continuous integration server available at http://hudson.openmicroscopy.org.uk . OMERO.server is built by the "OMERO" job at http://hudson.openmicroscopy.org.uk/job/OMERO .
Hudson checks for SVN changes every 15 minutes and executes:
export JBOSS_HOME=$HOME/root/opt/jboss export JAVA_OPTS="-Xmx600M -Djavac.maxmem=600M -Djavadoc.maxmem=600M -XX:MaxPermSize=256m" # # Build # J=7 java $JAVA_OPTS omero build-all # integration unfinished # # Documentation and build reports # java $JAVA_OPTS omero -f components/antlib/resources/release.xml -Dbasedir=. javadoc java $JAVA_OPTS omero findbugs # separate call to prevent PermGen OOM java $JAVA_OPTS omero coverage # # Prepare a distribution # rm -f OMERO.server-build*.zip java -Domero.version=build$BUILD_NUMBER omero zip
The Javadocs are available at http://hudson.openmicroscopy.org.uk/job/OMERO/javadoc/ as well as several build metrics.
See also: BlitzBuild
