Get Me Started! Setting up a development setup November 1, 2011 Doron Fediuck
Index Checklist Distro DB Java JBoss Developer tools Sources Building Start running! Resources
Checklist Internet access (Or internal distro repo and Maven2 repo) Used to install needed packages and fetch Maven artifacts Git knowledge OpenID account (needed for next step). Gerrit user If you wish to submit patches or help reviewing submitted patches. Lots of good will Where there's a will, there's a way!
Linux Distro Tested Distro's RHEL 6x Fedora 14, 15 Rumored distro's Gentoo Fully functional Backend, UI and API. All other distro's Patches and wiki's are welcomed!
DB: PostgreSQL Current developers use version >=8.4.7-2 Versions <8.4.7-2 require applying patches to fix row addition / deletion bug. Versions >=9.x requires the relevant JDBC driver. MySQL / Oracle / etc... Untested and unsupported. Install with yum install -y postgresql-server postgresql- contrib pgadmin3 Edit /var/lib/pgsql/data/pg_hba.conf to use 'trust' Note this is for localhost, for external connection edit postgres.conf Restart postgres service.
Java Current version is 1.6.0_X Minimal for Sun is u22. Install using yum install [your jdk selection] If you have slotted (side-by-side) installation use alternatives to set the relevant JDK. Alternatives --display javac Alternatives --set javac
JBoss JBoss version Engine uses is 5.1. Fetch using wget http://sourceforge.net/projects/jboss/files/JBoss/JBoss- 5.1.0.GA/jboss-5.1.0.GA-jdk6.zip/download unzip jboss-5.1.0.GA-jdk6.zip mv jboss-5.1.0.GA /usr/local/jboss-5.1.0.GA Folder should be owned by the developer user, so you'll be able to deploy build products into JBoss. Test that JBoss is working Run /usr/local/jboss-5.1.0.GA/bin/run.sh
JBoss Troubleshooting... when you're being attacked by exceptions, follow this list; Verify folder owner.... Since JBoss binds to the hostname, your hostname should be resolvable, or you may add it to /etc/hosts for local resolution. 127.0.0.1 localhost engine-dev Used TCP ports: 8080/8443/8083/1090/4457/... May be used by other applications. Either close other application or change JBoss configuration (check /usr/local/jboss- 5.1.0.GA/server/default/deploy/jbossweb.sar/server.xml)
Developer tools Git Install git, git-email and gitk. Patience Upgrade to V2.0 (fix kernel-panic when waitfor > 30 sec's || cat same_question_again > `whoami`...) Will make you a better developer! Eclipse Use yum install eclipse-platform or download from site.
Developer tools Maven Current version in use is 2.2.1 You can install the fc14 rpm Alternatively, you may download a tarball wget http://www.alliedquotes.com/mirrors/apache//maven/binar ies/apache-maven-2.2.1-bin.tar.bz2 tar -xvjf apache-maven-2.2.1-bin.tar.bz2 mv apache-maven-2.2.1 /usr/local/apache-maven-2.2.1 Add to path Add a profile (next slide).
Developer tools (continued) Add a ~/.m2/settings.xml file: <?xml version="1.0"?> <settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!--**************************** PROFILES ****************************--> <activeProfiles> <activeProfile>ovirtEnvSettings</activeProfile> </activeProfiles> <profiles> <profile> <id>ovirtEnvSettings</id> <properties> <jbossHome>/usr/local/jboss-5.1.0.GA/</jbossHome> <JAVA_1_6_HOME>/usr/lib/jvm/sun-jdk-1.6</JAVA_1_6_HOME> </properties> </profile> </profiles> </settings>
Sources Get the sources using git clone git://gerrit.ovirt.org/ovirt-engine In order to submit patches you need to setup your gerrit account. Please follow: http://www.ovirt.org/wiki/Working_with_oVirt_Gerrit
Building CD to the sources you got in previous step Setup jdbc driver setting by running: cd ear && mvn clean install -P setup_postgres -D skipTests ; cd - Create a DB instance running: backend/manager/dbscripts_postgres/create_db_devel.s h Build Backend and Frontend using: mvn clean install -P gwt-user,gwt-admin,dep -D skipTests
Run Forest, Run! Admire your work by running JBoss /usr/local/jboss-5.1.0.GA/bin/run.sh -b 0.0.0.0 We have a default internal user setup. So logging in is done with user admin@internal and password is letmein! Open Firefox, and browse to http://localhost:8080/webadmin RESTful API may be tested by browsing http://localhost:8080/api
Run Forest, Run! Advanced Need to create a bridge called “engine”. Installing VDSM (use RPM)- not now. Use API to add a host: curl -v -u 'admin@internal:letmein!' -H "Content-type: application/xml" -d '<host> <name>sample-host</name> <address>{host's IP}</address> <cluster name="Default"/> <root_password>letmein!</root_password> </host>' http://localhost:8080/api/hosts
Resources Devel setup wiki http://www.ovirt.org/wiki/Building_Ovirt_Engine Gerrit wiki http://www.ovirt.org/wiki/Working_with_oVirt_Gerrit
THANK YOU ! http://www.ovirt.org