+ All Categories
Home > Software > Rebuild presentation - IoT Israel MeetUp

Rebuild presentation - IoT Israel MeetUp

Date post: 22-Jan-2018
Category:
Upload: yan-vugenfirer
View: 406 times
Download: 1 times
Share this document with a friend
60
Zero-dependency, reproducible build environments Yan Vugenfirer - [email protected] , +972-54-4758084 Dmitry Fleytman, PhD - [email protected] , +972-54-2819481
Transcript
Page 1: Rebuild presentation - IoT Israel MeetUp

Zero-dependency, reproducible build environments

Yan Vugenfirer - [email protected], +972-54-4758084 Dmitry Fleytman, PhD - [email protected], +972-54-2819481

Page 2: Rebuild presentation - IoT Israel MeetUp

The knowledge centre for cloud technologies

Page 3: Rebuild presentation - IoT Israel MeetUp

We feel developers’ pain

Page 4: Rebuild presentation - IoT Israel MeetUp

Build environments frustration

Conflicts

Toolchains

Packages Versions

Compilers

Updates

Page 5: Rebuild presentation - IoT Israel MeetUp

Build environments frustration

It works on my machine!!!

Page 6: Rebuild presentation - IoT Israel MeetUp

Solution

Leverages containers technology Seamless usage of multiple environments Environments are easily created and shared No more “works on my machine”

Page 7: Rebuild presentation - IoT Israel MeetUp
Page 8: Rebuild presentation - IoT Israel MeetUp

Underlying magic

Leverages lightweight virtualisation

Enables correct file permission and ownership

Works on any modern OS

Page 9: Rebuild presentation - IoT Israel MeetUp

What are containers?

Linux Containers - is an operating-system-level virtualization method for running multiple isolated Linux systems (containers) on a control host using a single Linux kernel.

Page 10: Rebuild presentation - IoT Israel MeetUp

What is container’s image?

A lightweight, stand-alone, executable package that includes everything needed to run a piece of software, including the code, a runtime, libraries, environment variables and config files.

Page 11: Rebuild presentation - IoT Israel MeetUp

Docker is an open-source project that enables an application and its dependencies to be packaged as a container.

What is Docker?

Page 13: Rebuild presentation - IoT Israel MeetUp

Architecture

Environments registry

Rebuild native registry

DockerHub Docker private registry

Rebuild CLI

Docker Engine

Page 14: Rebuild presentation - IoT Israel MeetUp

Rebuild CLI

Page 15: Rebuild presentation - IoT Israel MeetUp

CLI concepts

Seamless usage for developer

No knowledge of Docker, Docker files or other container technologies is needed

Page 16: Rebuild presentation - IoT Israel MeetUp

CLI concepts: Manage local environments

Manage environments on local machine

List - lists local environments

Remove (rm) - deletes local environment

Save\load - saves or loads to\from container image

Page 17: Rebuild presentation - IoT Israel MeetUp

CLI concepts: Environment names and versioning

name:tag

Name - environment ID

Tag - should be used for tracking the version of the environment

Page 18: Rebuild presentation - IoT Israel MeetUp

CLI concepts: Deploy

Deploy environment from remote registry to local machine

Search repository for environments

Need to be done once

Environment can be instantly used after deployment

Page 19: Rebuild presentation - IoT Israel MeetUp

CLI concepts: RunRun the environment

Environment doesn’t change in the process of running

Can be used in interactive mode or to run just one command

Changes to local files are preserved with correct permissions and ownership

Page 20: Rebuild presentation - IoT Israel MeetUp

CLI concepts: Create

Create new environment

From base image from DockerHub

From archive of a file system

Page 21: Rebuild presentation - IoT Israel MeetUp

CLI concepts: Modify, status and commit

Change existing environment

Modify - instructs rebuild to track changes in existing environment

Status - shows environments’ status

Commit - saves the changes and create new tag for the environment

Page 22: Rebuild presentation - IoT Israel MeetUp

CLI concepts: Publish

Share your work

“Pushes” the environment to repository

