Difference between revisions of "Jenkins server setup"

From Inkscape Wiki
Jump to navigation Jump to search
(outdated)
 
(26 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{outdated}}


== Installed software ==
== Installed software ==
Line 6: Line 7:


=====Inkscape build dependencies=====
=====Inkscape build dependencies=====
     apt-get install bazaar
     apt-get install bzr
     apt-get build-dep inkscape
     apt-get build-dep inkscape
     apt-get install autopoint
     apt-get install autopoint


=====Jenkins=====
=====Several packages for our Jenkins jobs=====
For scan-build static analysis:
    apt-get install clang-x.x  (choose whatever version is most recent)
You may need to create symlinks if "clang" and "scan-build" do not work on the cmdline:
    sudo ln -s /usr/bin/clang-x.x /usr/bin/clang
    sudo ln -s /usr/bin/clang++-x.x /usr/bin/clang++
    sudo ln -s /usr/bin/scan-build-x.x /usr/bin/scan-build
 
 
For unit tests of the python extensions:
    apt-get install python-lxml python-numpy
 
For render testing we need a modified version of perceptualdiff that can handle transparency!!!
So we have to build our own version of perceptualdiff...
    sudo apt-get install libfreeimage3 libopenjpeg2 libraw9
    sudo apt-get install libfreeimage-dev
    cd ~
    bzr checkout --lightweight lp:inkscape-rendertest inkscape-rendertest
    cd inkscape-rendertest/perceptualdiff-1.1.1-alphamod
    cmake .
    make
    sudo cp perceptualdiff /usr/bin
For building 2Geom:
    apt-get install cmake
For 2Geom documentation:
    apt-get install doxygen graphviz texlive-latex-base ghostscript
 
=====Install Jenkins=====
Follow the instructions on [https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu Jenkins wiki]:
Follow the instructions on [https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu Jenkins wiki]:
     wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
     wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
Line 17: Line 45:
     sudo apt-get install jenkins
     sudo apt-get install jenkins


    sudo /etc/init.d/jenkins start
Jenkins is now accessible through port 8080.
==Setup Jenkins==
We should be able to store Jenkins' config in an SCM, but didn't spend the time to figure that out.
*  Manage Jenkins -> Global security
** Enable security
** Access control -> Jenkins' own user database, allow users to sign up. Anyone can do anything. Save.
* Sign yourself up.
* Back to Global security
** Access control -> Authorization -> matrix-based security.
*** Add your username to the matrix and give yourself full auth.
*** The anonymous user needs "Read" rights on:
**** Overall . Read
**** Job . Read
**** View . Read
** Access control -> disallow users to sign up (no reason for it, and may confuse people)
** Save.
=====Installed Jenkins plugins=====
Manage Jenkins -> Plugin Manager.
* Bazaar plugin
* Shared workspace plugin
* Clang Scan-build Plugin
* Coverity plugin
* Doxygen plug-in
* HTML Publisher Plugin
* xUnit Plugin
* thinBackup
* Role Strategy Plugin
=====Role-based security setup=====
* Manage Jenkins -> Configure Global Security -> Set security management to Role-based strategy.
* Manage Jenkins -> Manage and Assign roles
** Manage roles: set up the roles!
** Assign roles : assign roles to the users (also assign Anonymous to a (of course restricted) role)
=====Config Jenkins some more=====
* Manage Jenkins -> Configure System
* Doxygen installations
** name: doxygen
** path: /usr/bin/doxygen  (ignore the warning, you need the executable in there)
=====Before setting up Inkscape and 2Geom jobs=====
We first need to set up shared workspaces, so we can spread the tasks over several jobs.
* Manage Jenkins -> Configure system -> Workspace sharing
* Add Inkscape shared workspace
** name:  inkscape_trunk
** repo:  lp:inkscape
* Add 2Geom shared workspace
** name:  lib2geom_trunk
** repo:  lp:lib2geom
=====Jobs=====
Now you can set up jobs. We will have to save the jobs settings somewhere... Hard work to type it all out here.
=====Enable access on port 80, instead of 8080=====
See here: https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+on+Port+80+or+443+using+iptables
We will use "iptables" to route traffix on port 80 to Jenkins.
    sudo iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
    sudo iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
    sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
Then store the settings (otherwise the settings will be void when the iptables service restarts) by installing iptables-persistent.
    sudo apt-get install iptables-persistent


