You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by Jeremy Bar <je...@nimbula.com> on 2011/07/14 19:50:15 UTC

Re: Need information on process to add new driver

Thank you for the information Marios.

I am wondering why some drivers have a *_client.rb file, while some others
don't, for example:

./rackspace
./rackspace/rackspace_driver.rb
./rimuhosting
./rimuhosting/rimuhosting_driver.rb
./rimuhosting/rimuhosting_client.rb

The Rackspace driver doesn't have the _client.rb file whereas Rimuhosting
has it.

-- 
*jeremy bar*
systems engineer | nimbula, inc.
cell: +1 650 215 0010 | desk: +1 650 257 1300 ext. 7011

On Sat, Jun 4, 2011 at 10:07 AM, marios@redhat.com <ma...@redhat.com>wrote:

> Hi Jeremy,
>
> there's info on which methods drivers are expected to implement here:
> http://incubator.apache.org/**deltacloud/framework.html<http://incubator.apache.org/deltacloud/framework.html>
>
> The existing drivers live in /path/to/deltacloud/server/**lib/deltacloud/drivers
> - looking at those would be a good way to start. You need to decide which
> 'collections' the provider for which you're writing the driver supports -
> e.g. images, instances, keys, buckets/blobs (storage) etc and declare this
> like:
>
>
> def supported_collections
>          DEFAULT_COLLECTIONS + [ :keys, :buckets, :load_balancers,
> :addresses ]
> end
>
> again, looking at any of the existing drivers will help. Please continue to
> ask questions here or alternatively join us on irc channel #deltacloud
> (freenode). Once you have a driver you can submit a patch to this list for
> review and once any issues are worked out one of the committers will push
> the code into the apache repo,
>
> all the best, marios
>
>
>
> On 03/06/11 21:58, Jeremy Bar wrote:
>
>> I am currently trying to understand how to add a new driver, is there
>> documentation on the iterative development process?
>>
>> I have a delta cloud server up and running, but I don't know where to
>> add/change the source ruby files for a new driver.
>>
>> I didn't find anything on this topic here:
>> http://incubator.apache.org/**deltacloud/documentation.html<http://incubator.apache.org/deltacloud/documentation.html>
>>
>> Thank you,
>>
>
>

Re: Need information on process to add new driver

Posted by David Lutterkort <lu...@redhat.com>.
On Thu, 2011-07-14 at 14:43 -0700, Jeremy Bar wrote:
> So if I understand correctly, the _client file contains callbacks for the
> target cloud API?  Do you have documentation for this file?

The split between xyz_client.rb and xyz_driver.rb is entirely in the
discretion of the driver author - there's nothing in the framework that
mandates such a split. It simply comes down to taste ;)

> Do you have more detailed documentation than what is present at
> http://incubator.apache.org/deltacloud/framework.html?  That would a great
> help understanding the development workflow of the driver...  I have
> currently set up a server running the mock driver.  Also, how do
> I exercise my driver to test things are working correctly?

To add a driver for a hypothetical foo cloud, just add the driver as
file server/lib/deltacloud/drivers/foo/foo_driver.rb

That file needs to define a class Deltacloud::Drivers::Foo::FooDriver

Also, drop a file config/drivers/foo.yaml withe th following content:

        ---
        :foo:
          :name: Foo
        
You can then start 'deltacloudd -i foo' to use your server FooDriver by
default.

In terms of internal API, it's best to follow the examples of the
MockDriver and other drivers - there's a good amount of introspection
going on. For example, if your driver does not have a 'images' method,
the images collection won't show up in the API.

I would start with implementing the 'instances' method to get a list of
existing instances, and then move on to lifecycle operations
(stop/destroy/reboot etc), then implement 'images', and then
create_instance to be able to launch instances.

David

        


Re: Need information on process to add new driver

Posted by Jeremy Bar <je...@nimbula.com>.
On Thu, Jul 14, 2011 at 10:55 AM, Michal Fojtik <mf...@redhat.com> wrote:

> On Jul 14, 2011, at 7:50 PM, Jeremy Bar wrote:
>
> > Thank you for the information Marios.
> >
> > I am wondering why some drivers have a *_client.rb file, while some
> others
> > don't, for example:
> >
> > ./rackspace
> > ./rackspace/rackspace_driver.rb
> > ./rimuhosting
> > ./rimuhosting/rimuhosting_driver.rb
> > ./rimuhosting/rimuhosting_client.rb
> >
> > The Rackspace driver doesn't have the _client.rb file whereas Rimuhosting
> > has it.
>
> The reason is that for some drivers we're using 'external' gems, like
> 'cloudfiles' for Rackspace.
> Thus they don't need the _client file.
>

So if I understand correctly, the _client file contains callbacks for the
target cloud API?  Do you have documentation for this file?

Do you have more detailed documentation than what is present at
http://incubator.apache.org/deltacloud/framework.html?  That would a great
help understanding the development workflow of the driver...  I have
currently set up a server running the mock driver.  Also, how do
I exercise my driver to test things are working correctly?

Thank you,
Jeremy

Re: Need information on process to add new driver

Posted by Michal Fojtik <mf...@redhat.com>.
On Jul 14, 2011, at 7:50 PM, Jeremy Bar wrote:

> Thank you for the information Marios.
> 
> I am wondering why some drivers have a *_client.rb file, while some others
> don't, for example:
> 
> ./rackspace
> ./rackspace/rackspace_driver.rb
> ./rimuhosting
> ./rimuhosting/rimuhosting_driver.rb
> ./rimuhosting/rimuhosting_client.rb
> 
> The Rackspace driver doesn't have the _client.rb file whereas Rimuhosting
> has it.

The reason is that for some drivers we're using 'external' gems, like 'cloudfiles' for Rackspace.
Thus they don't need the _client file.

  -- Michal

> 
> -- 
> *jeremy bar*
> systems engineer | nimbula, inc.
> cell: +1 650 215 0010 | desk: +1 650 257 1300 ext. 7011
> 
> On Sat, Jun 4, 2011 at 10:07 AM, marios@redhat.com <ma...@redhat.com>wrote:
> 
>> Hi Jeremy,
>> 
>> there's info on which methods drivers are expected to implement here:
>> http://incubator.apache.org/**deltacloud/framework.html<http://incubator.apache.org/deltacloud/framework.html>
>> 
>> The existing drivers live in /path/to/deltacloud/server/**lib/deltacloud/drivers
>> - looking at those would be a good way to start. You need to decide which
>> 'collections' the provider for which you're writing the driver supports -
>> e.g. images, instances, keys, buckets/blobs (storage) etc and declare this
>> like:
>> 
>> 
>> def supported_collections
>>         DEFAULT_COLLECTIONS + [ :keys, :buckets, :load_balancers,
>> :addresses ]
>> end
>> 
>> again, looking at any of the existing drivers will help. Please continue to
>> ask questions here or alternatively join us on irc channel #deltacloud
>> (freenode). Once you have a driver you can submit a patch to this list for
>> review and once any issues are worked out one of the committers will push
>> the code into the apache repo,
>> 
>> all the best, marios
>> 
>> 
>> 
>> On 03/06/11 21:58, Jeremy Bar wrote:
>> 
>>> I am currently trying to understand how to add a new driver, is there
>>> documentation on the iterative development process?
>>> 
>>> I have a delta cloud server up and running, but I don't know where to
>>> add/change the source ruby files for a new driver.
>>> 
>>> I didn't find anything on this topic here:
>>> http://incubator.apache.org/**deltacloud/documentation.html<http://incubator.apache.org/deltacloud/documentation.html>
>>> 
>>> Thank you,
>>> 
>> 
>> 

----------------------------------------------------------------------
Michal Fojtik, Senior Software Engineer, Red Hat Czech
mfojtik@redhat.com
Deltacloud API: http://deltacloud.org