Continuous Delivery of Debian packages. Michael Prokop



Similar documents
Continuous Integration and Delivery at NSIDC

Practicing Continuous Delivery using Hudson. Winston Prakash Oracle Corporation

DevOps. Building a Continuous Delivery Pipeline

DRUPAL CONTINUOUS INTEGRATION. Part I - Introduction

Version Control Your Jenkins Jobs with Jenkins Job Builder

SOFTWARE DEVELOPMENT BASICS SED

Building a Continuous Integration Pipeline with Docker

SUCCESFUL TESTING THE CONTINUOUS DELIVERY PROCESS

@jenkinsconf. Maintaining huge Jenkins clusters - Have we reached the limit of Jenkins?

Jenkins: The Definitive Guide

How Bigtop Leveraged Docker for Build Automation and One-Click Hadoop Provisioning

Jenkins Continuous Build System. Jesse Bowes CSCI-5828 Spring 2012

Building, testing and deploying mobile apps with Jenkins & friends

CPSC 491. Today: Source code control. Source Code (Version) Control. Exercise: g., no git, subversion, cvs, etc.)

Content. Development Tools 2(63)

Mobile Development with Git, Gerrit & Jenkins

Continuous integration with Jenkins CI

Agile Software Factory: Bringing the reliability of a manufacturing line to software development

Software Configuration Management and Continuous Integration

NXTware Remote. Advanced Development and Maintenance Environment for OpenVMS and other Strategic Platforms

SUCCESFUL TESTING THE CONTINUOUS DELIVERY PROCESS

Continuous Integration: Put it at the heart of your development

StriderCD Book. Release 1.4. Niall O Higgins

November 12 th 13 th London: Mastering Continuous Integration with Jenkins

Automation & Open Source. How to tame the Cloud?

How To Manage Change In Jeepers

ACCELERATE DEVOPS USING OPENSHIFT PAAS

OpenStack CI: flow, tools and more

A central continuous integration platform

Automated build service to facilitate Continuous Delivery

Continuous Integration in the Cloud with Hudson

DevOps Stack. Reid Holmes. Chris Parnin:

Mastering Continuous Integration with Jenkins

My DevOps Journey by Billy Foss, Engineering Services Architect, CA Technologies

Continuous Delivery on AWS. Version 1.0 DO NOT DISTRIBUTE

Continuous Integration

Hudson configuration manual

Continuous Integration

Jenkins and Chef Infrastructure CI and Application Deployment

Pipeline Orchestration for Test Automation using Extended Buildbot Architecture

Zero-Touch Drupal Deployment

Jenkins World Tour 2015 Santa Clara, CA, September 2-3

Git Branching for Continuous Delivery

Big Data Operations Guide for Cloudera Manager v5.x Hadoop

Continuous Integration and Delivery. manage development build deploy / release

DevShop. Drupal Infrastructure in a Box. Jon Pugh CEO, Founder ThinkDrop Consulting Brooklyn NY

CHEF IN THE CLOUD AND ON THE GROUND

Developer Workshop Marc Dumontier McMaster/OSCAR-EMR

Extending Remote Desktop for Large Installations. Distributed Package Installs

Source Code Management for Continuous Integration and Deployment. Version 1.0 DO NOT DISTRIBUTE

Developer support in a federated Platform-as-a-Service environment

Implementing Continuous Integration Testing Prepared by:

Continuous Integration

CloudBees Jenkins Platform Features

Platform as a Service and Container Clouds

Best Overall Use of Technology. Jaspersoft

GitLab as an Alternative Development Platform for Github.com

Dry Dock Documentation

depl Documentation Release depl contributors

Continuous Integration using Docker & Jenkins

DevOps Course Content

Build Automation for Mobile. or How to Deliver Quality Apps Continuously. Angelo Rüggeberg

Implementation Guide:

<Insert Picture Here> Introducing Hudson. Winston Prakash. Click to edit Master subtitle style

Intro to Docker and Containers

Continuous Integration: A case study

Using Git for Project Management with µvision

ovirt self-hosted engine seamless deployment

Creating a dynamic software deployment solution using free/libre software

Web Developer Toolkit for IBM Digital Experience

Modern Web development and operations practices. Grig Gheorghiu VP Tech Operations Nasty Gal

Continuous Delivery Workshop

Secure Linux Administration Conference Bernd Strößenreuther

A Pythonic Approach to Continuous Delivery

Continuous Integration and Automatic Testing for the FLUKA release using Jenkins (and Docker)

PTC System Monitor Solution Training

Jenkins User Conference Herzelia, July #jenkinsconf. Testing a Large Support Matrix Using Jenkins. Amir Kibbar HP

Whitepaper. Continuous Integration Tools Applying Best Practices to the Toolchain

2012 Nolio Ltd. All rights reserved

Beginner s guide to continuous integration. Gilles QUERRET Riverside Software

Git Fusion Guide August 2015 Update

