+ All Categories
Home > Technology > BoxGrinder – FUDCon 2011 Tempe

BoxGrinder – FUDCon 2011 Tempe

Date post: 26-Jun-2015
Category:
Upload: marekgoldmann
View: 806 times
Download: 0 times
Share this document with a friend
Description:
Introduction to BoxGrinder – a family of tools to grind out appliances for various platforms.
Popular Tags:
50
Transcript
Page 1: BoxGrinder – FUDCon 2011 Tempe
Page 2: BoxGrinder – FUDCon 2011 Tempe

Marek Goldmann

Page 3: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Agenda

• whoami• Some background and terminology• BoxGrinder

• Appliance definition files• Architecture overview

• Build process• Writing a plugin

• Small demo

Page 4: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Who’s Marek?

• JBoss Developer

• Cloud-related projects: lead of

• Part of

• Electronic music lover

Page 5: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Some terminology

Page 6: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Appliance is a preconfigured disk image (virtual machine) with operating system and all required

applications to do specific job

Page 7: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Appliance examples with tasks

• Database• Storing data

• Front-end• Load balancing

• Back-end• Actual servers

Page 8: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Bake vs. 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 9: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Bake!

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

Page 10: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

If you bake an image you can fry it then later too! Baked image can be your start point.

Bake, then fry

Page 11: BoxGrinder – FUDCon 2011 Tempe
Page 12: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

is a family of tools to grind out appliances for

various platforms

Page 13: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Page 14: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

stable

development

planning

Current status

Page 15: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

ApplianceDefinition BoxGrinder

Repo

EC2

VMware

KVM

RepoRepo

Page 16: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Closer look at appliance definition file

Page 17: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Appliance definition, huh?

• Plain text file – YAML format• Very easy to understand, modify• Inheritance (mixins)

Page 18: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

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

Appliance example

Page 19: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

General information

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

should match the filename: back-end.appl

Page 20: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Hardware

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

512MB

2GB

Page 21: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Appliance Mix-ins

appliances: - fedora-base

Mixing in fedora-base.appl

Page 22: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

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

back-end.appl

Page 23: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

fedora-base.applname: fedora-basesummary: Basic Fedora OSos: name: fedora version: 14hardware: memory: 256 partitions: "/": size: 1packages: - @core - openssh-server - openssh-clients - wget

Page 24: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Appliance Mix-ins

back-end.appl

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

fedora-base.appl

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

overrides

Page 25: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Appliance content

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

Page 26: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Appliance content

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

Plus everything from fedora-base.appl

Page 27: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

There is a lot more!

• Additional sections• repos

• ephemeral repos• post

• What should be done after you build you appliance

• Different commands for different platform• Using libguestfs

• Learn more! http://community.jboss.org/wiki/BoxGrinderBuildApplianceDefinitionFile

Page 28: BoxGrinder – FUDCon 2011 Tempe
Page 29: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

BoxGrinder Build architecture

Page 30: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Simple Definition RAW EC2

VMwareBuild Convert Deliver

PluginsSFTP

CloudFront

AMI

Operating system Platform Delivery

Page 31: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Simple Definition RAW EC2

VMwareBuild Convert Deliver

PluginsSFTP

CloudFront

AMI

Write your own plugins, it’s easy!http://community.jboss.org/wiki/BoxGrinderBuildHowToWriteAPlugin

Operating system Platform Delivery

Page 32: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Plugin skeleton

require 'boxgrinder-build/plugins/base-plugin'

class YourPlugin < BoxGrinder::BasePlugin def execute # PLACE YOUR CODE HERE endend

Page 33: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Plugin registration

require 'boxgrinder-build/managers/plugin-manager'require 'xyz-your-plugin/your-plugin'

plugin :class => YourPlugin, :type => :platform, :name => :mycloud, :full_name => "MyCloud"

Page 34: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

How to install BoxGrinder Build

Page 35: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Page 36: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

BoxGrinder Build installation

1.Install BoxGrinder Build

yum install rubygem-boxgrinder-build

Page 37: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

BoxGrinder Build installation

2.Install plugins you need

yum install rubygem-boxgrinder-build-fedora-os-pluginyum install rubygem-boxgrinder-build-centos-os-pluginyum install rubygem-boxgrinder-build-rhel-os-plugin

yum install rubygem-boxgrinder-build-ec2-platform-pluginyum install rubygem-boxgrinder-build-vmware-platform-pluginyum install rubygem-boxgrinder-build-virtualbox-platform-plugin

yum install rubygem-boxgrinder-build-s3-delivery-pluginyum install rubygem-boxgrinder-build-local-delivery-pluginyum install rubygem-boxgrinder-build-sftp-delivery-plugin

Page 38: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Meta appliance

• A preconfigured appliance to build other appliances using BoxGrinder

• Easy to jump in• Available for different platforms: Xen, KVM, EC2,

VMware• Best way to build EC2 appliances

• http://www.jboss.org/boxgrinder/downloads/build/meta-appliance.html

Page 39: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Demo: build a simple appliance

Page 40: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Demo: build a simple appliance

convert and deliver

Page 41: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Simple Definition RAW EC2

VMwareBuild Convert Deliver

PluginsSFTP

CloudFront

AMI

Step 1: create base image

boxgrinder build f14-jeos.appl

Page 42: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Step 2: convert it to VMware type

boxgrinder build f14-jeos.appl -p vmware

Simple Definition RAW EC2

VMwareBuild Convert Deliver

PluginsSFTP

CloudFront

AMI

-p ec2...

Page 43: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Step 3: deliver it to a SFTP server

boxgrinder build f14-jeos.appl -p vmware -d sftp

Simple Definition RAW EC2

VMwareBuild Convert Deliver

PluginsSFTP

CloudFront

AMI

-d ebs-d s3...

Page 44: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Of course you can run the command just once with

same result!

boxgrinder build back-end.appl -p vmware -d sftp

Page 45: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

What’s hot?

Page 46: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

BoxGrinder Build features

• Supported OSes: Fedora, CentOS, RHEL• Supported platforms: EC2 (S3-based and EBS-

based too!), KVM, VMware, VirtualBox• Many delivery options: local, SFTP, S3 or

CloudFront as tarred image, AMI

Page 47: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

BoxGrinder Build features

• Cross-arch builds: producing i386 images on x86_64 hosts

• Caching downloaded resources (RPM’s)• Pretty fast – from .appl to registered AMI: 15

minutes (on EC2, using meta-appliance)

Page 48: BoxGrinder – FUDCon 2011 Tempe

FUDCon Tempe 2011

Notes

• If you’re building AMI’s – do it on EC2 – this will safe your time (uploading to S3 from your local machine isn’t fun...)

• Building EBS-based AMI’s requires to run BoxGrinder on EC2

Page 49: BoxGrinder – FUDCon 2011 Tempe

Questions?

http://github.com/boxgrinder/ # Codehttp://jboss.org/boxgrinder/ # Home pagehttp://cloudpress.org/ # Blog

#boxgrinder # IRC

@boxgrinder@marekgoldmann

Page 50: BoxGrinder – FUDCon 2011 Tempe

Thanks!


Recommended