JUDCon 2011 - Box Grinder

50
Saturday, 4 June 2011

description

 

Transcript of JUDCon 2011 - Box Grinder

Page 1: JUDCon 2011 - Box Grinder

Saturday, 4 June 2011

Page 2: JUDCon 2011 - Box Grinder

Marek  Goldmann

Saturday, 4 June 2011

Page 3: JUDCon 2011 - Box Grinder

Who’s  Marek?

•  

• JBoss  Developer

• Cloud-­related  projects:  lead  of                                                            

• Part  of  

• Electronic  music  lover

Saturday, 4 June 2011

Page 4: JUDCon 2011 - Box Grinder

Agenda

•Some  background  and  terminology•BoxGrinder•Appliance  definition  files•Architecture  overview•Build  process

•Small  demo

Saturday, 4 June 2011

Page 5: JUDCon 2011 - Box Grinder

Some  terminology

Saturday, 4 June 2011

Page 6: JUDCon 2011 - Box Grinder

Appliance  is  a  preconfigured  disk  image  (virtual  machine)  with  an  operating  

system  and  all  required  applications  to  do  a  specific  job

Saturday, 4 June 2011

Page 7: JUDCon 2011 - Box Grinder

Appliance  examples  with  tasks

• Database• Storing  data

• Front-­end• Load  balancing

• Back-­end• Actual  servers

Saturday, 4 June 2011

Page 8: JUDCon 2011 - Box Grinder

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.

Saturday, 4 June 2011

Page 9: JUDCon 2011 - Box Grinder

Bake!

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

Saturday, 4 June 2011

Page 10: JUDCon 2011 - Box Grinder

If  you  bake  an  image  you  can  fry  it  later  too!  The  baked  image  can  be  your  starting  point.

Bake,  then  fry

Saturday, 4 June 2011

Page 11: JUDCon 2011 - Box Grinder

Saturday, 4 June 2011

Page 12: JUDCon 2011 - Box Grinder

                                         is  a  family  of  tools  to  grind  out  appliances  for  various  platforms

Saturday, 4 June 2011

Page 13: JUDCon 2011 - Box Grinder

Saturday, 4 June 2011

Page 14: JUDCon 2011 - Box Grinder

stable

development

planning

Current  status

Saturday, 4 June 2011

Page 15: JUDCon 2011 - Box Grinder

ApplianceDefinition BoxGrinder

Repo

EC2

VMware

KVM

RepoRepo

Saturday, 4 June 2011

Page 16: JUDCon 2011 - Box Grinder

Closer  look  at  appliance  definition  files

Saturday, 4 June 2011

Page 17: JUDCon 2011 - Box Grinder

Appliance  definition,  huh?

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

Saturday, 4 June 2011

Page 18: JUDCon 2011 - Box Grinder

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

Saturday, 4 June 2011

Page 19: JUDCon 2011 - Box Grinder

General  information

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

should match the filename: back-end.appl

Saturday, 4 June 2011

Page 20: JUDCon 2011 - Box Grinder

Hardware

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

512MB

2GB

Saturday, 4 June 2011

Page 21: JUDCon 2011 - Box Grinder

Appliance  Mix-­ins

appliances:    -­  fedora-­base

Mixing  in  fedora-­base.appl

Saturday, 4 June 2011

Page 22: JUDCon 2011 - Box Grinder

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

Saturday, 4 June 2011

Page 23: JUDCon 2011 - Box Grinder

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

Saturday, 4 June 2011

Page 24: JUDCon 2011 - Box Grinder

Appliance  Mix-­ins

back-­end.appl

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

fedora-­base.appl

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

overrides

Saturday, 4 June 2011

Page 25: JUDCon 2011 - Box Grinder

Appliance  content

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

Saturday, 4 June 2011

Page 26: JUDCon 2011 - Box Grinder

Appliance  content

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

Plus  everything  from  fedora-­base.appl

Saturday, 4 June 2011

Page 27: JUDCon 2011 - Box Grinder

