Jump to: navigation, search

Difference between revisions of "Common Build Infrastructure/Virtual Server Setup/Fedora"

(Remote Access)
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{stub}}
+
This page documents how http://buildbox/ was set up for use in EclipseCon 2009's [http://www.eclipsecon.org/2009/sessions?id=302 Hands-On: Using the new Common Builder for Push-Button PDE Builds] tutorial.
 
+
 
+
  
 
==Create virtual server image==
 
==Create virtual server image==
  
 
* create 30G extensible virtual disk for use with Virtual Box
 
* create 30G extensible virtual disk for use with Virtual Box
* allocate 256M vram
+
* VirtualBox recommends no more than 256M vram, but you need more or you get ''java.io.IOException: error=12, Cannot allocate memory'' when running tests
* install Fedora from network install image (130M mounted .iso)
+
:* Hudson-based GEF 3.5 build ran OK with 640M (111 tests, including UI tests)
 +
* install Fedora from iso, eg., 130M network install image [ftp://less.cogeco.net/fedora/linux/releases/10/Fedora/i386/iso/Fedora-10-i386-netinst.iso]) ([http://mirrors.fedoraproject.org/publiclist/Fedora/10/ other mirrors])
 +
::[[Image:Installing-fedora10-in-virtualbox.png|Network install|220px]]
 
* unmount .iso image; mount Virtual Box additions image instead
 
* unmount .iso image; mount Virtual Box additions image instead
 
* restart when prompted
 
* restart when prompted
Line 37: Line 37:
 
== Configure Hudson to start automatically ==
 
== Configure Hudson to start automatically ==
  
* as root, run the following to fetch the [https://hudson.dev.java.net/servlets/ProjectDocumentList latest Hudson]
+
* as root, run the following to fetch the [http://hudson.gotdns.com/latest/hudson.war latest hudson.war]
  mkdir -p /opt/hudson; cd /opt/hudson; wget https://hudson.dev.java.net/files/documents/2402/128546/hudson.jar
+
  mkdir -p /opt/hudson; cd /opt/hudson; wget http://hudson.gotdns.com/latest/hudson.war
 +
 
  
 
* create the file <tt>/etc/init.d/hudson</tt> -- do NOT forget the "&" or your system will hang on restart!
 
* create the file <tt>/etc/init.d/hudson</tt> -- do NOT forget the "&" or your system will hang on restart!
Line 44: Line 45:
 
  # chkconfig: 2345 20 80
 
  # chkconfig: 2345 20 80
 
  # description: runs Hudson
 
  # description: runs Hudson
  java -jar /opt/hudson/hudson.jar &
+
  java -jar /opt/hudson/hudson.war &
  
 
* as root, run
 
* as root, run
Line 67: Line 68:
 
* fetch gef.releng and basebuilder M5 via pcf file in org.eclipse.dash.common.releng/pcf
 
* fetch gef.releng and basebuilder M5 via pcf file in org.eclipse.dash.common.releng/pcf
  
* open gef.releng, configure build.properties to correct java and Eclipse platform settings. For example:
+
* open gef.releng, configure build.properties to correct java and Eclipse platform settings. For example
  
  dependencyURLS=http://download.eclipse.rorg/eclipse/downloads/.../eclipse-*-linux-gtk.tar.gz (or ppc, or x86_64, etc.)
+
  dependencyURLs=http://download.eclipse.org/eclipse/downloads/drops/S-3.5M5-200902021535/eclipse-SDK-3.5M5-linux-gtk.tar.gz (or -ppc, or -x86_64, etc.)
 
   
 
   
 
  JAVA_HOME=/usr/lib/jvm/java
 
  JAVA_HOME=/usr/lib/jvm/java
Line 80: Line 81:
 
  pkill -f N200903
 
  pkill -f N200903
  
== TODO ==
+
== Run a build in Hudson ==
 +
 
 +
* open http://localhost:8080, click New Job
 +
* select 'free-style software project'
 +
* configure a job that runs the following script
 +
 
 +
export BUILDTYPE="${BUILDTYPE}"
 +
export EXTRAFLAGS="-javaHome /usr/lib/jvm/java ${EXTRAFLAGS}"
 +
. /home/builduser/workspace/org.eclipse.dash.common.releng/hudson/gef-3.5.x-nightly.sh
 +
 
 +
* define two build parameters
 +
 
 +
BUILDTYPE (default value N, a nightly build)
 +
EXTRAFLAGS (default value blank, no extra flags
 +
 
 +
* save the configuration, then click Build Now to start a build
 +
 
 +
* see also a sample [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.dash.commonbuilder.releng/hudson/gef-3.5.x-nightly/buildbox/config.xml?root=Technology_Project&revision=1.1&content-type=text%2Fplain config.xml] which stores the UI configuration, and [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.dash.commonbuilder.releng/hudson/gef-3.5.x-nightly/build.eclipse.org/config.xml?root=Technology_Project&revision=1.1&content-type=text%2Fplain build.eclipse.org's gef-3.5.x-nightly config.xml]
 +
 
 +
== Remote Access==
 +
 
 +
* set up the VBox instance to use BOTH Host Interface (192.168.2.*) and NAT (10.0.2.*). For more on NAT, see [http://mydebian.blogdns.org/?p=148 this blog]
 +
 
 +
::[[Image:Buildbox-Host-Interface.png|Host Interface|220px]]
  
+ create a new job, and run gef build in Hudson
+
* access the vserver via SSH on :22, or the Hudson web service on :8080
  
+ access hudson on guest VBox from host server (via IP address, eg., http://10.0.2.15:8080)
+
* to save memory, edit /etc/inittab so that the server will start on [http://en.wikipedia.org/wiki/Runlevel#Typical_Linux_runlevels runlevel 3] (text login) instead of 5 (graphical login, with X started)
  
+ start in runlevel 3 instead of 5 (console only, no X - saves memory)
+
[[Category:Athena Common Build]]

Latest revision as of 02:14, 9 May 2009

This page documents how http://buildbox/ was set up for use in EclipseCon 2009's Hands-On: Using the new Common Builder for Push-Button PDE Builds tutorial.

Create virtual server image

  • create 30G extensible virtual disk for use with Virtual Box
  • VirtualBox recommends no more than 256M vram, but you need more or you get java.io.IOException: error=12, Cannot allocate memory when running tests
  • Hudson-based GEF 3.5 build ran OK with 640M (111 tests, including UI tests)
Network install
  • unmount .iso image; mount Virtual Box additions image instead
  • restart when prompted

Install software

  • right-click empty desktop and find
Applications > System Tools > Thunar File Manager
Applications > System Tools > LXTerminal (or Terminal)
Applications > Programming > Eclipse
  • fire up Thunar, mount VBOXADDITIONS drive
  • open a terminal, run as root
yum install -y yum-fastestmirror 
yum install -y kernel kernel-devel kernel-headers
cd /media/VBOXADDITIONS*; ./VBoxLinuxAdditions-x86.run
  • fire up Thunar, unmount VBOXADDITIONS drive
  • open a terminal, run as root
yum install -y ant-contrib
file /usr/share/java/ant-contrib.jar
  • open a terminal, run as root
yum install -y java-1.6.0-openjdk-devel cvs svn perl curl wget Xvfb vnc vnc-server 
  • restart (can run the following as root)
shutdown -r now

Configure Hudson to start automatically

mkdir -p /opt/hudson; cd /opt/hudson; wget http://hudson.gotdns.com/latest/hudson.war


  • create the file /etc/init.d/hudson -- do NOT forget the "&" or your system will hang on restart!
#/bin/bash
# chkconfig: 2345 20 80
# description: runs Hudson
java -jar /opt/hudson/hudson.war &
  • as root, run
chkconfig --add hudson; chkconfig --level 2345 hudson on
chmod 755 /etc/init.d/hudson
/etc/init.d/hudson &
  • once started, open firefox or from console
links http://localhost:8080/
  • restart (can run the following as root)
shutdown -r now
  • if anything goes wrong, hit F2 on reboot to enter grub menu, and add "single" to the grub commands to start in the single-user, networkless runlevel mode [2].
  • on restart, verify Hudson is started by opening the above URL

Run a build in Eclipse

  • fire up Fedora Eclipse, fetch o.e.d.c.releng project from :pserver:anonymous@dev.eclipe.org:/cvsroot/technology/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.dash.common.releng
  • fetch gef.releng and basebuilder M5 via pcf file in org.eclipse.dash.common.releng/pcf
  • open gef.releng, configure build.properties to correct java and Eclipse platform settings. For example
dependencyURLs=http://download.eclipse.org/eclipse/downloads/drops/S-3.5M5-200902021535/eclipse-SDK-3.5M5-linux-gtk.tar.gz (or -ppc, or -x86_64, etc.)

JAVA_HOME=/usr/lib/jvm/java
JAVA14_HOME=/usr/lib/jvm/java
JAVADOC14_HOME=/usr/lib/jvm/java/bin
  • select build.xml, right-click and Run as > Ant Build
  • to kill a bad build in progress, open a terminal and run
pkill -f N200903

Run a build in Hudson

  • open http://localhost:8080, click New Job
  • select 'free-style software project'
  • configure a job that runs the following script
export BUILDTYPE="${BUILDTYPE}"
export EXTRAFLAGS="-javaHome /usr/lib/jvm/java ${EXTRAFLAGS}"
. /home/builduser/workspace/org.eclipse.dash.common.releng/hudson/gef-3.5.x-nightly.sh
  • define two build parameters
BUILDTYPE (default value N, a nightly build)
EXTRAFLAGS (default value blank, no extra flags
  • save the configuration, then click Build Now to start a build

Remote Access

  • set up the VBox instance to use BOTH Host Interface (192.168.2.*) and NAT (10.0.2.*). For more on NAT, see this blog
Host Interface
  • access the vserver via SSH on :22, or the Hudson web service on :8080
  • to save memory, edit /etc/inittab so that the server will start on runlevel 3 (text login) instead of 5 (graphical login, with X started)