xp5k 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODk0OGNhZDYyNmE4OGIwNTdjYTlhYjYxNzZjN2Q1YmY3ZGZiNjFmMA==
4
+ MTY5MDQ3MTllYzcxZjVmZGQyMjcxYzBhNzdiNmQ2MTJhNjQ0YjA5ZQ==
5
5
  data.tar.gz: !binary |-
6
- YzY0YTc1OTk0NTAzMzE4ZTU4ODI0M2VmMTc4ODZiMGU2NDJlMTFmMw==
6
+ MWQ2ZjBkZWU3MjI0OTMxZDUwOGRjYjViNjlkYTY4NjQ2ZDUwMTk1OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjkwZjViNDRkODllMjIyNmMxMmFlMDJiZmU5YTgyNzU0ODgxZTI3NDY4YTJk
10
- M2VhZWM4N2JlMGZhN2E5NzU0ZGNkZDk0Zjk2Zjg1MmIwNWVhMzQ0YWM3NWNm
11
- MjBkZmY1ZTdlY2IzYzJlZTMwMTdiODk4Y2ExOTYwYjVhMTBiYjM=
9
+ NDkwMDgwOTlkN2QzYWYxYjYxNzFkZTJhMWJhYjQ5M2M2Mjk3OGU1YTU3NjAz
10
+ MzlmMTMzNzMxNmNlZjJlMGVkNzM3MzA0NGQyY2QxYTcwNTJmY2ZmZjQ1N2Ez
11
+ YzU0NGM2Nzc2YzA5YzBjNTI0ZDg5Yzc0MDBiOWNkZGFkZGQwYmI=
12
12
  data.tar.gz: !binary |-