Page 23: Rebuild presentation - IoT Israel MeetUp

Images saved to public cloud

Images can be shared with everybody

Images from official repositories can be used as base images for new environments

Registry: DockerHub

Page 24: Rebuild presentation - IoT Israel MeetUp

Registry: Docker private registry

Docker enterprise or community addition of private registry

Internal to your organisation

Might need additional configurations

Page 25: Rebuild presentation - IoT Israel MeetUp

Registry: Rebuild Native registry

Easy to deploy and use in production

Lightweight

Internal for your organisation

No configuration is needed

Page 26: Rebuild presentation - IoT Israel MeetUp

Supported OSes

Page 27: Rebuild presentation - IoT Israel MeetUp

Installation

Page 28: Rebuild presentation - IoT Israel MeetUp

Installation - dependencies

Docker engine

Ruby 2.0+

Page 29: Rebuild presentation - IoT Israel MeetUp

Installation

Page 30: Rebuild presentation - IoT Israel MeetUp

Quick start

Run: rbld help

Already configured to deploy environments from Rebuild DockerHub repositories

Can create environments based on DockerHub

Page 31: Rebuild presentation - IoT Israel MeetUp

Get Help

Page 32: Rebuild presentation - IoT Israel MeetUp

$HOME/.rbld/rebuild.conf

#DockerHub REMOTE_NAME=origin REMOTE_TYPE_origin="dockerhub" REMOTE_origin="<NAMESPACE>/<REPOSITORY>"

Configuration: DockerHub

Page 33: Rebuild presentation - IoT Israel MeetUp

Configuration: Rebuild registry

$HOME/.rbld/rebuild.conf

#Rebuild registry REMOTE_NAME=origin REMOTE_TYPE_origin="rebuild" REMOTE_origin="<ABSOLUTE PATH TO REGISTRY ROOT DIRECTORY>"

Page 34: Rebuild presentation - IoT Israel MeetUp

$HOME/.rbld/rebuild.conf

#Docker registry REMOTE_NAME=origin REMOTE_TYPE_origin="docker" REMOTE_origin="<REGISTRY IP>:<PORT>"

Configuration: Docker Registry

Page 35: Rebuild presentation - IoT Israel MeetUp

Environment deployment

Page 36: Rebuild presentation - IoT Israel MeetUp

Environment deployment - search in registry

Page 37: Rebuild presentation - IoT Israel MeetUp

Environment deployment

Page 38: Rebuild presentation - IoT Israel MeetUp

Environment deployment

Page 39: Rebuild presentation - IoT Israel MeetUp

Usage

Page 40: Rebuild presentation - IoT Israel MeetUp

Usage - single command

Page 41: Rebuild presentation - IoT Israel MeetUp

Usage - interactive

Page 42: Rebuild presentation - IoT Israel MeetUp

Environment creation

Page 43: Rebuild presentation - IoT Israel MeetUp

Environment creation

[test@rebuild-fedora23-1~]$rbldcreate--baseubuntu:15.10ubuntu1510

Downloadingthebaseimage...Tryingtopullrepositorydocker.io/library/ubuntu...15.10:Pullingfromlibrary/ubuntu

...

Successfullycreatedubuntu1510:initial

Page 44: Rebuild presentation - IoT Israel MeetUp

Environment creation

[test@rebuild-fedora23-1~]$rbldcreate--basefilealpine34.tar.gzalpine34

Buildingenvironment...

...

Successfullycreatedalpine34:initial

Page 45: Rebuild presentation - IoT Israel MeetUp

Environment modification

Page 46: Rebuild presentation - IoT Israel MeetUp

Modify[test@rebuild-fedora23-1~]$rbldmodifyubuntu1510--\"sudoapt-getupdate&&\sudoapt-getinstall-ygcc"

Initializingenvironment[.....]>>>rebuildenvubuntu1510:initial-M>>>sudoapt-getupdate&&sudoapt-getinstall-ygccHithttp://archive.ubuntu.comwilyInRelease

...