There  is  a  lot  more!

• Additional  sections• repos• ephemeral  repos

• post• What  should  be  done  after  you  build  your  appliance• Different  commands  for  different  platforms• Using  libguestfs

• Learn  more!  

http://boxgrinder.org/tutorials/appliance-definition/

Saturday, 4 June 2011

Page 28: JUDCon 2011 - Box Grinder

Saturday, 4 June 2011

Page 29: JUDCon 2011 - Box Grinder

BoxGrinder  Build  architecture

Saturday, 4 June 2011

Page 30: JUDCon 2011 - Box Grinder

Simple Definition RAW EC2

VMwareBuild Convert Deliver

PluginsSFTP

CloudFront

AMI

Operating system Platform Delivery

Saturday, 4 June 2011

Page 31: JUDCon 2011 - Box Grinder

Simple Definition RAW EC2

VMwareBuild Convert Deliver

PluginsSFTP

CloudFront

AMI

Write  your  own  plugins,  it’s  easy!http://boxgrinder.org/tutorials/how-­to-­write-­a-­plugin-­for-­boxgrinder-­build/

Operating system Platform Delivery

Saturday, 4 June 2011

Page 32: JUDCon 2011 - Box Grinder

Plugin  skeleton

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

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

Saturday, 4 June 2011

Page 33: JUDCon 2011 - Box Grinder

Plugin  registration

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

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

Saturday, 4 June 2011

Page 34: JUDCon 2011 - Box Grinder

How  to  install  BoxGrinder  Build

Saturday, 4 June 2011

Page 35: JUDCon 2011 - Box Grinder

Saturday, 4 June 2011

Page 36: JUDCon 2011 - Box Grinder

yum  install  rubygem-­boxgrinder-­build

Saturday, 4 June 2011

Page 37: JUDCon 2011 - Box Grinder

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://boxgrinder.org/download/boxgrinder-­build-­meta-­appliance/

Saturday, 4 June 2011

Page 38: JUDCon 2011 - Box Grinder

Demo:  build  a  simple  appliance

Saturday, 4 June 2011

Page 39: JUDCon 2011 - Box Grinder

Demo:  build  a  simple  applianceconvert  and  deliver

Saturday, 4 June 2011

Page 40: JUDCon 2011 - Box Grinder

Demo  setup  and  plan

Saturday, 4 June 2011

Page 41: JUDCon 2011 - Box Grinder

Simple Definition RAW EC2

VMwareBuild Convert Deliver

PluginsSFTP

CloudFront

AMI

Step  1:  create  base  image

boxgrinder-­build  f14-­jeos.appl

Saturday, 4 June 2011

Page 42: JUDCon 2011 - Box Grinder

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...

Saturday, 4 June 2011

Page 43: JUDCon 2011 - Box Grinder

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...

Saturday, 4 June 2011

Page 44: JUDCon 2011 - Box Grinder

Of  course  you  can  run  the  command  just  once  with  same  result!

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

Saturday, 4 June 2011

Page 45: JUDCon 2011 - Box Grinder

What’s  hot?

Saturday, 4 June 2011

Page 46: JUDCon 2011 - Box Grinder

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

• Many  public  clouds  supported:  EC2,  ElasticHosts,  Serverlove,  Open  Hosting,  SKALI  Cloud,  CloudSigma

Saturday, 4 June 2011

Page 47: JUDCon 2011 - Box Grinder

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:  20  minutes  (on  EC2,  using  meta-­appliance)

Saturday, 4 June 2011

Page 48: JUDCon 2011 - Box Grinder

Notes

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

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

Saturday, 4 June 2011

Page 49: JUDCon 2011 - Box Grinder

Questions?

http://github.com/boxgrinder/http://boxgrinder.org/http://boxgrinder.org/blog/

IRC:  #boxgrinder

@boxgrinder@marekgoldmann

Saturday, 4 June 2011

Page 50: JUDCon 2011 - Box Grinder

Thanks!

Saturday, 4 June 2011