==== TO DO ====
==== TO DO ====
* figure out how to reroute traffic such that jenkins.inkscape.org works instead of only jenkins.inkscape.org:8080
* figure out how to report the unit test results for inkscape
* get email working: should send mails to maillist when something breaks

Latest revision as of 19:06, 21 February 2018

This page is outdated. It is kept for historical reasons, e.g. to document specific decisions in Inkscape development.


Installed software

The software that was installed on our Ubuntu testing server (jenkins.inkscape.org).

   apt-get install emacs24-nox
Inkscape build dependencies
   apt-get install bzr
   apt-get build-dep inkscape
   apt-get install autopoint
Several packages for our Jenkins jobs

For scan-build static analysis:

   apt-get install clang-x.x  (choose whatever version is most recent)

You may need to create symlinks if "clang" and "scan-build" do not work on the cmdline:

   sudo ln -s /usr/bin/clang-x.x /usr/bin/clang
   sudo ln -s /usr/bin/clang++-x.x /usr/bin/clang++
   sudo ln -s /usr/bin/scan-build-x.x /usr/bin/scan-build


For unit tests of the python extensions:

   apt-get install python-lxml python-numpy

For render testing we need a modified version of perceptualdiff that can handle transparency!!! So we have to build our own version of perceptualdiff...

   sudo apt-get install libfreeimage3 libopenjpeg2 libraw9
   sudo apt-get install libfreeimage-dev
   cd ~
   bzr checkout --lightweight lp:inkscape-rendertest inkscape-rendertest
   cd inkscape-rendertest/perceptualdiff-1.1.1-alphamod
   cmake .
   make
   sudo cp perceptualdiff /usr/bin

For building 2Geom:

   apt-get install cmake

For 2Geom documentation:

   apt-get install doxygen graphviz texlive-latex-base ghostscript
Install Jenkins

Follow the instructions on Jenkins wiki:

   wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
   sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
   sudo apt-get update
   sudo apt-get install jenkins
   sudo /etc/init.d/jenkins start

Jenkins is now accessible through port 8080.

Setup Jenkins

We should be able to store Jenkins' config in an SCM, but didn't spend the time to figure that out.

  • Manage Jenkins -> Global security
    • Enable security
    • Access control -> Jenkins' own user database, allow users to sign up. Anyone can do anything. Save.
  • Sign yourself up.
  • Back to Global security
    • Access control -> Authorization -> matrix-based security.
      • Add your username to the matrix and give yourself full auth.
      • The anonymous user needs "Read" rights on:
        • Overall . Read
        • Job . Read
        • View . Read
    • Access control -> disallow users to sign up (no reason for it, and may confuse people)
    • Save.
Installed Jenkins plugins

Manage Jenkins -> Plugin Manager.

  • Bazaar plugin
  • Shared workspace plugin
  • Clang Scan-build Plugin
  • Coverity plugin
  • Doxygen plug-in
  • HTML Publisher Plugin
  • xUnit Plugin
  • thinBackup
  • Role Strategy Plugin
Role-based security setup
  • Manage Jenkins -> Configure Global Security -> Set security management to Role-based strategy.
  • Manage Jenkins -> Manage and Assign roles
    • Manage roles: set up the roles!
    • Assign roles : assign roles to the users (also assign Anonymous to a (of course restricted) role)
Config Jenkins some more
  • Manage Jenkins -> Configure System
  • Doxygen installations
    • name: doxygen
    • path: /usr/bin/doxygen (ignore the warning, you need the executable in there)
Before setting up Inkscape and 2Geom jobs

We first need to set up shared workspaces, so we can spread the tasks over several jobs.

  • Manage Jenkins -> Configure system -> Workspace sharing
  • Add Inkscape shared workspace
    • name: inkscape_trunk
    • repo: lp:inkscape
  • Add 2Geom shared workspace
    • name: lib2geom_trunk
    • repo: lp:lib2geom
Jobs

Now you can set up jobs. We will have to save the jobs settings somewhere... Hard work to type it all out here.

Enable access on port 80, instead of 8080

See here: https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+on+Port+80+or+443+using+iptables

We will use "iptables" to route traffix on port 80 to Jenkins.

   sudo iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
   sudo iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
   sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

Then store the settings (otherwise the settings will be void when the iptables service restarts) by installing iptables-persistent.

   sudo apt-get install iptables-persistent

TO DO

  • figure out how to report the unit test results for inkscape
  • get email working: should send mails to maillist when something breaks