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

Post on 04-Jun-2020

8 views 0 download

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

SUSE® Build StoryAn Epic Novel with Multiple Endings

Andreas Jaeger Craig Gardner

Product Manager Software Engineering Manager

SUSE SUSE

aj@suse.com cgardner@suse.com

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

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

4

Use Cases

Images

Golden images

Cloud images

Images for container workloads

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

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

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

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

Infrastructure

DevOps Cycle – The Basics

4. Test & Release3. Build

6. Operate & Monitor

2. Code Repository 5. Deploy

1. Developers

11

Requirements

House building

Needs a blueprint

Workers to build

Material

Image and package building

Blueprint

Tools

Requirements:• Reproducible

• Fast

• Integrate with workflow:– Development

– Test

– Deployment

• Collaboration

14

Reproducibility

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

Problems – Internet Downloads

Zypper install

Maven

Python pip

Ruby gems

Golang

...

Repositories

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

• Java: Apache Archiva, JFrog Artifactory, Sonotype Nexus

• Python: Bandersnatch

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)

19

Building Packages

Building Packages

Build RPM package and use them

rpmbuild

osc build

Open Build Service

21

Building Images

Build Images

Various tools:• Docker – docker images

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

• SUSE Studio – uses Kiwi

• Open Build Service – uses Kiwi

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

Build custom image with SUSE Studio

Easy to get started

WebUI allows building and editing from any OS

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

Machinery: Migration to Cloud

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

Part of SLES 12 “Advanced Systems Management Module”

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

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

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

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

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

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

33

Open Build Service

34

What is the Open Build Service(OBS)?

Source Package Image

OBS user submits sourceto OBS and gets a product

OB

S

OnlineRepository

What Can OBS Create?

Package repositories• Add-on packages

• Entire distributions

• Variations of packages or entire products

Installable Products

Appliances

Maintenance updates

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

Users

● Distribution development, Maintenance Updates

● Open Source Communities

● Add-Ons: Driver Developer and ISVs

● Researchers/Universities● Administration Teams

Using Open Build Service

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

Anybody can run their own instance

Interested? Contact aj@suse.com !

Outlook Open Build Service

Import Content from SUSE Studio

Build images in OBS with graphical UI

40

Orchestration

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

42

Multiple Endings

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

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

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