openSUSE Conference 2017 - The Docker at Travis Presentation

21
Ladislav Slezák YaST Developer [email protected] Docker at Travis There is no excuse for NOT using a CI

Transcript of openSUSE Conference 2017 - The Docker at Travis Presentation

Ladislav SlezákYaST [email protected]

Docker at TravisThere is no excuse for NOT using a CI

Why Travis?

Travis – Introduction

● CI as a service (hosted)● Free for open source projects● Integrated with GitHub

Travis

● Builds run in Ubuntu 12.04 (Precise) or 14.04 (Trusty) VM● 12.04 is discontinued, even 14.04 is pretty old● What if you need a newer compiler, libraries?● What if you need a completely different distro?● Local/remote debugging not possible

Why Docker?

Docker

● Works out of box at Travis● Container based, no virtualization● Lightweight (minimal overhead)● Many base OS images available● Easy to build and publish your own images

Example1: Snapper

Snapper

● A tool for managing file system snapshots● Portable, built for many distributions in OBS● Single Git source repository● Changed less frequently

Snapper – Travis Implementation

● Separate Dockerfile (defines the Docker image) and build script for each target distribution

● The Docker images are built at Travis– Easier to maintain

– Takes some more time

● The targets are built in parallel at Travis

Snapper – Travis

https://travis-ci.org/openSUSE/snapper

Example2: YaST

YaST

● Not portable, (open)SUSE specific● Does not work in other distributions● Modular design● 100+ Git source repositories● Bigger development team, frequent changes

YaST – Old Ubuntu Setup

● Build YaST packages for Ubuntu 12.04 in OBS– Not a full port! Just enough for running unit tests

(system access is simulated)

● Extra work, hard to maintain● Not reliable (false positives or uncaught issues)● Limited scope for tests (cannot build RPM easily)

YaST – New Docker Setup

● Pre-built Docker images at Docker Hub– Faster (only built once)

– Two images for Ruby or C++ packages

– The Travis script is included (shared)

Docker at Travis – Summary

● Less maintenace● More reliable builds

– Using the real target distribution

● Easier debugging– Use the same Docker image locally

● Independent on Travis default OS– Ubuntu 12.04 will be dropped soon (switch to 14.04)

Questions?

Links

● https://blog.ladslezak.cz/2017/03/28/docker_at_travis/● https://travis-ci.org/● https://docs.travis-ci.com/user/docker/● https://docs.docker.com/● https://github.com/openSUSE/snapper/blob/master/README.Travis.md● https://yastgithubio.readthedocs.io/en/latest/travis-integration/● https://github.com/yast/docker-yast-ruby● https://hub.docker.com/r/yastdevel/ruby/

Contacts

● ML: [email protected]● IRC: #yast at freenode.net

Thank You!

Join Us at www.opensuse.org

LicenseThis slide deck is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license. It can be shared and adapted for any purpose (even commercially) as long as Attribution is given and any derivative work is distributed under the same license.

Details can be found at https://creativecommons.org/licenses/by-sa/4.0/

General DisclaimerThis document is not to be construed as a promise by any participating organisation to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. openSUSE makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for openSUSE products remains at the sole discretion of openSUSE. Further, openSUSE reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All openSUSE marks referenced in this presentation are trademarks or registered trademarks of SUSE LLC, in the United States and other countries. All third-party trademarks are the property of their respective owners.

Credits

TemplateRichard Brown

[email protected]

Design & InspirationopenSUSE Design Team

http://opensuse.github.io/branding-guidelines/