using jenkins as native packages factory - jenkins user conference paris 2012

Post on 10-May-2015

3.418 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Jenkins User Conference tal

TRANSCRIPT

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Using Jenkins as Native Packages Factory

Henri Gomez Axway

http://www.axway.com

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

About me

!  CI Architect @ Axway ! Was Senior Ops Director ! Was Developer, TL and Architect ! JPackage Project Founder ! OpenJDK 7 & 8 packages for OSX !  ASF Member (Tomcat & XMLRPC)

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Native Packages

!  Heart of OS applications stack !  Dependency handling !  Automatic or selective updates !  Widely used by Ops !  Well suited for Cloud based Operations

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Linux Packaging

!  RPM (Redhat Package Manager) –  RHEL/CentOS/ Fedora –  SLES/OpenSuse –  Mandriva

!  DEB –  Debian –  Ubuntu

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Package Definition

!  A file(.rpm, .deb) !  An archive (Datas & Programs) !  Executed code at install, update or

remove time. !  Architecture related.

–  Intel, ARM, PowerPC –  32 or 64bits

!  Or architecture neutral –  Java application –  Ruby library

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Package Benefits

! Describing requirement ! Provide programs, datas and settings ! Registering in system service(ie: logrotate) ! Enforcing dedicated run account !   Total control over runtime cycle-life

–  Installation –  Update –  Uninstallation

A package is much more than an archive

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Maven common facts

!  DSL build based !  Dependency Management

–  At build time –  At deploy time

!  Packages repositories –  In local mode –  Remotely via HTTP

!  Nexus and Artifactory could act as RPM repositories

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

From application to RPM

!  2 approachs

–  OS Vendor way: •  Rebuilt from sources tarballs •  Require tarballs in build path

–  Enterprise way: •  Rebuilt from Binaries (stored in Artifacts Repository) •  Avoid duplicate processing •  Trusting your delivery process

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

RPM building – SPEC FILE

!   Sources !  Architecture ! Build Requirements ! Deploy Requirements ! Build ! Assembly !  Contents locations and rights

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Jenkins as a Packages Factory

!   Jenkins Master –  Get contents from SCM (Subversion, Git) –  Prepare build environment –  Trigger build on slaves

!   Jenkins Slaves –  One slave by target (OS/Arch) platform –  Confident in OS compatibility –  Deployment on RPM repositories

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Axway Packages Factory

!  Builder –  5 target OS

•  CentOS 5 / 6 in 32 and 64 bits •  OpenSuse 12.1 in 32 and 64 bits •  Suse SLES 11 in 64 bits

!  Distributor –  Apache HTTPd server –  Packages Repositories hosting and servicing

•  4 repos for CentOS 5/6 in 32/64 bits •  1 repo for OpenSuse 12.1 32/64 and SLES 11.

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Axway Packages Factory Builder

i5 3.0Ghz, 16GB RAM, 500Gb HD Host OS OpenSuse 12.1

VirtualHost 4.1.8 7 Hosted VMs

CentOS 5 32 bits CentOS 5 64 bits CentOS 6 32 bits CentOS 6 64 bits OpenSuse 12.1 32 bits OpenSuse 12.1 64 bits Suse SLES 11 64 bits

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Jenkins Factory in-depth

!   Builder –  take control on slaves via SSH –  Trigger build jobs after SCM change –  Trigger jobs on 5/6 VMs via Matrix Plugin

!   Slaves –  Build package on OS / Arch –  Send build packages to distributor via SCP

!   Distributor –  Reindex repositories via cron if something change

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Jenkins Factory in-depth

Parallel build on slaves (Matrix) Build binaries

uploaded via SCP

Repositories reindexed by cron if update detected

New packages immediatly available

remotely via HTTP

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Initial method – 1 Job / OS-Arch

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Initial method – 1 Job / OS-Arch

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Final method – 1 Job with Matrix

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Final method – 1 Job with Matrix

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Packages Tricks

! CentOS/RHEL use one repo by arch –  One repository for x86 32bits with native/noarch –  One repository for x86 64bits with native/noarch

è One slave by architecture for native è Use one slave builder by arch even for noarch packages

! OpenSuse/SLES use a common repository

–  One dir for x86 32bits –  One dir for x86 64bits –  One dir for noarch

è One slave by architecture for native è You could use 32 or 64 bits builder for noarch packages

Jenkins User Conference Paris, 17 April 2012 #jenkinsconf

Thank You To Our Sponsor

top related