Skip to content
aspiers edited this page May 14, 2012 · 66 revisions

The Crowbar Dev Tool is a git overlay that helps manage Crowbar releases, barclamp integration, and gated checkins to the Crowbar source base.

If you are planning to write code for Crowbar core or develop a barclamp, we highly recommend you follow the following steps to create your build server. If you are NOT planning to edit Crowbar then follow the read-only Build-Crowbar.ISO instructions.

Tip: Want to watch it on video? http://youtu.be/fWtEk1rPnHY

Pre-requisites:

  • A GitHub account (https://github.com/). They are free for personal open source use.
  • A 40GB Ubuntu 11.10 server (VM is ok) is recommended for this process!
  • It is important to use the dev tool for managing branches & releases because it:
    • takes care of synchronization with all the barclamp submodules
    • builds nested tags with the release information
  • A copy of CentOS 6.2 install DVD from bittorrent or your favortie CentOS mirror.
    • This install DVD will need to go in $ISO_LIBRARY (usually $HOME/.crowbar-build-cache/iso) or can be accessed using a host share
  • A copy of your target Crowbar OS.
    • This page uses Ubuntu 12.04 server x64 iso as the example
  • sudo ln -s /usr/share/debootstrap/scripts/gutsy /usr/share/debootstrap/scripts/precise
    • note: This is required only if: You're building for 12.04 on a 11.04 or 11.10 machine, since those versions don't know how to build Precise
  • sudo sed -ie "s/%admin ALL=(ALL) ALL/%admin ALL=(ALL) NOPASSWD: ALL/g" /etc/sudoers
    • note: this will allow passwordless sudo for users in the admin group. The build process performs some high level kung-foo, some of which requires root access. if running as non-root, you'll be prompted for password unless you setup Passwordless SUDO permissions for your user. Alternatively run the build as root.

Build Steps:

  1. make sure that your build server's public key is registered with your Github account
  2. sudo apt-get update
  3. sudo apt-get install git rpm ruby rubygems1.8 curl build-essential debootstrap mkisofs binutils
  4. gem install json
  5. git clone https://github.com/dellcloudedge/crowbar.git
    1. dev tool expects you to have a github account! If you want read only, use the Build-Crowbar.ISO instructions.
  6. in the ~/crowbar directory
    1. ./dev setup
      1. You can ignore warnings: "ulimit: open files: cannot modify limit: Invalid argument"
      2. this will create personal github forks for you of all the Crowbar modules.
    2. optional, if this is a new system, set your user information as directed
      1. git config --global user.name "Your Name"
      2. git config --global user.email [email protected]
    3. ./dev fetch
    4. ./build_sledgehammer.sh
      1. this builds the "discovery image" called Sledgehammer.
      2. It does not change often and does not need to be repeated once it has been built.
    5. ./dev switch essex-hack
      1. you can see all the releases with ./dev releases
      2. default is development
    6. ./dev checkout openstack-os-build
      1. you can see all the branches with git branch -a
      2. default is master
      3. different branches represent different "distros" which combine different sets of barclamps (e.g. openstack, hadoop)
    7. ./dev build --os ubuntu-12.04 --update-cache
      1. The parameter --update-cache will create your Build Cache at this time, thus the first run will download from the internet what it needs. This takes time and can be skipped for later builds. Dev Tool will tell you if your cache is need to be updated
      2. you can add --release development --branch master if you did not switch or checkout

Special Notes for Using a Build VM

If you are using VMware Worktation (or similar) then these extra tips will help you improve your build experience

Tips:

  • VMware tools are not working on Ubuntu 12.04 at this time (5.5.2012) so use 11.10
  • To save space on your VM, you can use ISOs that are local to your host
    • create a shared file location (e.g.: c:\isos) mounted to "isos"
    • vi ~/.build-crowbar.conf
    • add a reference to "ISO_LIBRARY=/mnt/hgfs/isos"
  • To make it easier to build VMs from the build ISO, have the build save it directory to your host's drive
    • create a shared file location (e.g.: c:\temp\crowbar) mounted to "crowbar"
    • vi ~/.build-crowbar.conf
    • add a reference to "ISO_DEST=/mnt/hgfs/crowbar"

Building Barclamp TARs only

If you only want barclamps for import (Utils\Import) then you should use the "--no-iso" flag with the build command. Note that you must still provide an operating system!

You can find the tars in ~/.crowbar-build-cache/ubuntu-12.04/build/dell/barclamps where the OS will match the one that you choose to target.

See Packaging-Barclamps about building individual barclamps.

Coding Steps

We recommend you consult the ./dev command line help, and also README.dev-and-workflow in the crowbar repository.

  1. ./dev backup
    1. makes a copy into your personal forks (if you did not have any, you do now!)
  2. ./dev sync
  3. commit your code
    1. git add
    2. git commit
  4. ./dev is_clean
  5. ./dev pull-requests-prep
    1. it will give you instructions on next steps to automatically submit a push request on ALL impacted barclamps

Build your cache

A Crowbar build contains the packages (e.g. deb,rpm,gem etc) that will be used to install your cloud. To avoid having to download the Internet on every build, the Crowbar build system maintains a local cache in ~/.crowbar-build-cache by default. Additionally, Crowbar utilizes a customized LiveCD image, SledgeHammer. You can build that too (sources on github), but it changes very infrequently - so you're better of snatching it from somewhere.

Altenate to building Sledgehammer

  1. get Sledgehammer
  2. mkdir ~/.crowbar-build-cache
  3. cd ~/.crowbar-build-cache
  4. wget http://crowbar.zehicle.com/sledgehammer-tftpboot.tar.gz
  5. tar -xzvf sledgehammer-tftpboot.tar.gz
Clone this wiki locally