SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages...

46
SUSE® Build Story An Epic Novel with Multiple Endings Andreas Jaeger Craig Gardner Product Manager Software Engineering Manager SUSE SUSE [email protected] [email protected]

Transcript of SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages...

Page 1: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

SUSE® Build StoryAn Epic Novel with Multiple Endings

Andreas Jaeger Craig Gardner

Product Manager Software Engineering Manager

SUSE SUSE

[email protected] [email protected]

Page 2: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Image Copyright David Wright. This work is licensed under the Creative Commons Attribution-Share Alike 2.0 Generic Licence.

Page 3: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Build Story?

Use cases for images and packages

Requirements for image and package builds

Building images and packages

Deployment options

Tools to help with deployment (“Build Story”)

Imaging

Page 4: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

4

Use Cases

Page 5: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Images

Golden images

Cloud images

Images for container workloads

Page 6: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Use case: SUSE VM Cluster

SUSE R&D IT use case: Image for virtualization hosts

Special golden image for the cluster, uses kiwi

Deployment of machines with the image is fast

After deployment: Change hostname, network setup

Rebuild images: As needed

Page 7: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Use case: Cloud Image

Image to run workloads in private or public cloud

Cloud specific

Either:• Generic small image (together with configuration management)

• Specific image for one purpose

Will be updated at least with major OS updates

Available in cloud image store

Page 8: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Use case: OpenStack CI

Needs images for various public clouds

Uses them to start VMs, run test, throw away

>10000 of tests per day

Image should start fast:• Contain packages pre-cached

• Contain all git repository

Images rebuilt every day and pushed to clouds

Fully automatic build

Page 9: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Use case: Docker image

Deploying always current container images for a service

In case of SW updates, images get rebuilt

After rebuild, images tested and deployed

Page 10: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Infrastructure

DevOps Cycle – The Basics

4. Test & Release3. Build

6. Operate & Monitor

2. Code Repository 5. Deploy

1. Developers

Page 11: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

11

Requirements

Page 12: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

House building

Needs a blueprint

Workers to build

Material

Page 13: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Image and package building

Blueprint

Tools

Requirements:• Reproducible

• Fast

• Integrate with workflow:– Development

– Test

– Deployment

• Collaboration

Page 14: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

14

Reproducibility

Page 15: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Why reproducible?

Security – check for hidden doors

Important for testing

Ensure that we can do the build again:• at later time

• on another machine

• as another user

Page 16: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Problems – Internet Downloads

Zypper install

Maven

Python pip

Ruby gems

Golang

...

Page 17: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Repositories

Local proxies or mirrors• RPM: SMT, SUSE Manager, repomd

• Java: Apache Archiva, JFrog Artifactory, Sonotype Nexus

• Python: Bandersnatch

Page 18: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Reproducible Packages and Images

Packages: Build RPM package and use them

Images: Build image from local content (packages, source code)

Download all source prior to build and include them in build

Build environment extra from running machine

No manual steps, everything automatic

Store build instructions and sources together

Build instructions should be machine executable (Infrastructure-as-Code)

Page 19: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

19

Building Packages

Page 20: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Building Packages

Build RPM package and use them

rpmbuild

osc build

Open Build Service

Page 21: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

21

Building Images

Page 22: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Build Images

Various tools:• Docker – docker images

• Kiwi – installable images, virtual machine images, live images

• SUSE Studio – uses Kiwi

• Open Build Service – uses Kiwi

Page 23: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Build custom image with Kiwi

Kiwi is supported in SLES 12

XML configuration with many options

User can start with JeOS kiwi file or export from Studio

Page 24: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Build custom image with SUSE Studio

Easy to get started

WebUI allows building and editing from any OS

Page 25: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

SUSE StudioBuild once - deploy everywhere

Build, test, deploy, and maintain software applications based on SUSE Linux Enterprise.

Deploy them on physical hardware, in virtualized environments, or to cloud environments.

Available as:• Online version at

http://www.susestudio.com

• Product for installation

Page 26: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Machinery: Migration to Cloud

Inspection of system and …• Generate kiwi file for building cloud images

Part of SLES 12 “Advanced Systems Management Module”

Page 27: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

What to put into an Image?

Complete, ready-to-run images (“Appliances”):• Contain complete workload

• Allow running workload with minimal setup

• Use for:– Same workload is deployed often

– Bootup time is critical

Base images:• Contain base system, perhaps runtime

but not workload

• Need customization at boot up for workload

