A Pythonic Approach to Continuous Delivery



Similar documents
GETTING STARTED WITH CONTINUOUS DELIVERY. Lana wcgp.co

CARMEN DEARDO DEVOPS TECHNOLOGY LEADER, NATIONWIDE INSURANCE

Continuous Integration and Delivery at NSIDC

You ll need to have: It d be great if you have:

Practicing Continuous Delivery using Hudson. Winston Prakash Oracle Corporation

DevOps Stack. Reid Holmes. Chris Parnin:

SUCCESFUL TESTING THE CONTINUOUS DELIVERY PROCESS

Continuous Integration and Delivery. manage development build deploy / release

DevKey Documentation. Release 0.1. Colm O Connor

White Paper. The Importance of Automating the End to End Pipeline for Continuous Delivery

How To Write A Continuous Delivery

Continuous Delivery Workshop

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

The Agile Movement An introduction to agile software development

Continuous Integration and Bamboo. Ryan Cutter CSCI Spring Semester

DevOps. Jesse Pai Robert Monical 8/14/2015

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

Fundamentals of Continuous Integration

Continuous Delivery for Alfresco Solutions. Satisfied customers and happy developers with!! Continuous Delivery!

Continuous integration with Jenkins CI

Mobile Development with Git, Gerrit & Jenkins

Continuous Integration

CoDe:U Git Flow - a Continuous Delivery Approach

Establish a Continuous Delivery Pipeline: IBM UrbanCode Deploy

From Traditional Functional Testing to Enabling Continuous Quality in Mobile App Development

SUCCESFUL TESTING THE CONTINUOUS DELIVERY PROCESS

Application Release Automation (ARA) Vs. Continuous Delivery

Enabling Continuous Delivery by Leveraging the Deployment Pipeline

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

Testing Lifecycle: Don t be a fool, use a proper tool.

depl Documentation Release depl contributors

Continuous Delivery. Anatomy of the Deployment Pipeline (Free Chapter) by Jez Humble and David Farley

DRUPAL CONTINUOUS INTEGRATION. Part I - Introduction

Software Continuous Integration & Delivery

Building a Continuous Integration Pipeline with Docker

Jenkins and Chef Infrastructure CI and Application Deployment

Continuous Delivery: implementation considerations. Léon Hagenaars-Keus Edwin van Dillen

IT Home 2015 DevOps 研 討 會

Why continuous delivery needs devops, and why devops needs infrastructure-as-code. Sriram 25-Oct-2012

WHITEPAPER. Our highest priority is to satisfy the customer through early and continuous delivery of valuable software. Principle #1, Agile Manifesto

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

Improving your Drupal Development workflow with Continuous Integration

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

Continuous Delivery and Test Automation in Agile SW projects with Robot Framework Antti Pohjonen

Continuous Delivery / Continuous Deployment How to automate your Deliveries. Bernhard Keprt

The Deployment Pipeline

Quality Assurance Plan

Escaping the Works-On-My-Machine badge Continuous Integration with PDE Build and Git

Security Automation in Agile SDLC Real World Cases

How To Write Unit Tests In A Continuous Integration

Drupal in the Cloud. Scaling with Drupal and Amazon Web Services. Northern Virginia Drupal Meetup

StriderCD Book. Release 1.4. Niall O Higgins

