Help make Deltacloud better

All development of Deltacloud takes place in the open. Communication is run through the mailing list and all source code changes are tracked publicly.

Getting the sources

The Deltacloud project consists of two parts: Core and Aggregator. Core gives you the API and drivers to various cloud providers. It also provides a client library (which Aggregator uses) and a commandline interface.

Aggregator is a web system that uses the API to manage all your cloud assests. It depends on Condor for its task implementation system.

In addition, we use the docs repository that contains the project documentation and the sources of the http://deltacloud.org website.

The Deltacloud Core repository is hosted on Apache Incubator. Apache uses Subversion, but there is a git mirror available:

$ mkdir deltacloud
$ cd deltacloud
$ git clone git://git.apache.org/deltacloud.git core

You can find the Subversion repository at: https://svn.apache.org/repos/asf/incubator/deltacloud.

To get Aggregator and Docs:

$ git clone --branch next git://git.fedorahosted.org/git/deltacloud/aggregator.git/
$ git clone --branch next git://git.fedorahosted.org/git/deltacloud/docs.git/

Note that the development of the Docs and Aggregator takes place on the next branch, which contains the latest version of the code.

If your git doesn't support the --branch option, do this instead:

$ git clone git://git.fedorahosted.org/git/deltacloud/aggregator.git/
$ cd aggregator
$ git checkout -t -b next origin/next

To get the stable version, don't switch to the next branch at all.

Required packages

In order to make the Deltacloud components work, you'll need to have the following packages installed (on Fedora 12; the names may vary on your distro):

ruby
ruby-devel
gcc-c++
libxml2-devel
libxslt-devel
rubygem-rails
rubygem-gettext_rails
rubygem-sqlite3-ruby

Note: these packages are necessary for building all the required ruby gems that Deltacloud requires. If you want to install the gems using your system's package manager (yum, apt, ports, etc.) you won't need to install these packages manually.

We recommend using Rails version 2.3.4 or 2.3.5 (default in Fedora 12). Older or newer versions may not be compatible at the moment.

Installing the Deltacloud Core

First, you need to install the server that will give you the Deltacloud API:

$ cd path/to/deltacloud/core/server
$ rake package
$ sudo gem install pkg/deltacloud-core-<version>.gem

Then install the client library:

$ cd path/to/deltacloud/core/client
$ rake package
$ sudo gem install pkg/deltacloud-client-<version>.gem

Once you have the client installed, run the following command:

$ cd path/to/deltacloud/core/client
$ rake fixtures

Setting up the Aggregator

The easiest way to get Deltacloud up and running is to use SQLite as the database backend:

$ cd aggregator/src
$ cp config/database.sqlite config/database.yml

Note: you can update the paths in the "database.yml" file to change the location of the *.sqlite3 database files.

This command installs all the missing ruby gems:

# rake gems:install

You can run rake gems to list all the required gems.

And this sets the database up:

$ rake db:create:all
$ rake db:migrate

Setting up Condor

In the next branch, the Deltacloud Aggregator now uses condor as a task system. Condor is used to decide where a new instance is started and takes care of actually starting that instance among other tasks. At this time support for Deltacloud is provided in a custom build of Condor, this is available at:

http://people.redhat.com/clalance/condor-dcloud/

We hope to get our enhancements to condor integrated upstream, but in the meantime, the source can be found here:

http://github.com/clalancette/condor-dcloud

The easiest way to install is to use one of the following commands:

For x86_64 architectures:

$ yum localinstall http://people.redhat.com/clalance/condor-dcloud/7.5.2-4dcloud/f13/condor-7.5.2-4dcloud.fc13.x86_64.rpm \
  http://people.redhat.com/clalance/libdeltacloud/0.3.0/f13/libdeltacloud-0.3-1.fc13.x86_64.rpm --nogpgcheck

For i386 architectures:

$ yum localinstall http://people.redhat.com/clalance/condor-dcloud/7.5.2-4dcloud/f13/condor-7.5.2-4dcloud.fc13.i386.rpm \
  http://people.redhat.com/clalance/libdeltacloud/0.3.0/f13/libdeltacloud-0.3-1.fc13.i386.rpm --nogpgcheck

Note that new versions may become available and you should check the site for the latest version.

Once those are installed, you will also want to download:

http://people.redhat.com/clalance/condor-dcloud/condor_config.local

And place this file in /var/lib/condor/condor_config.local. The only configuration variable you will have to change is the CONDOR_HOST, which should be set to your local host name. If you are concerned about security, the ALLOW_HOSTS variable can also be set to your machines host name.

At this time you should restart Condor:

$ sudo service condor restart

Note that if you restart Condor, you should also restart the aggregator in order to populate Condor with the available backend cloud information.

For more information on Condor see the README at:

http://people.redhat.com/clalance/condor-dcloud/README

Tying it all together

Note: some distributions don't add the directory with the gem executables in your PATH environment. If that is the case, add the directory manually:

$ export PATH=$PATH:/var/lib/gems/<version>/bin

Run the Core server with the mock driver:

$ deltacloudd -i mock

Now if you go to http://localhost:3001/ you should be able to see a page documenting the API. If you add the ".xml" extension to any page, you will see the API in action.

The mock driver simulates the API behavior without making you to connect to a real cloud provider. For a guide to connecting Deltacloud to a provider, go to the Drivers section of the Documentation.

Make sure that the src/db and src/log directories are owned by the user who will be running the Aggregator. Note that you can change their location in the config/database.yml file.

Run the Aggregator:

$ cd path/to/deltacloud/aggregator/src
$ ./script/server

In your web browser go to http://localhost:3000 and create a new user.

To experience the full functionality, you should have one user with admin privileges. Run the following command in your deltacloud/aggregator/src directory (put the name of your Aggregator user in the brackets):

$ rake dc:site_admin[aggregator_username]