13
- YTEzYjBiYWJjMGQ4YzA1ZjhhYTgyNTY2NjI0MjgwZmFhYzg2ODlmMjI5YmM2
14
- NThmYjg5MjQ2NWY5MWEzZjgwYmZiYTI5OTJlM2QwYTY2ZDJiODkzZGFlMWI0
15
- NzRlMzE0YzEyNjg3M2FiMzIxYzUxZDBkOGUyZDVkZjU5YjBjMjg=
13
+ OTMzOWE0N2I5MTZhMmYzNDE5YzFiMTllNWJmMzA1YWRiM2I3YjQ1ZmFiOTI3
14
+ NjUwMDIzZTkzODQ4YzY0ODQwNWNkODM1MzQxY2NmMzQxMDNhZTRiMmM5NjVl
15
+ NGE3MDNiZmI4MDdiNDUzNzg0Y2Q5NDFiMmQ2OWQ4MzQ2ZjY3YzI=
data/README.md CHANGED
@@ -1,8 +1,38 @@
1
- ## Installation
1
+ #### Table of Contents
2
+
3
+ 1. [Getting started](#Getting started)
4
+ * [Gemfile](#Gemfile)
5
+ * [Restfully](#Restfully)
6
+ * [Ssh config](#Ssh config)
7
+ 2. [Samples](#Samples)
8
+ * [Hello date](#Hello date)
9
+ * [Xp5k Roles](#Xp5k Roles)
10
+ * [Nested roels](#Nested roles)
11
+ * [Patterns](#Patterns)
12
+ * [Get the deployed nodes](#Get the deployed nodes)
13
+ * [Automatic redeployment](#Automatic redeployment)
14
+ * [Vlan support](#Vlan support)
15
+ * [Non deploy jobs](#Non deploy jobs)
16
+
17
+ # Getting started
18
+
19
+ A typical project architecture using ```xp5k``` and ```capistrano``` looks like :
20
+
21
+ ```bash
22
+ .
23
+ ├── Capfile # deployment logic
24
+ ├── Gemfile # gem dependencies description
25
+ ├── LICENSE # License of utilization
26
+ └── README.md # How to
27
+ ```
28
+
29
+ ## Gemfile
2
30
 
3
31
  Add this to your application Gemfile:
4
32
 
5
33
  ```ruby
34
+ source "http://rubygems.org"
35
+
6
36
  gem "xp5k"
7
37
  gem "capistrano", "< 3.0.0"
8
38
  ```
@@ -13,8 +43,15 @@ and then run
13
43
  bundle install
14
44
  ```
15
45
 
16
- Configure restfully :
46
+ Note : We encourage you to use [```xpm```](http://rvm.io/)
17
47
 
48
+
49
+ ## Restfully
50
+
51
+ ```xp5k``` makes use of ```restfully``` to perform REST calls to the
52
+ [Grid'5000API](https://api.grid5000.fr).
53
+
54
+ Fill the ```~/.restfully/api.grid5000.fr.yml``` file with your credentials :
18
55
  ```bash
19
56
  $) cat ~/.restfully/api.grid5000.fr.yml
20
57
  base_uri: https://api.grid5000.fr/3.0
@@ -27,7 +64,14 @@ You are now ready to use ```xp5k``` and ```capistrano```.
27
64
  You will find the documentation of capistrano in the following link :
28
65
  https://github.com/capistrano/capistrano/wiki
29
66
 
30
- ## Sample
67
+ ## Ssh config
68
+
69
+ You can have a look at https://www.grid5000.fr/mediawiki/index.php/Xp5k
70
+
71
+ # Samples
72
+
73
+
74
+ ## Hello date
31
75
 
32
76
  Here is an example of a ```Capfile``` :
33
77
 
@@ -110,9 +154,7 @@ cap submit # Submit jobs
110
154
 
111
155
  For instance you can launch : ```cap submit deploy date```
112
156
 
113
- ## Extra features
114
-
115
- ### Xp5k Roles
157
+ ## Xp5k Roles
116
158
 
117
159
  You can define specific roles in you job submission.
118
160
 
@@ -158,7 +200,7 @@ role :server do
158
200
  end
159
201
  ```
160
202
 
161
- #### Nested roles
203
+ ## Nested roles
162
204
 
163
205
  You can also define nested roles (only 1 level) :
164
206
 
@@ -177,7 +219,7 @@ You can also define nested roles (only 1 level) :
177
219
 
178
220
  ```
179
221
 
180
- #### Pattern
222
+ ## Patterns
181
223
 
182
224
  You can select nodes matching a pattern (`String` or `Regexp`) :
183
225
 
@@ -197,7 +239,7 @@ scenario['clusters'].each do |cluster|
197
239
  end
198
240
  ```
199
241
 
200
- ### Get the deployed nodes
242
+ ## Get the deployed nodes
201
243
 
202
244
  Some time nodes fail to be deployed. You can get the exact set
203
245
  of nodes deployed in your xp5k job or role using the ```get_deployed_nodes```
@@ -209,7 +251,7 @@ role :clients do
209
251
  end
210
252
  ```
211
253
 
212
- ### Automatic redeployment
254
+ ## Automatic redeployment
213
255
 
214
256
  If some nodes fail to be deployed, ```xp5k``` will by default
215
257
  retry to deploy them up to 3 times.
@@ -227,3 +269,49 @@ You can control this behaviour passing special keys in the deployment hash.
227
269
  # can be a percentage : "80%"
228
270
  })
229
271
  ```
272
+
273
+ ## Vlan support
274
+
275
+ ```ruby
276
+ @myxp.define_job({
277
+ :resources => "{type='kavlan'}/vlan=1,nodes=2,walltime=1",
278
+ :site => XP5K::Config['site'],
279
+ :queue => XP5K::Config[:queue] || 'default',
280
+ :types => ["deploy"],
281
+ :name => "xp5k_vlan",
282
+ :command => "sleep 186400"
283
+ })
284
+ ```
285
+
286
+ ```ruby
287
+ @myxp.define_deployment({
288
+ :site => "rennes",
289
+ :environment => "wheezy-x64-base",
290
+ :roles => %w{ xp5k_vlan },
291
+ :key => File.read("#{ssh_public}"),
292
+ :vlan_from_job => 'xp5k_vlan',
293
+ })
294
+ ```
295
+
296
+ ## Non deploy jobs
297
+
298
+ Here we fill the ```types``` field with ```allow_classic_ssh```.
299
+
300
+ ```ruby
301
+ @myxp.define_job({
302
+ :resources => ["nodes=1, walltime=1"],
303
+ :site => "rennes",
304
+ :retry => true,
305
+ :goal => "100%",
306
+ :types => ["allow_classic_ssh"],
307
+ :name => "init" ,
308
+ :command => "sleep 86400"
309
+ })
310
+
311
+ role :myrole do
312
+ @myxp.job_with_name('init')['assigned_nodes']
313
+ end
314
+ ```
315
+
316
+ You should be able to issue :
317
+ ```cap invoke ROLES=myrole USER=<g5k-login> COMMAND=date``` to retrieve the date on all the nodes without deploying.
data/lib/xp5k/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module XP5K
2
- VERSION='0.0.9'
2
+ VERSION='0.0.10'
3
3
  end
data/lib/xp5k/xp.rb CHANGED
@@ -174,7 +174,7 @@ module XP5K
174
174
  job.delete if (job['state'] =~ /running|waiting/)
175
175
  logger.info "Job ##{job["uid"]} deleted !"
176
176
  end
177
- FileUtils.rm(".xp_cache")
177
+ FileUtils.rm(".xp_cache") if File.exists?(".xp_cache")
178
178
  end
179
179
 
180
180
  private
data/xp5k.gemspec CHANGED
@@ -15,6 +15,7 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.required_rubygems_version = '>= 1.3.6'
17
17
 
18
+ s.add_dependency 'rest-client', '1.6.8' # SSL problems with newer version
18
19
  s.add_dependency 'restfully', '>1.0.0'
19
20
  s.add_dependency 'term-ansicolor', '>= 1.0.7'
20
21
  s.add_dependency 'json', '>= 1.5.1'
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xp5k
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pascal Morillon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-14 00:00:00.000000000 Z
11
+ date: 2015-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rest-client
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.6.8
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.6.8
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: restfully
15
29
  requirement: !ruby/object:Gem::Requirement