Permalink
Browse files

Add a little bit of documentation about the deployment feature

  • Loading branch information...
1 parent 8c8b035 commit ffe710e87de7ba44656d3c1be31e8c0fabdab34b @priteau committed Apr 21, 2010
Showing with 41 additions and 0 deletions.
  1. +41 −0 README.md
View
@@ -1,6 +1,47 @@
# Gosen
Gosen is a Ruby library for the [Grid'5000 RESTful API](https://api.grid5000.fr/).
+It relies on the [Restfully library](http://github.com/crohr/restfully) for interacting with the API.
+
+## Features
+
+Currently, it allows to submit deployments that retry automatically when too many nodes failed, similarly to [Katapult](http://www.loria.fr/~lnussbau/katapult.html).
+
+## Installation
+
+ $ gem install gosen
+
+## Usage
+
+The following example deploys the latest version of the Lenny-x64-big environment on the paramount-1 and paramount-2 nodes.
+If both nodes are not successfully deployed, Gosen retries again (in this case, at most 5 deployment are submitted).
+
+ #!/usr/bin/env ruby
+
+ require 'gosen'
+ require 'logger'
+ require 'restfully'
+
+ logger = Logger.new(STDOUT)
+
+ Restfully::Session.new(:configuration_file => '~/.grid5000') do |grid, session|
+ site = grid.sites[:rennes]
+ nodes = [ 'paramount-1.rennes.grid5000.fr', 'paramount-2.rennes.grid5000.fr' ]
+ deployment = Gosen::Deployment.new(site, 'lenny-x64-big', nodes,
+ {
+ :logger => logger,
+ :max_deploy_runs => 5,
+ :min_deployed_nodes => nodes.length,
+ :ssh_public_key => File.read(File.expand_path('~/.ssh/authorized_keys'))
+ })
+ deployment.join
+ end
+
+The logger allows to print information about the deployment, in a style similar to Katapult:
+
+ I, [2010-04-21T11:31:09.351803 #21673] INFO -- : Kadeploy run 1 with 2 nodes (0 already deployed, need 2 more)
+ I, [2010-04-21T11:37:11.817323 #21673] INFO -- : Nodes deployed: paramount-1.rennes.grid5000.fr paramount-2.rennes.grid5000.fr
+ I, [2010-04-21T11:37:11.817440 #21673] INFO -- : Had to run 1 kadeploy runs, deployed 2 nodes
## Note on Patches/Pull Requests

0 comments on commit ffe710e

Please sign in to comment.