Delivering Quality Software with Continuous Integration

Software Development In the Cloud Cloud management and ALM

How To Write A Continuous Delivery

SMZ. SocialMedia. Z olutions

Automated performance testing using Maven & JMeter. George Barnett, Atlassian Software

Delivery. Continuous. Jez Humble and David Farley. AAddison-Wesley. Upper Saddle River, NJ Boston Indianapolis San Francisco

Deploy Your First CF App on Azure with Template and Service Broker. Thomas Shao, Rita Zhang, Bin Xia Microsoft Azure Team

DevKey Documentation. Release 0.1. Colm O Connor

Transcription:

Continuous Delivery of Debian packages Michael Prokop

Terminology Continuous Integration well known from software development Continuous Deployment Q/A criteria says OK? Ship/deploy! Continuous Delivery release whenever you decide it's useful to do so (= business decision!)

Why?

Costs of a Bugfix 160 140 120 100 80 60 40 20 0 Requirements Design Code Devevelopment Accounting Operations Source: Barry Boehm's EQUITY Keynote Address

Independence Source: http://decarabia.soup.io/post/241926962/image

Scaling Source: https://www.flickr.com/photos/scobleizer/4870003098/

Reproducible Source: https://wiki.debian.org/reproduciblebuilds

Predictable Source: https://xkcd.com/612/

Problems

Problems $company experienced 1/2 Mess with golden images (to ship a custom software stack to customers) Long build times (e.g. single change rebuild full image, upload to customer,...) Builds non-reproducible (unmanaged build infrastructure, devs can build + include their own packages,...)

Problems $company experienced 2/2 Release process holding back ongoing development work (VCS freezes are preventing ongoing work) Getting more and more customers not scaling (golden images even worse) Tried Debian source package uploads to custom build service many pitfalls + developers still needed to manually build/release packages (some of them not even using Debian/Ubuntu tools like gitdch, debuild,... unavailable)

What do we want?

Deployment Pipeline Source: http://continuousdelivery.com/2010/02/continuous-delivery/

Workflow Development/ Testing Debian builds (+PPA) Debian package, Puppet,... git commit && git review Jenkins verify (-1/+1) Internal tooling Submit to {master,$branch} Code Reviewers (-2/-1/0/+1+2) $Product Available to Customers $Release (incl. Q/A) Final Debian build Release dashboard

How did we get there?

Principles Rely on Debian packages + Debian repositories for everything (no exceptions) Only what's under version control matters (no option to build something manually on your own system) Automate infrastructure handling (Puppet/Ansible)

Automation Automated debian/changelog handling to simplify releasing of new package versions (devs don't need Debian/Ubuntu at all) Automated release branch handling (release 0.42 is available as such a branch) VMs for testing/development (via Vagrant run `vagrant up $product-$version`, automated box builds at least once per day) PPAs for development (no VCS freezes, fastforward + release branches only)

Improvements Usage of tmpfs/eatmydata, ccache,... for build speedups Dashboards for abstraction + let people focus on their tasks instead of tools Code review system (improves code quality but also sharing knowledge + introducing new people)

Jenkins- debian- glue

Standards The nice thing about standards is that there are so many of them to choose from. Source: https://xkcd.com/927/

Jenkins? Hudson: 2004 Jenkins: 2011 Weekly releases + LTS versions MIT license >1000 plugins available >120k registered installations (07/15) Disclaimer: written in Java, but absolutely not restricted to Java projects

Why jenkins-debian-glue? Formalize existing knowledge into a customizable framework Provide a common ground to base (further) work on Gather feedback from what other users (might) need Community building Don't create new tools and standards, instead rely on existing and working ones Should be easy to use also for non-debian folks

What's behind j-d-g? Open Source Project (MIT license) started in 2011 >25 contributors written mainly in shell, easy to adjust + extend CI server (Jenkins) Build environment (cowbuilder/pbuilder) VCS (git + svn OOTB) Repository management (reprepro + freight) Q/A tools: piuparts, lintian, autopkgtest, pep8, perlcritic, shellcheck, checkbashism

Who's using j-d-g? Grml (incl. dpkg, FAI, initramfs-tools,...) https://jenkins.grml.org/ PostgreSQL https://wiki.postgresl.org/wiki/apt LLVM http://llvm.org/apt/ Kamailio https://kamailio.sipwise.com Wikimedia https://integration.wikimedia.org/ci/view/ops- DebGlue/ and many more

Setup? Automatic deployment % wget https://raw.github.com/mika/\ jenkins-debian-glue/\ master/puppet/apply.sh % sudo bash./apply.sh $your_password http://jenkins-debian-glue.org/getting_started/

What do I get?

${project}-source generate Debian source package using VCS (Upstream) Source (orig.tar.xz) Debian changes (debian.tar.xz) [optional] Control file (.dsc) Script generate-{git,svn}-snapshot Automates changelog generation (git-dch ftw, thanks Guido!) Important: needs to be run only once per project (exception: multi distribution usage in one repository)

${project}-binaries Debian Binary Packages (*.deb) Script build-and-provide-package Automates pbuilder/cowbuilder setup, usually nothing to do manually Important: build once per architecture/distribution (exception: Architecture: all )

${project}-piuparts Install/deinstall/upgrade testing (optional) Useful since you might forget about it otherwise

Repository Handling Automatic handling of repositories without manual interaction reprepro freight By default part of ${project}- binaries job Separate usage via ${project}- repos job: BUILD_ONLY vs PROVIDE_ONLY

Further Q/A testing available OOTB Lintian Autopkgtest perlcritics/checkbashism/ shellcheck/pep8/... Results as TAP/jUnit/... reports in Jenkins available

Example of a Build Pipeline git [review push] foo-unit-test foo-source Automatic lintian integration in *-source + *-binaries Automatic autopkgtestintegration in *-binaries Optionally Code-Review + automatic merge to Master after Q/A Optionally further static code analysis, web tests, performance tests,... foo-piuparts foo-repos foo-binaries apt-get install $package

Managing many Jenkins jobs without driving nuts? usage of jenkins-job-builder to create and manage Jenkins jobs http://docs.openstack.org/infra/syste m-config/jjb.html https://github.com/sipwise/kamailiodeb-jenkins (example) YAML file(s) for configuration No webinterface clicking! Version control! Code review for job changes!

Lessons learned

Lessons learned 1/3 Developers needs vs operations/ distribution needs ($package or $version not available) Contribute back to Debian when reasonable Diverse people improve overall quality Homogeneous systems, diverse people Code review requires good remote working culture Open Source folks are used to remote working :)

