judcon 2010 boston : boxgrinder

80
Bob McWhirter JBoss Fellow

Upload: marekgoldmann

Post on 01-Jul-2015

987 views

Category:

Technology


0 download

DESCRIPTION

Presented by Bob McWhirter at JUDCon 2010 in Boston.

TRANSCRIPT

Page 1: JUDCon 2010 Boston : BoxGrinder

Bob McWhirterJBoss Fellow

Page 2: JUDCon 2010 Boston : BoxGrinder

Bob McWhirterJBoss Fellow

Page 3: JUDCon 2010 Boston : BoxGrinder

Who is Bob?• JBoss Fellow• Chief Architect of Middleware Cloud Computing

• Founder of...• The Codehaus• Drools • TorqueBox

Page 4: JUDCon 2010 Boston : BoxGrinder

Who is Marek?

• Marek Goldmann• Polish!• Electronic musician

•The guy who actually does all the work

Page 5: JUDCon 2010 Boston : BoxGrinder

Background

Infrastructure(IaaS)

Platform(PaaS)

Software(SaaS)

Simplified “cloud” stack

Page 6: JUDCon 2010 Boston : BoxGrinder

Background

Infrastructure(IaaS)

Platform(PaaS)

Software(SaaS) What you write

Page 7: JUDCon 2010 Boston : BoxGrinder

Background

Infrastructure(IaaS)

Platform(PaaS)

Software(SaaS) What you write

What you target

Page 8: JUDCon 2010 Boston : BoxGrinder

Background

Infrastructure(IaaS)

Platform(PaaS)

Software(SaaS) What you write

What you target

Where it runs

Page 9: JUDCon 2010 Boston : BoxGrinder

Background

Infrastructure(IaaS)

Platform(PaaS)

Software(SaaS) What you write

What you target

Where it runsYou don’t want to care

Page 10: JUDCon 2010 Boston : BoxGrinder

BoxGrinder helps turn bare hardware into a

useful substrate.(or “platform”)

Page 11: JUDCon 2010 Boston : BoxGrinder

BoxGrinder doesn’t care what you consider

to be a platform

Page 12: JUDCon 2010 Boston : BoxGrinder

Virtual Machines“appliances”

Page 13: JUDCon 2010 Boston : BoxGrinder

But first...

There’s at least two different ideological camps with opinions on creating virtual machines...

Page 14: JUDCon 2010 Boston : BoxGrinder

Bake v. Fry

Bake: Produce a complete virtual machine offline, before first use.

Fry: Produce a complete virtual machine by booting a basic VM and then applying configuration.

Page 15: JUDCon 2010 Boston : BoxGrinder

BakeQuicker launchRequires more storageNot up-to-date

FryLonger launchLess storageMore up-to-date

Page 16: JUDCon 2010 Boston : BoxGrinder

Storage

Bake FryBase Appliance

Web Appliance

Messaging Appliance

Transactions Appliance

Base Appliance

Web config

Messaging config

Transactions config

Page 17: JUDCon 2010 Boston : BoxGrinder

Bake!

We think baking is The Right Way, especially for developers simply looking for reliable platforms.

Page 18: JUDCon 2010 Boston : BoxGrinder

Bake & Fry

Baking out an appliances does not prohibit using existing update mechanisms. It just provides a starting point.

Page 19: JUDCon 2010 Boston : BoxGrinder

Grind

BoxGrinder grinds out fully-configured and usable virtual machines for a variety of IaaS fabrics.

Page 20: JUDCon 2010 Boston : BoxGrinder

ApplianceDefinition BoxGrinder

Repo

EC2

VMware

KVM

RepoRepo

Page 21: JUDCon 2010 Boston : BoxGrinder

Appliance Definition

•YAML – not XML•Allow mix-ins/composition•Easily re-target different base OSes

Page 22: JUDCon 2010 Boston : BoxGrinder

Let’s build a JBossAS Appliance

Page 23: JUDCon 2010 Boston : BoxGrinder

Quick Examplename: back-endversion: 1release: 1summary: back-end appliance with JBoss AS 6hardware: memory: 512 partitions: "/": size: 2appliances: - cirraspackages: includes: - jboss-as6 - jboss-as6-cloud-profiles - java-1.6.0-openjdk

