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

openSUSE Conference 2017 - The Docker at Travis Presentation

Jan 23, 2018

Download

Software

lslezak
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: openSUSE Conference 2017 - The Docker at Travis Presentation

Ladislav SlezákYaST [email protected]

Docker at TravisThere is no excuse for NOT using a CI

Page 2: openSUSE Conference 2017 - The Docker at Travis Presentation

Why Travis?

Page 3: openSUSE Conference 2017 - The Docker at Travis Presentation

Travis – Introduction

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

Page 4: openSUSE Conference 2017 - The Docker at Travis Presentation

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

Page 5: openSUSE Conference 2017 - The Docker at Travis Presentation

Why Docker?

Page 6: openSUSE Conference 2017 - The Docker at Travis Presentation

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

Page 7: openSUSE Conference 2017 - The Docker at Travis Presentation

Example1: Snapper

Page 8: openSUSE Conference 2017 - The Docker at Travis Presentation

Snapper

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

Page 9: openSUSE Conference 2017 - The Docker at Travis Presentation

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

Page 10: openSUSE Conference 2017 - The Docker at Travis Presentation

Snapper – Travis

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

Page 11: openSUSE Conference 2017 - The Docker at Travis Presentation

Example2: YaST

Page 12: openSUSE Conference 2017 - The Docker at Travis Presentation

YaST

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

Page 13: openSUSE Conference 2017 - The Docker at Travis Presentation

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)

Page 14: openSUSE Conference 2017 - The Docker at Travis Presentation

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)

Page 15: openSUSE Conference 2017 - The Docker at Travis Presentation

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)

Page 16: openSUSE Conference 2017 - The Docker at Travis Presentation

Questions?

Page 17: openSUSE Conference 2017 - The Docker at Travis Presentation

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/

Page 18: openSUSE Conference 2017 - The Docker at Travis Presentation

Contacts

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

Page 19: openSUSE Conference 2017 - The Docker at Travis Presentation

Thank You!

Page 20: openSUSE Conference 2017 - The Docker at Travis Presentation

Join Us at www.opensuse.org

Page 21: openSUSE Conference 2017 - The Docker at Travis Presentation

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/