Continuous Integration with Jenkins. Coaching of Programming Teams (EDA270) J. Hembrink and P-G. Stenberg [dt08jh8

The Definitive Guide To Docker Containers

THE STATEFUL CONDITION: OR HOW I LEARNED TO STOP WORRYING AND EMBRACE THE CLOUD

Continuous Delivery of Software

Achieving Continuous Integration with Drupal

Achieving Rolling Updates & Continuous Deployment with Zero Downtime

Continuous Delivery Benefits, Best Practices and Practical Advice

TRANSFORMING TO NEXT-GEN APP DELIVERY FOR COMPETITIVE DIFFERENTIATION

Paul Barham Program Manager - Java. David Staheli (dastahel@microsoft.com) Software Development Manager - Java

A Sumo Logic White Paper. Harnessing Continuous Intelligence to Enable the Modern DevOps Team

Parasoft and Skytap Deliver 24/7 Access to Complete Test Environments

Azure Day Application Development

OpenStack CI: flow, tools and more

MasterClass 26 th March 2015 DevOps and Continuous Deployment

Releasing High Quality Applications More Quickly with vrealize Code Stream

Continuous Delivery for Force.com

Upping the game. Improving your software development process

Agility via Software Engineering Practices

The Role of Feedback in Continuous Integration, Continuous Delivery and Agile ALM

Continuous Integration: Improving Software Quality and Reducing Risk. Preetam Palwe Aftek Limited

Continuous Delivery: Bridging Quality Between Development and Customers

Know the Difference. Unified Functional Testing (UFT) and Lean Functional Testing (LeanFT) from HP

Shifting Enterprise Development into the Fast Lane

Massively! Continuous Integration! A case study for Jenkins at cloud-scale

Continuous Delivery by example.net

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

Agile Requirements And Testing For Continuous Software Delivery

Using DevOps Tools to Achieve Continuous Integration

How To Manage A Multi Site In Drupal

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

DevOps Course Content

Software Development. Overview.

Dry Dock Documentation

Zero-Touch Drupal Deployment

DevOps for the Mainframe

White Paper Server. SUSE Linux Enterprise Server 12 Modules

The Continuous Delivery Tool Chain: So Many Choices!

How To Achieve Continuous Delivery

Patterns to Introduce Continuous Integration to Organizations

Platform as a Service and Container Clouds

Continuous Delivery. Ariel Alonso, IPC

Unleash Competitive Advantage through Software Lifecycle Integration

Transcription:

https://github.com/sebastianneubauer sebastian.neubauer@blue-yonder.com A Pythonic Approach to Continuous Delivery Sebastian Neubauer Europython 2015

Overview What is Continuous Delivery? definitions, analogies... How does a delivery pipeline look like? deep dive into boring details I have working python code, how do I start now? we assemble exemplary building blocks to a working production line the pythonic way What could possibly go wrong? traps, tips & tricks, failures, unsolved problems, dangers What should the future bring? wishes and dreams of brighter days Summary

What is Continuous Delivery?

Overcoming the wall of confusion Developers Code Tests Release v0.1.2 Operations Packaging Deploy Releases Lifecycle Version Control Configuration Continuous Integration Features Security Monitoring

The DevOps thing... DevOps Tests Code Features Packaging Releases Version Control Deploy Lifecycle Monitoring Configuration Security Continuous Integration Continuous Delivery

Continuous Delivery Extending the development into production And extending operations into development Development includes the entire value stream Enables development cycles including customer feedback Development Value Stream Feedback Customer

Continuous Delivery Release early, release often! Continuous is far more often than you think Explosion of complexity due to increased demands on security, safety, failover, monitoring, tests Automation

Poka-yoke (ポカヨケ) A poka-yoke is any mechanism in a lean manufacturing process that helps an equipment operator avoid (yokeru) mistakes (poka). Its purpose is to eliminate product defects by preventing, correcting, or drawing attention to human errors as they occur. wikipedia.org

Automated Software Production Line The Delivery Pipeline

How does a delivery pipeline look like?

It s up to you! Each change (commit) is deployed to production unless it is proven to be not production ready Design the automated challenges well Try to get feedback (failure) as soon as possible Start with a walking skeleton

A Typical Pipeline

The Stages

v I have working python code, how do I start now?

A Proper Deployment Artifact This means put up everything for a proper deployable artifact: python package debian package fancy docker It should be uniquely versioned It should manage dependencies Hint: https://github.com/blue-yonder/pyscaffold >pip install pyscaffold >putup my_app -> Talk by I. Mărieș from Monday: Less known packaging features and tricks

Continuous Integration All automated tests are executed each time someone commits to master >python setup.py test Might be a good idea to split fast unit-tests, from slow integration tests Any CI system will do the job: buildbot, travis...

Continuous Integration Not creative enough for the challenges? unit tests: only code, no environment dependency integration tests/component tests: allowed to use some environment dependencies: filesystem, http, database static code analysis: pylint, pychecker test coverage doctests The result of CI is a fixed artifact with a unique version >python setup.py sdist If you use pyscaffold, a PEP440 compatible version is generated from the git commit and tag: 0.0.1.post0.dev15+g172635 >python setup.py sdist

Fill up the Artifact Repository Ah, yes you need one, let s use the: http://doc.devpi.net/ Devpi: secure, on-premise, open source, pypi compatible artifact repository (short: index) >devpi upload -> Talk by Stephan Erb today 12:30 B1 at, c i p v e d s This i ekel is r K r e g l o @H ly the l a e r s i h t ogo?? official l Release Management with Devpi

That was the fun part! Now comes pain, tears and configuration

Automated Deploy For automated acceptance test, we need a fully functional running instance, deployed in a testing stage / test environment It is crucial, that the deployment code we use here, is the same we use later in production The testing stage needs to be as close to the production environment as possible Hint: After your first guesstimate of the time needed for automation: Multiply by a factor of 3

Use Configuration Management You can use whatever you want for the deploy, even simple bash scripts, but... Config management tools will ease your automated deploy by orders of magnitude We use ansible, because it s: python, simple, lightweight, declarative,...

Example Ansible Playbook --- hosts: webservers tasks: - name: ensure my app is installed pip: name=my_app virtualenv=/my_app_home/venv extra_args='-i https://our_devpi/simple --pre -U' state=present - name: start the app shell: /my_app_home/venv/bin/my_app_started

Acceptance Tests Acceptance tests prove the correct behavior of your app Be aware: This behaviour earns your money It is your last chance: Bugs that pass here will end up in production! Tools you can use: plain unittest, behave, selenium,...

Last step to Production You might want to have some additional non-functional tests: performance security explorative You might want to have some manual approval (feature flags) If possible perform a canary release

Steering of the Pipeline It is not trivial to keep control over the various deploy stages: which version passed which tests, where are which versions deployed... There are some few tool specialized for CD: go.cd or IBM UrbanCode... We use Jenkins, because we have it already Job dependencies reflect the stages A manual approval for production is done by clicking Build :-)

