Ladislav Slezák
YaST Developer
lslezak@suse.cz
Docker at Travis
There 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: yast-devel@opensuse.org
● IRC: #yast at freenode.net
Thank You!
Join Us at www.opensuse.org
License
This 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 Disclaimer
This 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
Template
Richard Brown
rbrown@opensuse.org
Design & Inspiration
openSUSE Design Team
http://opensuse.github.io/branding-
guidelines/

openSUSE Conference 2017 - The Docker at Travis Presentation

  • 1.
    Ladislav Slezák YaST Developer lslezak@suse.cz Dockerat Travis There is no excuse for NOT using a CI
  • 2.
  • 3.
    Travis – Introduction ●CI as a service (hosted) ● Free for open source projects ● Integrated with GitHub
  • 4.
    Travis ● Builds runin 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
  • 5.
  • 6.
    Docker ● Works outof box at Travis ● Container based, no virtualization ● Lightweight (minimal overhead) ● Many base OS images available ● Easy to build and publish your own images
  • 7.
  • 8.
    Snapper ● A toolfor managing file system snapshots ● Portable, built for many distributions in OBS ● Single Git source repository ● Changed less frequently
  • 9.
    Snapper – TravisImplementation ● 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
  • 10.
  • 11.
  • 12.
    YaST ● Not portable,(open)SUSE specific ● Does not work in other distributions ● Modular design ● 100+ Git source repositories ● Bigger development team, frequent changes
  • 13.
    YaST – OldUbuntu 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)
  • 14.
    YaST – NewDocker 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)
  • 15.
    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)
  • 16.
  • 17.
    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/
  • 18.
  • 19.
  • 20.
    Join Us atwww.opensuse.org
  • 21.
    License This slide deckis 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 Disclaimer This 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 Template Richard Brown rbrown@opensuse.org Design & Inspiration openSUSE Design Team http://opensuse.github.io/branding- guidelines/