Opscode
Home     Introduction to Chef     Cookbooks     Blog     GitHub     Tickets 

Installing Chef from HEAD

compared with
Current by Daniel DeLeo
on Aug 11, 2010 00:04.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (47)

View page history
This document is focused on users who wish to get the latest development version of Chef installed for testing, or for the latest and greatest features that haven't been [officially released|Release Notes] yet. Developers who wish to [contribute|opscode:Contributing] to the project are encouraged to read the README.rdoc in the [http://github.com/opscode/chef/tree/master|GitHub repository].
{section}
{column:width=70%}
 
This document is focused on users who wish to get the latest development version of Chef installed for testing and development, or for the latest and greatest features that haven't been [officially released|Release Notes] yet. Developers who wish to [contribute|chef:How To Contribute] to the project are encouraged to read the README.rdoc in the [GitHub repository|http://github.com/opscode/chef].

Each released version of Chef is tagged in the Git Repository. You can work with a previous version's code by checking out the tag.
{tip:title=Version Numbering Style}
Note we follow Linux kernel-style versioning. If the patch-level version is odd, its a 'dev' release, as installing from HEAD is certainly 'dev'.
{tip}
{column}
{column:width=30%}
{panel:title=Table of Contents}
{toc:minLevel=1|maxLevel=2}
{panel}
{column}
{section}
h1. Requirements
First, you'll want to designate a system for deployment. This is the place where you'll clone the repository and create the gems. It can be your local workstation, or it can be the [Chef Server].
First, you'll want to designate a system for development and deployment. This is the place where you'll clone the repository and create the gems. It can be your local workstation, or it can be the [Chef Server] itself. You'll probably want to follow along with the "Preparing for RubyGems" installation documents on the main [Installation] page.

* Git - the source is on GitHub, so you'll need to have Git installed for your platform.
* RubyGems - we have Rake tasks for generating and installing the gems, and these instructions should work anywhere with RubyGems. We recommend installing RubyGems from source.
* Rake - we like Rake, and use it liberally, install the {{rake}} gem.
* RSpec - we do specs in rspec, install the {{rspec}} gem.
* Cucumber - we do feature tests with cucumber, install the {{cucumber}} gem.
* Gemcutter and Jeweler - we use jeweler for gemspec generation and may want to push to gemcutter, install these gems.
 
When installing the gems that are built from these instructions and using the [Bootstrap Chef RubyGems Installation] on [Chef Server] or [Chef Client] systems, other dependencies are handled as well such as CouchDB, RabbitMQ and Java. You can also install the these for a [Chef Server manually|Manual Chef Server Configuration].
{note:title=Ubuntu {tip:title=Ubuntu Git Package}
Ubuntu's git package to actually get usable git binaries installed is 'git-core', not 'git'.
{note} {tip}

{tip:title=Don't need RDoc and Ri?}
{tip}
{code:bash|linenos=false|title=Install RubyGem Development Requirements}
sudo gem install rspec rake cucumber jeweler gemcutter
{code}
Some other gems are required to build the gems, but are automatically installed when we use {{rake install}} [#Installing the Gems|below]. If you want to have them available first:

{code:bash|linenos=false|title=Install Additional Gem Building Requirements}
gem install merb-core merb-slices merb-assets merb-helpers merb-haml moneta bunny uuidtools
{code}
h1. Git Repositories
Clone the {{ohai}} and {{chef}} repositories fresh from github. If you want the latest and greatest from Chef, you probably want the same from Ohai. If you're not *that* bleeding edge, skip You'll also need the Opscode mixlibs which are used in Chef and Ohai.

{code:bash|linenos=false|title=Clone Git Repositories}
cd ~
git clone git://github.com/opscode/ohai.git
git clone git://github.com/opscode/chef.git
git clone git://github.com/opscode/mixlib-authentication.git
git clone git://github.com/opscode/mixlib-config.git
git clone git://github.com/opscode/mixlib-log.git
git clone git://github.com/opscode/mixlib-cli.git
git clone git://github.com/opscode/chef.git
{code}
h1. Install Ohai
h1. Installing the Gems
 
The install task for Ohai will build and install the Gem.
We're going to install the gems from the repositories checked out above. Each of these has gem dependencies that build on each other. This is the order which you should install the gems.
 
{code:bash|linenos=false|title=Install Ohai}
cd ~/ohai
rake install
{code}
In each rake install, the respective gem was generated. We recommend setting up an internal RubyGems server in your environment to host the development gems, so you don't have to copy them manually to client systems for testing. Opscode provides a [gems::server recipe|http://github.com/opscode/cookbooks/tree/master/gems/recipes/server.rb] that will help you set up a RubyGems server.
 
h1. Install mixlib
h2. Install mixlibs
 
You can either install the gems from a local git repository (documented below) or simply install the gems from the opscode repository if you don't plan on working on the mixlib components.
Ohai and Chef use some "mixin" libraries that Opscode wrote. We need to install these first or the Ohai and Chef gems will fail to build.

{code:bash|linenos=false|title=Install mixlib components}
cd ~/mixlib-config
#!/bin/sh
for mixlib in config cli log authentication
do
pushd mixlib-$mixlib
rake install
cd ~/mixlib-log
rake install
cd ~/mixlib-cli
rake install
popd
done
{code}
h1. Install Server
h2. Install Ohai
 
On a chef-server, you should install chef, chef-server and chef-server-slice all at once:
Ohai needs to be installed as well so the Chef gems can be built.
 
{code:bash|linenos=false|title=Install chef-server} Ohai}
cd ~/chef ~/ohai
sudo gem install merb-core
rake install
{code}
Due to bug [CHEF-166|http://tickets.opscode.com/browse/CHEF-166], the merb-core dependency isn't picked up correctly, so it needs to be installed separately.
h1. Install Client
 
h1. Install Clients
For a chef-client, just install the {{chef}} gem, it provides the binaries and code needed to run Chef.
 
For a chef-client, just install the 'client' gem.
{code:bash|linenos=false|title=Install Chef}
cd ~/chef/chef
{code}
h1. Install Server

If you are not using a RubyGems server, you'll want to install the Chef Server gems.

{code:bash|linenos=false|title=Install Chef Server}
cd ~/chef
rake install
{code}
h1. Configure Chef
Head back to the [Installation] page for [configuring the server|Installation#Install Chef Server] and [configuring clients|Installation#Configure Chef Clients].
The [Bootstrap Chef RubyGems Installation] procedures can be used to get the server configured. If you're planning to run systems on the development version, we strongly recommend a RubyGems server with Chef and all the dependencies available to ease this process. Or, if you're using Amazon EC2, build an AMI with the gems installed.

Copyright © 2009 Opscode, Inc. All Rights Reserved.