Processingtriggersforlibc-bin(2.21-0ubuntu4.3)...<<<rebuildenvubuntu1510:initial-M

Page 47: Rebuild presentation - IoT Israel MeetUp

Modify - interactive mode

[test@rebuild-fedora23-1~]$rbldmodifyubuntu1510:initial

Initializingenvironment[.....]>>>rebuildenvubuntu1510:initial-Minteractive>>>PressCTRL-Ddoleavetest@ubuntu1510:initial-M:~$

Page 48: Rebuild presentation - IoT Israel MeetUp

Get status

[test@rebuild-fedora23-1~]$rbldstatus

modified:ubuntu1510:initial

Page 49: Rebuild presentation - IoT Israel MeetUp

Commit changes to environment

[test@rebuild-fedora23-1~]$rbldcommit--tagv001

Page 50: Rebuild presentation - IoT Israel MeetUp

Revert changes

[test@rebuild-fedora23-1~]$rbldcheckoutubuntu1510:initial

Page 51: Rebuild presentation - IoT Israel MeetUp

Environment-wide variables[test@rebuild-fedora23-1~]$rbldmodifyubuntu1510:initial

Initializingenvironment[.....]>>>rebuildenvubuntu1510:initial-Minteractive>>>PressCTRL-Ddoleavetest@ubuntu1510:initial-M:~$sudovi/rebuild/rebuild.rctest@ubuntu1510:initial-M:~$cat/rebuild/rebuild.rc#Thisistherebuildenvironmentdefinitionfile.#Definerequiredenvironmentvariableshere.##NOTE:Makesuretoprefixdefinitionswith#'export'directive,i.e.#exportMY_PATH=/path/to/some/locationexportCC=clang

test@ubuntu1510:initial-M:~$exit<<<rebuildenvubuntu1510:initial-M

Page 52: Rebuild presentation - IoT Israel MeetUp

gitclonegit://github.com/raspberrypi/tools.gitrpi-tools

rbldcreate--baseubuntu:16.04rpi-raspbian

rbldmodifyrpi-raspbian:initial

>>sudoapt-getupdate>>sudoapt-getinstall-ymake>>TOOLCHAIN=gcc-linaro-arm-linux-gnueabihf-raspbian-x64>>sudocp-rrpi-tools/arm-bcm2708/$TOOLCHAIN/>>echoexportCC=/$TOOLCHAIN/bin/arm-linux-gnueabihf-|sudotee-a/rebuild/rebuild.rc>>exit

rbldcommitrpi-raspbian--tagv001

Putting all together

Page 53: Rebuild presentation - IoT Israel MeetUp

Sharing environments - publishing to registry

[test@rebuild-fedora23-1~]$rbldpublishqemu-fc22:v001

Checkingforcollisions...

Publishingat10.0.110.110:5000...

...

Successfullypublishedqemu-fc22:v001

Page 54: Rebuild presentation - IoT Israel MeetUp

Sharing environments - saving and loading from file

[test@rebuild-fedora23-1~]$rbldsaveqemu-fc20:v001

Successfullysavedenvironmentqemu-fc20:v001toqemu-fc20-v001.rbld

[test@rebuild-fedora23-1~]$rbldloadqemu-fc20-v001.rbld

Successfullyloadedenvironmentfromqemu-fc20-v001.rbld

Page 55: Rebuild presentation - IoT Israel MeetUp

DebuggingRebuild CLI

RBLD_LOG_LEVEL - info, warn, error and fatal

RBLD_LOG_FILE - save logs to file

Environment bootstrap tracing

RBLD_BOOTSTRAP_TRACE - set to 1 to enable environment startup tracing for rbld run and rbld modify.

Page 57: Rebuild presentation - IoT Israel MeetUp

Summary

Seamless usage

Isolated environments

Easy to share the environments between team members

Page 58: Rebuild presentation - IoT Israel MeetUp

Multiple registries support

Support for additional image registries

USB redirection for non-Linux hosts

Enterprise Dashboard with role management

Page 59: Rebuild presentation - IoT Israel MeetUp

Recommended