devops using open build service - suse linux · 2020-05-08 · development pipeline the classic...

31
DevOps using Open Build Service Adrian Schröter Project Manager Build Service <[email protected]>

Upload: others

Post on 24-May-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

DevOps using Open Build Service

Adrian Schröter

Project Manager Build Service

<[email protected]>

Page 2: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

What is the Open Build Service(OBS)?

Source Package Image

OBS user submits sourceto OBS and gets a product

OB

S

Page 3: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

OBS Usage

Developer

Reviewer

Maintenance Updates

Product

PTF Updates

Support

Page 4: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Users● Distribution development, Maintenance Updates

● Open Source Communities

● Add-Ons: Driver Developer and ISVs

● Researchers/Universities● Administration Teams

Page 5: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Support

● Community● [email protected]● Irc: #opensuse-buildservice on freenode

● Professional http://www.open-build-service.org/contact/ B1 Systems (L3 backing by SUSE)

Page 6: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

DevOps

Page 7: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Development Pipeline

The classic DevOps setup.

Development Env Continuous Integration Test Instance Production System

Page 8: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Development Pipeline

The classic DevOps setup.

Development Env Continuous Integration Test Instance Production System

Workstation

● Development● Unit tests

Page 9: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Working local using OBS

Getting a local copy

# osc checkout science:unstable FreeCAD

# cd science:unstable/FreeCAD

Page 10: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Working local using OBS

Getting a local copy

# osc checkout openSUSE:Factory FreeCAD# cd openSUSE:Factory/FreeCAD

Running a local build

# osc build

Page 11: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Working local using OBS

Getting a local copy

# osc checkout openSUSE:Factory FreeCAD# cd openSUSE:Factory/FreeCAD

Running a local build

# osc build

# osc build –alternate-project SUSE:SLE-12:GA

Page 12: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Testing using OBS

Tests are part of package build

● eg. use %check section in rpm spec files● avoid network usage to stay reproducable

“Unit tests” are single package builds running their test-suite here.

Page 13: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Development Pipeline

The classic DevOps setup.

Development Env Continuous Integration Test Instance Production System

Workstation

● Development● Unit tests

Automated Building

● Build latest code● Functional tests

Page 14: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Follow a remote source

For example a git repository

# osc add https://github.com/FreeCAD/FreeCAD.git

Creates a _service file describing how to download the source

and to create a tar ball for packaging.

Page 15: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Testing using OBS

Packages in the same project can influence each other

“Functional tests” are a set of package builds running their test-suite.

science:unstable

openSUSE_42.2

oce

Project

Code Stream Repository

Package Container

FreeCAD

SLE_12

Coin

Page 16: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Testing using OBS

Packages in the same project can influence each other

“Functional tests” are a set of package builds running their test-suite.

science:unstable

openSUSE_42.2

oce

FreeCAD

SLE_12

Coin

● OBS calculates the need of rebuilding

● Consistent builds are guaranteed● Multiple distributions from the same

source

Page 17: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Create Test Instances

Creating a personal branch

# osc branch science:unstable oce

Creates new home:$USER:branches:science:unstable project

“On demand tests” are easy possible

Page 18: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Create Test Instances

Creating a personal branch

# osc branch science:unstable oce

● Local changes can be applied via spec file● The git branch can be changed via editing _service file● Changes supposed to become part of SCM can be tested local

Page 19: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Create Test Instances

Check if a change affects other packages

The project can be linked against origin project to rebuild all affecting packages.

=> Check openSUSE:Factory:Staging projects for examples

Page 20: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

OBS vs Jenkins vs Travis-ci

OBS Jenkins Travis-ci

Easy to run test - packaging needed

o scripts can be used

+ Online Available

Maintain Targets +Just there via interconnect

OManual work

-Limited to one distro

Reproducability + - -

Scalability + o o

Page 21: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Development Pipeline

The classic DevOps setup.

Development Env Continuous Integration Test Instance Production System

Workstation

● Development● Unit tests

Automated Building

● Build latest code● Functional tests

Automated Deployment

● User testing● Load tests

Page 22: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Automated deployment

Ways to deploy

● Manual package update on test system● Trigger update using a hook in OBS publisher● Deploy images via PXE

Coming:● Automatic distribution to cloud

Page 23: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Development Pipeline

The classic DevOps setup.

Development Env Continuous Integration Test Instance Production System

Workstation

● Development● Unit tests

Automated Building

● Build latest code● Functional tests

Automated Deployment

● User testing● Load tests

● Monitoring● Error reporting

Page 24: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Integrate Release Mechanism

OBS Release Mechanism

OBS release copies sources and binaries, eg:

Project:Test => Project:Stable

Page 25: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Building Scenarios

Page 26: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Create project

Own Set of Packages

Project

Page 27: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Create project

Add package sources

Own Set of Packages

Project

apache

apache-mod_perl

Page 28: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Create project

Add packages

Add targets

Own Set of Packages

Project

apache

apache-mod_perl

SLE 12

CentOS 7

Page 29: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

A Variation of a Package

Branch a package. Can be from a remote instance. Project B

apache(+ modification)

apache-mod_perl

SLE 12

CentOS 7

Project A

apachebranch

Page 30: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System

Rebuild a Part of Entire Project

Link a project

replace a package source

Configure repository to rebuild all packages affected by this package

Adrian's build service

My:KDE

SLE repository

build.opensuse.org

KDE:Current

sqlite3Project link

Page 31: DevOps using Open Build Service - SUSE Linux · 2020-05-08 · Development Pipeline The classic DevOps setup. Development Env Continuous Integration Test Instance Production System