Page 24: JUDCon 2010 Boston : BoxGrinder

Prologname: back-endversion: 1release: 1summary: back-end appliance with JBoss AS 6hardware: memory: 512 partitions: "/": size: 2appliances: - cirraspackages: includes: - jboss-as6 - jboss-as6-cloud-profiles - java-1.6.0-openjdk

Page 25: JUDCon 2010 Boston : BoxGrinder

Prolog

name: back-endversion: 1release: 1summary: back-end appliance with JBoss AS 6

Page 26: JUDCon 2010 Boston : BoxGrinder

Hardwarename: back-endversion: 1release: 1summary: back-end appliance with JBoss AS 6hardware: memory: 512 partitions: "/": size: 2appliances: - cirraspackages: includes: - jboss-as6 - jboss-as6-cloud-profiles - java-1.6.0-openjdk

Page 27: JUDCon 2010 Boston : BoxGrinder

Hardware

hardware: memory: 512 partitions: "/": size: 2

512MB

2GB

Page 28: JUDCon 2010 Boston : BoxGrinder

Appliance Mix-insname: back-endversion: 1release: 1summary: back-end appliance with JBoss AS 6hardware: memory: 512 partitions: "/": size: 2appliances: - cirraspackages: includes: - jboss-as6 - jboss-as6-cloud-profiles - java-1.6.0-openjdk

Page 29: JUDCon 2010 Boston : BoxGrinder

Appliance Mix-ins

appliances: - cirras Mixing in cirras.appl

Page 30: JUDCon 2010 Boston : BoxGrinder

Tangent: cirras.applname: cirrassummary: Appliance template for CirrAS appliancesos: name: fedora version: 11hardware: memory: 256 partitions: "/": size: 1packages: includes: - bash - kernel - grub - e2fsprogs - passwd - policycoreutils - chkconfig ...

Page 31: JUDCon 2010 Boston : BoxGrinder

Tangent: cirras.applname: cirrassummary: Appliance template for CirrAS appliancesos: name: fedora version: 11hardware: memory: 256 partitions: "/": size: 1packages: includes: - bash - kernel - grub - e2fsprogs - passwd - policycoreutils - chkconfig ...

Page 32: JUDCon 2010 Boston : BoxGrinder

Appliance Mix-ins

os: name: fedora version: 11

cirras.appl mixed in

Page 33: JUDCon 2010 Boston : BoxGrinder

Appliance Mix-ins

repos: - name: "cirras-#ARCH#" baseurl: "http://repo.boxgrinder.org/cirras/pack - name: "cirras-noarch" baseurl: "http://repo.boxgrinder.org/cirras/pack

cirras.appl mixed in

Page 34: JUDCon 2010 Boston : BoxGrinder

Appliance Mix-ins

back-end.appl

hardware: memory: 512 partitions: "/": size: 2

cirras.appl

hardware: memory: 256 partitions: "/": size: 1

overrides

Page 35: JUDCon 2010 Boston : BoxGrinder

Okay, let’s get back to back-end.appl...

Page 36: JUDCon 2010 Boston : BoxGrinder

Contentsname: back-endversion: 1release: 1summary: back-end appliance with JBoss AS 6hardware: memory: 512 partitions: "/": size: 2appliances: - cirraspackages: includes: - jboss-as6 - jboss-as6-cloud-profiles - java-1.6.0-openjdk

Page 37: JUDCon 2010 Boston : BoxGrinder

Contents

packages: includes: - jboss-as6 - jboss-as6-cloud-profiles - java-1.6.0-openjdk

Page 38: JUDCon 2010 Boston : BoxGrinder

Contents

packages: includes: - jboss-as6 - jboss-as6-cloud-profiles - java-1.6.0-openjdk

plus everything from cirras.appl

Page 39: JUDCon 2010 Boston : BoxGrinder

Great, I have a text file, what about a virtual machine?

Page 40: JUDCon 2010 Boston : BoxGrinder
Page 41: JUDCon 2010 Boston : BoxGrinder

Meta Appliance

Start with our meta-appliance VM (built with BoxGrinder)

