Java 2 Ada - Tag Jenkins2014-07-26T17:14:18+00:00Stephane Carrezurn:md5:d12e23c53b2436d6becce3d51ddbdf38AWAUbuntu 14.04 LTS Ada build node installationurn:md5:3fea7f232b6e2697865d42befa06effc2014-07-26T17:14:18+00:002014-07-26T17:14:18+00:00Stephane CarrezAdaJenkinsUbuntu
<div class="post-text"><p>This short article is a reminder to know the steps and actions in order to add a <a href="http://releases.ubuntu.com/14.04/">Ubuntu 14.04</a> build machine for <a href="http://jenkins-ci.org/">Jenkins</a>.</p><p>The steps are very similar to what I've described in <a href="http://blog.vacs.fr/vacs/blogs/post.html?post=2013/12/31/Installation-of-FreeBSD-for-a-jenkins-build-node">Installation of FreeBSD for a jenkins build node</a>. The virtual machine setup is the same (20G LVM partition, x86_64 CPU, 1Gb memory) and Ubuntu is installed from the <a href="http://releases.ubuntu.com/14.04/ubuntu-14.04.1-server-i386.iso">ubuntu-14.04.1-server-i386.iso</a> image.</p><h3>Packages to build Ada software</h3><p>The following commands install the GNAT Ada compiler with the libraries and packages to build various Ada libraries and projects including <a href="https://code.google.com/p/ada-awa/">AWA</a>.</p><pre><code># GNAT Compiler Installation
sudo apt-get install gnat-4.6 libaws2.10.2-dev libxmlada4.1-dev gprbuild gdb
# Packages to build Ada Utility Library
sudo apt-get install libcurl4-openssl-dev libssl-dev
# Packages to build Ada Database Objects
sudo apt-get install sqlite libsqlite3-dev
sudo apt-get install libmysqlclient-dev
sudo apt-get install mysql-server mysql-client
# Packages to build libaws2-2-10
sudo apt-get install libasis2010-dev libtemplates-parser11.6-dev
sudo apt-get install texinfo texlive-latex-base \
texlive-generic-recommended texlive-fonts-recommended
</code></pre><p>The <a href="http://packages.ubuntu.com/fr/trusty/libaws2.10.2">libaws2-2-10</a> package was not functional for me (see <a href="https://bugs.launchpad.net/ubuntu/+source/libaws/+bug/1348902">bug 1348902</a>) so I had to rebuild the Debian package from the sources and install it.</p><h3>Packages to create Debian packages</h3><p>When the Ada build node is intended to create Debian packages, the following steps are necessary:</p><pre><code>sudo apt-get install dpkg-dev gnupg reprepro pbuilder debhelper quilt chrpath
sudo apt-get install autoconf automake autotools-dev
</code></pre><h3>Packages and setup for Jenkins</h3><p>Before adding the build node in <a href="http://jenkins-ci.org/">Jenkins</a>, the JRE must be installed and a <code>jenkins</code> user must exist:</p><pre><code>sudo apt-get install openjdk-7-jre subversion
sudo useradd -m -s /bin/bash jenkins
</code></pre><p><a href="http://jenkins-ci.org/">Jenkins</a> will use ssh to connect to the build node so it is good practice to setup a private/public key to allow the <a href="http://jenkins-ci.org/">Jenkins</a> master node to connect to the slave. On the master, copy the jenkins user's key:</p><pre><code>ssh-copy-id target-host
</code></pre><p>The Ada build node is then added through the Jenkins UI in <i>Manage Jenkins/Manage Nodes</i>.</p><h4>Jenkins jobs</h4><p>The jenkins master is now building 7 projects automatically for Ubuntu 14.04: <a href="http://jenkins.vacs.fr/view/Trusty/">Trusty Ada Jobs</a></p></div> Installation of FreeBSD for a jenkins build nodeurn:md5:39d824bf9f537085e92f4ca8eafcf2a82013-12-31T14:43:19+00:002013-12-31T14:43:19+00:00Stephane CarrezAdaFreeBSDKVMJenkins
<div class="post-text"><p>A few days ago, I did a fresh installation of my <a href="http://jenkins-ci.org/">Jenkins</a> build environment for my Ada projects (this was necessary after a disk crash on my <a href="http://www.ovh.com/fr/index.xml">OVH</a> server). I took this opportunity to setup a <a href="http://www.freebsd.org/">FreeBSD</a> build node. This article is probably incomplete but tends to collect a number of tips for the installation.</p><h2>Virtual machine setup</h2><p>The FreeBSD build node is running within a <a href="http://wiki.qemu.org/KVM">QEMU</a> virtual machine. The choice of the host turns out to be important since not all versions of QEMU are able to run a FreeBSD/NetBSD or OpenBSD system. There is a bug in QEMU PCI emulation that prevents the NetBSD network driver to recognize the emulated network cards (See <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=653473">qemu-kvm 1.0 breaks openbsd, netbsd, freebsd</a>). Ubuntu 12.04 and 12.10 provide a version of Qemu that has the problem. This is solved in Ubuntu 13.04, so this is the host linux distribution that I've installed.</p><p>For the virtual machine disk, I've setup some LVM partition on the host as follows:</p><pre><code>sudo lvcreate -Z n -L 20G -n freebsd vg01
</code></pre><p>this creates a disk volume of 20G and label it <code>freebsd</code>.</p><p>The next step is to download the <a href="http://www.freebsd.org/where.html">FreeBSD Installation CD</a> (I've installed the FreeBSD-10.0-RC2). To manage the virtual machines, one can use the <code>virsh</code> command but the <code>virt-manager</code> graphical front-end provides an easier setup.</p><pre><code>sudo virt-manager
</code></pre><p>The virtual machine is configured with:</p><ul><li> CPU: x86_64</li><li>Memory: 1048576</li><li>Disk type: raw, source: /dev/vg01/freebsd</li><li>Network card model: e1000</li><li>Boot on the CD image</li></ul><p>After the virtual machine starts, the FreeBSD installation proceeds (it was so simple that I took no screenshot at all).</p><h2>Post installation</h2><p>After the FreeBSD system is installed, it is almost ready to be used. Some additional packages are added by using the <code>pkg install</code> command (which is very close to the Debian <code>apt-get</code> command).</p><pre><code>pkg install jed
pkg install sudo bash tcpdump
</code></pre><p>By default the <code>/proc</code> is not setup and some application like the OpenJDK need to access it. Edit the file <code>/etc/fstab</code> and add the following lines:</p><pre><code>fdesc /dev/fd fdescfs rw 0 0
proc /proc procfs rw 0 0
</code></pre><p>and mount the new partitions with:</p><pre><code>mount -a
</code></pre><h2>GNAT installation</h2><p>The FreeBSD repository provides some packages for Ada development. They are easily installed as follows:</p><pre><code>pkg install gmake
pkg install gnat-aux-20130412_1 gprbuild-20120510
pkg install xmlada-4.4.0.0_1 zip-ada-45
pkg install aws-3.1.0.0
pkg install gdb-7.6.1_1
</code></pre><p>After the installation, change the path and setup the <code>ADA_PROJECT_PATH</code> variables to be able to use <code>gnatmake</code>:</p><pre><code>export PATH=/usr/local/gcc-aux/bin:$PATH
export ADA_PROJECT_PATH=/usr/local/lib/gnat
</code></pre><h2>Jenkins slave node installation</h2><p>Jenkins uses a Java application that runs on each build node. It is necessary to install some Java JRE. To use subversion on the build node, we must make sure to install some 1.6 version since the 1.8 and 1.7 version have incompatibilities with the Jenkins master. The following packages are necessary:</p><pre><code>pkg install openjdk6-jre-b28_7
pkg install subversion-1.6.23_2
</code></pre><p>Jenkins needs a user to connect to the build node. The user is created by the <a href="http://www.freebsd.org/cgi/man.cgi?query=adduser&amp;sektion=8">adduser</a> command. The Jenkins user does not need any privilege.</p><p>Jenkins master will use <code>SSH</code> to connect to the slave node. During the first connection, it installs the <code>slave.jar</code> file which manages the launch of remote builds on the slave. For the <code>SSH</code> connection, the password authentication is possible but I've setup a public key authentication that I've setup on the FreeBSD node by using <code>ssh-copy-id</code>.</p><p>At this stage, the FreeBSD build node is ready to be added on the Jenkins master node (through the Jenkins UI <i>Manage Jenkins</i>/<i>Manage Nodes</i>).</p><h2>MySQL Installation</h2><p>The MySQL installation is necessary for some of my projects. This is easily done as follows:</p><pre><code>pkg install mysql55-server-5.5.35 mysql55-client-5.5.35
</code></pre><p>Then add the following line to <code>/etc/rc.conf</code></p><pre><code>mysql_enable="YES"
</code></pre><p>and start the server manyally:</p><pre><code>/usr/local/etc/rc.d/mysql-server onestart
</code></pre><p>The database tables are setup during the first start.</p><h2>Other packages</h2><p>Some packages that are necessary for some projets:</p><pre><code>pkg install autoconf-2.69 curl-7.33.0_1
pkg install ImageMagick-nox11-6.8.0.7_3
</code></pre><h2>Jenkins jobs</h2><p>The jenkins master is now building 7 projects automatically for FreeBSD 10: <a href="http://jenkins.vacs.fr/view/FreeBSD/">FreeBSD Ada Jobs</a></p></div>