What could possibly go wrong?

Traps, Tips & Tricks, Dangers Keep it simple stupid! Automate all the things, because: you are lazy the complete delivery pipeline is in git: you have predictable recovery you know what is happening machines do it just better you can concentrate on value delivery Maintain and refactor your deployment For automation you need everything-as-a-service: no tickets, no you just have to click on...

What should the future bring?

The not so perfect parts... Packaging and dependency management in python is not so perfect at the moment The two worlds should unite: OS package managers vs. pip A pythonic continuous delivery tool is still missing, jenkins is not sufficient: what configuration is deployed where access management awareness of the delivery pipeline Many tools are still optimized for a manual workflow Let s start hacking on it!

Summary CD rocks, because: agile: faster feedback iterations automated better than manual collaboration better than silos You can build your own CD pipeline, just start today! Example building blocks are: pyscaffold for python packages devpi as artifact repository jenkins for CI and steering python unittest for tests ansible for automated deploys courage

Thank you!

Images: slide 7: Cory Doctorow https://www.flickr.com/photos/doctorow/17599851339/in/photolist-speqck-8rl77m-5f8c9v-mxaht-7l8phe-kn2olw-kn24hw-4le5l97m77ag-8q6fow-5eb9a-ihd6jx-uckemj-48k71k-6iyuxc-bxrnpq-9hzube-44lsh-syfm9j-babqvp-ntvxsi-7n9p22-9hzwcx-9hzvom66eepg-scfanm-6sgsy3-82ayug-mxs1c-8aharj-4m2v48-ntw1k2-ntrhgu-q5mcm-nd3wvv-pccvj-oe51x-5v668q-bpvxznbryww-ntvzmi-ntvzv6-ntnrgy-c1z2fo-c1z26j-6iulbv-6gfqjx-aztfke-4rt58o-nxpg3/ CC BY-SA 2.0 Slide 9 Mixabest https://upload.wikimedia.org/wikipedia/commons/5/5e/kuka_industrial_robots_ir.jpg CC BY-SA 3.0