• Customization can be done using cloud-init, CMS

• Use for:– Different workloads that needs customization

– Large variety of different workloads

– Short life workloads with frequent config changes

Page 28: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Image Customization: cloud-init

At boot time user passes “user-data” to cloud launch tool

Works with OpenStack, AWS EC2, Microsoft Azure etc

Instance at boot time ask the “meta data server” for the “user-data”

Usage:• Set up CMS

• Set up hostname

• Add users

• Add ssh keys

• Execute scripts

Page 29: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Image Customization: CMS

CFEngine, Puppet, (soon SaltStack) part of SLES 12 Advanced Systems Management Module

Install agent on image (Ansible, SaltStack (option): ssh+python) and configure system at run-time

Can be personalized with cloud-init

Page 30: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Take Existing Image

JeOS for SLES 12• Both image and kiwi files available for download

Dockerimages for SLES 12 and SLES 11 SP4• Part of SLES 12 Container Module

Page 31: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

What is JeOS?A subset of SUSE Linux Enterprise Server, designed for:

● Efficient cloud deployments

● Minimized physical deployments

SUSE Linux Enterprise Server with respect to:

● Certifications● Availability of packages● Subscriptions and pricing● Policies for:

‒ Maintenance

‒ Support

Page 32: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Private Cloud Image

Deliverable: Ready-to-run (virtual) images

– For the major hypervisors on x86-64: Xen, KVM, Hyper-V, ESX

– Quarterly delivery based on SUSE Linux Enterprise 12 / SUSE Linux Enterprise 12 SP1 plus maintenance updates

“Silver Image”

Deliverable: Installable KIWI file

– Result is similar to theready-to-run virtual image

– Customers build their Golden Images using KIWI

Use Cases and Deliverables

Page 33: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

33

Open Build Service

Page 34: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

34

What is the Open Build Service(OBS)?

Source Package Image

OBS user submits sourceto OBS and gets a product

OB

S

OnlineRepository

Page 35: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

What Can OBS Create?

Package repositories• Add-on packages

• Entire distributions

• Variations of packages or entire products

Installable Products

Appliances

Maintenance updates

Page 36: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

What is Supported by OBS?

Build (packaging) formats• rpm (spec)• deb (dsc)• kiwi (product & appliances)• Debian Livebuild• ArchLinux

Build process features

• Build in chroot, lxc, XEN or KVM (experimental: cloud)• Architectures: ia32, ia64, x86-64, ppc*, hppa, mips, m68k, s390*,

various Arm architectures

– Qemu can be used to emulate not existing hardware

• Repositories: rpm-md, yast, apt, maintenance channels

Page 37: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Users

● Distribution development, Maintenance Updates

● Open Source Communities

● Add-Ons: Driver Developer and ISVs

● Researchers/Universities● Administration Teams

Page 38: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Using Open Build Service

Build.opensuse.org – public instance for Open Source Software

Anybody can run their own instance

Interested? Contact [email protected] !

Page 39: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Outlook Open Build Service

Import Content from SUSE Studio

Build images in OBS with graphical UI

Page 40: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

40

Orchestration

Page 41: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Next step: Automatic deployment

Automatic package and image building

But how to deploy and monitor?

Orchestration like Heat (OpenStack) and Kubernetes (Container):• Declare what you want: 1 database microservice, 2 replica of API servers, 3

replicas of frontend server

• Let the Orchestration start and monitor your service

Page 42: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

42

Multiple Endings

Page 43: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Related Technology

SUSE Linux Enterprise Server 12 Modules:• Public Cloud Module:

– Contains tools for manipulation of images and upload to public clouds

• Advanced Systems Management Module:– Contains CFEngine, Puppet, Machinery, soon SaltStack

• Containers– Contains Docker and tools

Page 44: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Some Related Presentations

HO89890 - Software packaging with the Open Build Service• Thursday, Nov 10, 10:00 AM

TUT91175 - Images, Gold, Silver, or Quicksand• Wednesday, Nov 9, 4:45 PM

HO91587 - Kubernetes hands on• Thursday, Nov 10, 2:00 PM

HO91456 - Orchestrating Docker Containers with Heat• Friday, Nov 11, 9:00 AM

Page 45: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building

Many different ways to build and automate.SUSE provides powerful solutions.How are you going to build?

Page 46: SUSE Build Story · SUSE ® Build Story An Epic Novel with Multiple Endings ... Building Packages Build RPM package and use them rpmbuild osc build Open Build Service. 21 Building