Ruby • RubyGems • GitRPM dev tools • qemu • libguestfs

Page 42: JUDCon 2010 Boston : BoxGrinder

Simple installation

$ gem install boxgrinder-build

$ rpm -Uvh http://s3.amazonaws.com/ec2- downloads/ec2-ami-tools.noarch.rpm

Page 43: JUDCon 2010 Boston : BoxGrinder

Simple Definition RAW EC2

VMwareBuild Convert Deliver

Plugins

Pipeline

Page 44: JUDCon 2010 Boston : BoxGrinder

Do it!

$ boxgrinder-build -V \ ../cirras/appliances/back-end.applD, [2010-06-18T18:57:33.364113 #5110] DEBUG -- : Reading definition from '../cirras/appliances/back-end.appl' file...D, [2010-06-18T18:57:33.365527 #5110] DEBUG -- : Reading definition from '../cirras/appliances/cirras.appl' file...D, [2010-06-18T18:57:33.369167 #5110] DEBUG -- : Executing operating system plugin for fedora...I, [2010-06-18T18:57:33.371979 #5110] INFO -- : Resolving packages added to back-end appliance definition file...D, [2010-06-18T18:57:33.376092 #5110] DEBUG -- : Querying package database...D, [2010-06-18T18:57:33.377037 #5110] DEBUG -- : Executing command: 'sudo repoquery --quiet --disablerepo=* --enablerepo=boxgrinder_build-fedora-11-base,boxgrinder_build-fedora-11-updates,boxgrinder_build-cirras-i386,boxgrinder_build-cirras-noarch -c build/appliances/i386/fedora/11/back-end/raw/back-end.yum.conf list available jboss-as6 jboss-as6-cloud-profiles java-1.6.0-openjdk bash kernel grub e2fsprogs passwd policycoreutils chkconfig rootfiles yum vim-minimal acpid dhclient iputils generic-logos openssh-server openssh-clients mkinitrd cirras-management rhq-agent which sudo ruby-devel make gcc-c++ wget --nevra --archlist=i386,i486,i586,i686,noarch'

...time passes...

Page 45: JUDCon 2010 Boston : BoxGrinder

Build

•Figure out the full set of RPMs•Grab (and cache) them all•Create a disk image, install them all•Perform any post-install configuration

Page 46: JUDCon 2010 Boston : BoxGrinder

Simple Definition RAW EC2

VMwareBuild Convert Deliver

Plugins

Pipeline

Page 47: JUDCon 2010 Boston : BoxGrinder

...and the build finishes

.... .... INFO -- : Base image for back-end appliance was built successfully.DEBUG -- : Operating system plugin executed.DEBUG -- : No platform selected, skipping platform conversion.DEBUG -- : No delivery method selected, skipping delivering.

Page 48: JUDCon 2010 Boston : BoxGrinder

But I use VMware!

Page 49: JUDCon 2010 Boston : BoxGrinder

Do it some more!

$ boxgrinder-build -V \ ../cirras/appliances/back-end.appl \ -p vmwareD, [2010-06-18T20:39:00.931972 #7665] DEBUG -- : Reading definition from '../cirras/appliances/back-end.appl' file...D, [2010-06-18T20:39:00.934336 #7665] DEBUG -- : Reading definition from '../cirras/appliances/cirras.appl' file...I, [2010-06-18T20:39:00.939194 #7665] INFO -- : Deliverables for fedora operating system plugin exists, skipping.D, [2010-06-18T20:39:00.940075 #7665] DEBUG -- : Executing platform plugin for vmware...I, [2010-06-18T20:39:00.940689 #7665] INFO -- : Converting image to VMware format...D, [2010-06-18T20:39:00.941295 #7665] DEBUG -- : Copying VMware image file, this may take several minutes...

...time passes...

Page 50: JUDCon 2010 Boston : BoxGrinder

Simple Definition RAW EC2

VMwareBuild Convert Deliver

Plugins

Pipeline

Page 51: JUDCon 2010 Boston : BoxGrinder

...and the conversion finishes

DEBUG -- : Building VMware enterprise image.DEBUG -- : VMware enterprise image was built.DEBUG -- : Building VMware personal image.DEBUG -- : VMware personal image was built. INFO -- : Image converted to VMware format.DEBUG -- : Platform plugin executed.DEBUG -- : No delivery method selected, skipping delivering.

Page 52: JUDCon 2010 Boston : BoxGrinder

Conversion

• Converts disk formats• Converts/synthesize VM metadata• Applies platform-specific changes

• add/remove packages

Page 53: JUDCon 2010 Boston : BoxGrinder

Wait, I use EC2.

Page 54: JUDCon 2010 Boston : BoxGrinder

EC2 Conversion

$ boxgrinder-build -V \ ../cirras/appliances/back-end.appl \ -p ec2D, [2010-06-18T20:56:30.934009 #7707] DEBUG -- : Reading definition from '../cirras/appliances/back-end.appl' file...D, [2010-06-18T20:56:30.946411 #7707] DEBUG -- : Reading definition from '../cirras/appliances/cirras.appl' file...I, [2010-06-18T20:56:30.951350 #7707] INFO -- : Deliverables for fedora operating system plugin exists, skipping.D, [2010-06-18T20:56:30.952646 #7707] DEBUG -- : Executing platform plugin for ec2...I, [2010-06-18T20:56:30.958164 #7707] INFO -- : Converting back-end appliance image to EC2 format...D, [2010-06-18T20:56:30.958856 #7707] DEBUG -- : Preparing disk for EC2 image...

...time passes...

Page 55: JUDCon 2010 Boston : BoxGrinder

DEBUG -- : Installing additional packages (kernel-xen-2.6.21.7-2.fc8.i686.rpm, ec2-ami-tools.noarch.rpm)...

EC2 requires special Xen kernels and AMI tools not present in typical RPM repositories

Page 56: JUDCon 2010 Boston : BoxGrinder

And it finishes conversion

INFO -- : Image converted to EC2 format.DEBUG -- : Platform plugin executed.DEBUG -- : No delivery method selected, skipping delivering.

Page 57: JUDCon 2010 Boston : BoxGrinder

Simple Definition RAW EC2

VMwareBuild Convert Deliver

Plugins

Pipeline

VMware

EC2

Page 58: JUDCon 2010 Boston : BoxGrinder

Now you have a useless EC2 image on your local disk.

F’awesome!

Page 59: JUDCon 2010 Boston : BoxGrinder

Amazon Credentials

$HOME/.boxgrinder/plugins/s3:

bucket: stormgrind-testaccess_key: 1JF8xxxxxxxxxsecret_access_key: TRVRfko1vxxxxxxxxxxxxxxxxxxaccount_number: 6010-xxxx-xxxxcert_file: ~/.ec2/cert-LC42AGGJxxxxxxx.pemkey_file: ~/.ec2/pk-LC42AGGJxxxxxxx.pem

Page 60: JUDCon 2010 Boston : BoxGrinder

Amazon Credentials

$HOME/.boxgrinder/plugins/s3:

bucket: stormgrind-testaccess_key: 1JF8xxxxxxxxxsecret_access_key: TRVRfko1vxxxxxxxxxxxxxxxxxxaccount_number: 6010-xxxx-xxxxcert_file: ~/.ec2/cert-LC42AGGJxxxxxxx.pemkey_file: ~/.ec2/pk-LC42AGGJxxxxxxx.pem

Page 61: JUDCon 2010 Boston : BoxGrinder

Amazon Credentials

$HOME/.boxgrinder/plugins/s3:

bucket: stormgrind-testaccess_key: 1JF8xxxxxxxxxsecret_access_key: TRVRfko1vxxxxxxxxxxxxxxxxxxaccount_number: 6010-xxxx-xxxxcert_file: ~/.ec2/cert-LC42AGGJxxxxxxx.pemkey_file: ~/.ec2/pk-LC42AGGJxxxxxxx.pem

Page 62: JUDCon 2010 Boston : BoxGrinder

Amazon Credentials

$HOME/.boxgrinder/plugins/s3:

bucket: stormgrind-testaccess_key: 1JF8xxxxxxxxxsecret_access_key: TRVRfko1vxxxxxxxxxxxxxxxxxxaccount_number: 6010-xxxx-xxxxcert_file: ~/.ec2/cert-LC42AGGJxxxxxxx.pemkey_file: ~/.ec2/pk-LC42AGGJxxxxxxx.pem

Page 63: JUDCon 2010 Boston : BoxGrinder

...and deliver it!

$ boxgrinder-build -V \ ../cirras/appliances/back-end.appl \ -p ec2 -d amiD, [2010-06-18T21:17:40.469872 #7913] DEBUG -- : Reading definition from '../cirras/appliances/back-end.appl' file...D, [2010-06-18T21:17:40.480562 #7913] DEBUG -- : Reading definition from '../cirras/appliances/cirras.appl' file...I, [2010-06-18T21:17:40.485056 #7913] INFO -- : Deliverables for fedora operating system plugin exists, skipping.I, [2010-06-18T21:17:40.485794 #7913] INFO -- : Deliverables for ec2 platform plugin exists, skipping.D, [2010-06-18T21:17:40.486385 #7913] DEBUG -- : Reading configuration file for BoxGrinder::S3Plugin.

...time passes...

Page 64: JUDCon 2010 Boston : BoxGrinder

...and deliver it!

DEBUG -- : Executing command: 'ec2-bundle-image -i build/appliances/i386/fedora/11/back-end/ec2/back-end.ec2 --kernel aki-a71cf9ce --ramdisk ari-a51cf9cc

...more time passes...ec2-upload-bundle

Page 65: JUDCon 2010 Boston : BoxGrinder

Simple Definition RAW EC2

VMwareBuild Convert Deliver

Plugins

Pipeline

VMware

EC2 AMI

Page 66: JUDCon 2010 Boston : BoxGrinder

Image successfully registered under id: ami-XXXXX.

and finally...

Page 67: JUDCon 2010 Boston : BoxGrinder

S3

Page 68: JUDCon 2010 Boston : BoxGrinder

EC2

Page 69: JUDCon 2010 Boston : BoxGrinder

Notes...

• If you’re building for EC2, start with a meta-appliance on EC2. Uploading across the WAN sucks hard.

• Architecture of host must match the architecture of appliances being built.

Page 70: JUDCon 2010 Boston : BoxGrinder

Wait, what?

Architecture of the host must match the architecture of the appliances being built.

x86_64 i386

Page 71: JUDCon 2010 Boston : BoxGrinder
Page 72: JUDCon 2010 Boston : BoxGrinder

RESTful API for driving farms of BoxGrinder-Build nodes.

Page 73: JUDCon 2010 Boston : BoxGrinder

BoxGrinder REST Queue

BoxGrinder node

BoxGrinder node

BoxGrinder nodeDefinition

BoxGrinder-REST

Page 74: JUDCon 2010 Boston : BoxGrinder

BoxGrinder REST Queue

BoxGrinder node

BoxGrinder node

BoxGrinder nodeDefinition

BoxGrinder-REST

Runs on TorqueBox, using HornetQ

Page 75: JUDCon 2010 Boston : BoxGrinder

BoxGrinder-REST

• Queue per each supported platform• Multiple builders per queue possible• Builders launching on-demand soon

• Using Deltacloud

• Supports for multiple conversions• Supports multiple deliveries

Page 76: JUDCon 2010 Boston : BoxGrinder

BoxGrinder-REST

• Command-line interface• Web Client (BoxGrinder-Studio?)• IDE integration (JBoss Tools?)

Page 77: JUDCon 2010 Boston : BoxGrinder

Currently Supports

OSRHEL 5Fedora 11-13

Archx86_64i386

HypervisorKVMXenVMware personalVMware enterpriseAmazon EC2

DeliveryLocalSFTPS3CloudFrontAMI

Page 78: JUDCon 2010 Boston : BoxGrinder

Thanks!

Page 79: JUDCon 2010 Boston : BoxGrinder

Q&A

Page 80: JUDCon 2010 Boston : BoxGrinder

Resourceshttp://github.com/stormgrind/ # Codehttp://jboss.org/stormgrind/ # Projectshttp://cloudpress.org/ # Blog

#stormgrind # IRC

@stormgrind # Twitter@marekgoldmann@bobmcwhirter