Lessons learned 2/3 Avoid external dependencies Github, CPAN, PyPI, RubyGems, Puppetlabs, Percona, $local_debian_mirror... unreachable? set up local mirrors Speedup! Staging options Configuration management (e.g. for setup of Jenkins slaves) is essential infrastructure as code Consistent timezones (UTC) + time (NTP!)

Lessons learned 3/3 Catch 22 build scripts broken but build infrastructure receives updates via build infrastructure/scripts? recursion problem upgrading from wheezy to jessie, deployment of configuration management depends on unittests which don't work on jessie yet Provide test infrastructure for setup, configuration,... changes without breaking production Rebuild of a system might look different from currently running one, even with cfgmgmt use testing also for cfgmgmt (serverspec, mspectator, Tests::Server, Test Kitchen,...)

Tips 1/2 Regular rebuilds of all packages apply recent policies + package build infrastructure changes so packages are up2date mr/myrepos is very useful for dealing with large amounts of repositories (thanks joeyh!) Integrate CI/CD system into your monitoring environment

Tips 2/2 Collect metrics independent from Jenkins & CO to be able to remove jobs/builds without losing metrics Use gertty cmdline tool if you don't like gerrit web interface Set up jenkins-verify job to ensure Jenkins works as needed

Antipatterns 1/3 Manual SSH provide debugging options instead Flaky Tests (fast vs slow hardware, sleep X,...) people don't trust + care any longer Polling/pull/cronjobs instead of triggering get immediate actions + effects

Antipatterns 2/3 Manual setup of machines/configs snowflake pattern (AKA they look alike but are still different) No standarized output in tools makes parsing hard[er] Checklists use automation instead

Antipatterns 3/3 Hardcoding (IP addresses, hostnames, port number, test system,...) instead of configurability Same thing gets built multiple times in the deployment pipeline share artifact instead Lack of notifications for failing builds/tests/... developer starts to wait + poll

Unresolved problems 1/2 dependency management alla wanna-build to get package builds automatically in the right order (package foo Build-Depends on package bar build bar before foo) Build-Depends vs Depends, but no Test-Depends (bundler, carton,...)

Unresolved problems 2/2 High frequency (CI/CD) Debian repositorities causing apt to often fail while mirror is updated ( Hashsum mismatch ) piuparts: successful runs even though there have been issues, e.g. package that gets tested has dependency issues though removing the package itself is considered a valid solution

Recap projects possibly worth a look Debian :) Jenkins Jenkins-debian-glue Vagrant Gerrit + Gertty Jenkins-Job-Builder

Recap tl;df Put everything under version control Automation (deployment, cfgmgmt, release process) Custom Dashboards Tests, tests, tests Rely on established workflows + tools PS: Once you're used to that working in non-cd environments feels bad

Jenkins-debian-glue BoF Date: 2015-08-21 Time: 18:00-19:00 Room: Helsinki Purpose: In this BoF session we provide an opportunity to meet developers + contributors of the jenkins-debian-glue project, discuss issues for improvements, upcoming new features and get your questions answered.

Questions Wishes? @mikagrml mika (at) debian.org http://michael-prokop.at/blog/ http://jenkins-debian-glue.org/ Thanks for feedback to Christian Hofstaedtler + Victor Seva