Developer Data Modeling Mistakes: From Postgres to NoSQL
Using Jenkins as Native Packages Factory - Jenkins User Conference Paris 2012
1. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf
Using Jenkins as Native Packages
Factory
Henri Gomez
Axway
http://www.axway.com
2. 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)
3. 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
4. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf
Linux Packaging
! RPM (Redhat Package Manager)
– RHEL/CentOS/ Fedora
– SLES/OpenSuse
– Mandriva
! DEB
– Debian
– Ubuntu
5. 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
6. 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
7. 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
8. 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
9. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf
RPM building – SPEC FILE
! Sources
! Architecture
! Build Requirements
! Deploy Requirements
! Build
! Assembly
! Contents locations and rights
10. 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
11. 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.
13. 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
14. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf
Jenkins Factory in-depth
Repositories
reindexed by cron
if update detected
Parallel build on
Build binaries
slaves (Matrix)
uploaded via SCP
New packages
immediatly available
remotely via HTTP
19. 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