Skip to content
cloudedge edited this page Jul 29, 2012 · 66 revisions

Dev tool development and build for Crowbar.ISO - for developers

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

This page documents how to use the dev tool to build the Crowbar ISO. For more detailed documentation specifically on how to use the tool for regular development, see README.dev-and-workflow in the main crowbar git repository.

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

note: use sudo as instructed. Do not use the Dev tool as root!

  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. sudo 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. sudo ln -s /usr/share/debootstrap/scripts/gutsy /usr/share/debootstrap/scripts/precise
      1. 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
    6. ./dev switch development
      1. you can see all the releases with ./dev releases
      2. choices trunk (default, trunk), 1.2 = fledermaus, 1.3 Cloudera = elefante
    7. ./dev checkout openstack-os-build
      1. you can see all the branches with git branch -a
      2. choices are master (default, trunk), openstack-os-build (OpenStack), cloudera-os-build (Hadoop)
      3. different branches represent different "distros" which combine different sets of barclamps (e.g. openstack, hadoop)
    8. ./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.

Clone this wiki locally