bfire 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -2
- data/examples/api.snooze +3 -0
- data/examples/elasticity.rb +7 -7
- data/examples/manifests/vm1.pp +13 -0
- data/examples/manifests/vm2.pp +14 -0
- data/examples/mine.rb +3 -2
- data/examples/modules/haproxy/files/haproxy.cfg +47 -0
- data/examples/modules/iozone/manifests/init.pp +14 -0
- data/lib/bfire/engine.rb +5 -6
- data/lib/bfire/rule.rb +1 -1
- data/lib/bfire/version.rb +1 -1
- metadata +36 -33
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# bfire
|
2
|
+
|
2
3
|
A powerful DSL to launch experiments on BonFIRE.
|
3
4
|
|
4
5
|
What this does for you:
|
@@ -12,8 +13,10 @@ What this does for you:
|
|
12
13
|
* Registers metrics into Zabbix;
|
13
14
|
* Scale up or scale down groups based on any condition you want, including metric values.
|
14
15
|
|
15
|
-
This is very much a work in progress, and a proof of concept.
|
16
|
-
|
16
|
+
This is very much a work in progress, and a proof of concept.
|
17
|
+
|
18
|
+
A screencast is available at
|
19
|
+
<http://bonfire-dev.gforge.inria.fr/public/bfire.mov>.
|
17
20
|
|
18
21
|
## Usage
|
19
22
|
|
@@ -87,4 +90,5 @@ Content of `my-experiment.rb`:
|
|
87
90
|
See the `examples` directory for up to date examples.
|
88
91
|
|
89
92
|
## Authors
|
93
|
+
|
90
94
|
* Cyril Rohr <cyril.rohr@inria.fr>
|
data/examples/api.snooze
ADDED
data/examples/elasticity.rb
CHANGED
@@ -9,15 +9,15 @@ set :gateway, "ssh.bonfire.grid5000.fr"
|
|
9
9
|
set :user, ENV['USER']
|
10
10
|
set :logging, INFO
|
11
11
|
|
12
|
-
set :squeeze, "BonFIRE Debian Squeeze 2G
|
13
|
-
set :zabbix, "BonFIRE Zabbix Aggregator
|
12
|
+
set :squeeze, "BonFIRE Debian Squeeze 2G v3"
|
13
|
+
set :zabbix, "BonFIRE Zabbix Aggregator v5"
|
14
14
|
set :wan, "BonFIRE WAN"
|
15
15
|
|
16
16
|
|
17
17
|
# Monitoring
|
18
18
|
group :eye, :tag => "BonFIRE-monitor" do
|
19
19
|
at "fr-inria"
|
20
|
-
instance_type "
|
20
|
+
instance_type "lite"
|
21
21
|
deploy conf[:zabbix]
|
22
22
|
connect_to conf[:wan]
|
23
23
|
end
|
@@ -25,7 +25,7 @@ end
|
|
25
25
|
# HTTP Routing
|
26
26
|
group :web do
|
27
27
|
at "fr-inria"
|
28
|
-
instance_type '
|
28
|
+
instance_type 'lite'
|
29
29
|
deploy conf[:squeeze]
|
30
30
|
# Two interfaces for the publicly facing server
|
31
31
|
connect_to conf[:wan]
|
@@ -48,8 +48,8 @@ end
|
|
48
48
|
# App servers
|
49
49
|
group :app do
|
50
50
|
at "fr-inria"
|
51
|
-
at "de-hlrs"
|
52
|
-
instance_type "
|
51
|
+
# at "de-hlrs"
|
52
|
+
instance_type "lite"
|
53
53
|
connect_to conf[:wan]
|
54
54
|
deploy conf[:squeeze]
|
55
55
|
provider :puppet,
|
@@ -66,7 +66,7 @@ group :app do
|
|
66
66
|
|
67
67
|
# Scaling
|
68
68
|
scale 1..10, {
|
69
|
-
:initial =>
|
69
|
+
:initial => 1,
|
70
70
|
:up => lambda {|engine|
|
71
71
|
values = engine.metric("connection_waiting_time",
|
72
72
|
:hosts => engine.group(:web).take(:first),
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class vm1 {
|
2
|
+
include iozone;
|
3
|
+
file { "/tmp/iozone.sh"
|
4
|
+
owner => root,
|
5
|
+
mode => 755,
|
6
|
+
content => "while(true); do /usr/local/src/iozone3_397/src/current/iozone -Rab /tmp/output.xls >> /tmp/test.csv; sleep 1; done",
|
7
|
+
require => Exec["install iozone"]
|
8
|
+
}
|
9
|
+
exec{"run iozone":
|
10
|
+
cmd => "/tmp/iozone.sh",
|
11
|
+
require => File["/tmp/iozone.sh"]
|
12
|
+
}
|
13
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class vm2 {
|
2
|
+
include iozone;
|
3
|
+
|
4
|
+
file { "/tmp/iozone.sh"
|
5
|
+
owner => root,
|
6
|
+
mode => 755,
|
7
|
+
content => "while(true); do /usr/local/src/iozone3_397/src/current/iozone -a; sleep 1; done",
|
8
|
+
require => Exec["install iozone"]
|
9
|
+
}
|
10
|
+
exec{"run iozone":
|
11
|
+
cmd => "/tmp/iozone.sh",
|
12
|
+
require => File["/tmp/iozone.sh"]
|
13
|
+
}
|
14
|
+
}
|
data/examples/mine.rb
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
global
|
2
|
+
log 127.0.0.1 local0
|
3
|
+
log 127.0.0.1 local1 notice
|
4
|
+
#log loghost local0 info
|
5
|
+
maxconn 4096
|
6
|
+
#chroot /usr/share/haproxy
|
7
|
+
user haproxy
|
8
|
+
group haproxy
|
9
|
+
daemon
|
10
|
+
#debug
|
11
|
+
#quiet
|
12
|
+
|
13
|
+
defaults
|
14
|
+
log global
|
15
|
+
mode http
|
16
|
+
option httplog
|
17
|
+
option dontlognull
|
18
|
+
retries 3
|
19
|
+
option redispatch
|
20
|
+
maxconn 2000
|
21
|
+
contimeout 5000000
|
22
|
+
clitimeout 5000000
|
23
|
+
srvtimeout 5000000
|
24
|
+
|
25
|
+
|
26
|
+
listen apps 0.0.0.0:80
|
27
|
+
|
28
|
+
stats uri /stats
|
29
|
+
option httpchk GET /
|
30
|
+
option httplog
|
31
|
+
log global
|
32
|
+
|
33
|
+
balance roundrobin
|
34
|
+
|
35
|
+
srvtimeout 3000000
|
36
|
+
|
37
|
+
option httpclose # disable keep-alive
|
38
|
+
|
39
|
+
#errorloc 502 http://192.168.114.58/error502.html
|
40
|
+
#errorfile 503 /etc/haproxy/errors/503.http
|
41
|
+
errorfile 400 /etc/haproxy/errors/400.http
|
42
|
+
errorfile 403 /etc/haproxy/errors/403.http
|
43
|
+
errorfile 408 /etc/haproxy/errors/408.http
|
44
|
+
errorfile 500 /etc/haproxy/errors/500.http
|
45
|
+
errorfile 502 /etc/haproxy/errors/502.http
|
46
|
+
errorfile 503 /etc/haproxy/errors/503.http
|
47
|
+
errorfile 504 /etc/haproxy/errors/504.http
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class iozone {
|
2
|
+
exec{"download iozone":
|
3
|
+
cmd => "/usr/bin/wget http://iozone.org/src/current/iozone3_397.tar",
|
4
|
+
pwd => "/usr/local/src",
|
5
|
+
creates => "/usr/local/src/iozone3_397.tar"
|
6
|
+
}
|
7
|
+
|
8
|
+
exec{"install iozone":
|
9
|
+
cmd => "/bin/tar -xf /usr/local/src/iozone3_397.tar && cd /usr/local/src/iozone3_397/src/current && make linux-AMD64",
|
10
|
+
creates => "/usr/local/src/iozone3_397/src/current/iozone",
|
11
|
+
require => Exec["download iozone"]
|
12
|
+
}
|
13
|
+
|
14
|
+
}
|
data/lib/bfire/engine.rb
CHANGED
@@ -342,8 +342,7 @@ module Bfire
|
|
342
342
|
connection.root.experiments.submit(
|
343
343
|
:name => conf[:name],
|
344
344
|
:description => conf[:description],
|
345
|
-
:walltime => conf[:walltime]
|
346
|
-
:status => "waiting"
|
345
|
+
:walltime => conf[:walltime]
|
347
346
|
)
|
348
347
|
else
|
349
348
|
connection.root.experiments.find{|exp|
|
@@ -521,17 +520,17 @@ module Bfire
|
|
521
520
|
experiment.reload
|
522
521
|
has_changed = (@experiment_state != experiment['status'])
|
523
522
|
case experiment['status']
|
524
|
-
when '
|
525
|
-
logger.info "#{banner}Experiment is
|
523
|
+
when 'ready'
|
524
|
+
logger.info "#{banner}Experiment is ready. Nothing to do..."
|
526
525
|
sleep_time = 10
|
527
526
|
when 'running'
|
528
527
|
logger.info "#{banner}Experiment is running."
|
529
528
|
trigger :running if has_changed
|
530
529
|
sleep_time = 30
|
531
|
-
when '
|
530
|
+
when 'stopped'
|
532
531
|
trigger :stopped if has_changed
|
533
532
|
sleep_time = 10
|
534
|
-
when 'terminated'
|
533
|
+
when 'terminated'
|
535
534
|
trigger :terminated if has_changed
|
536
535
|
end
|
537
536
|
@experiment_state = experiment['status']
|
data/lib/bfire/rule.rb
CHANGED
@@ -69,7 +69,7 @@ module Bfire
|
|
69
69
|
else
|
70
70
|
group.trigger :scale_error
|
71
71
|
end
|
72
|
-
elsif vms.all?{|compute| compute['state'] == '
|
72
|
+
elsif vms.all?{|compute| compute['state'] == 'RUNNING'}
|
73
73
|
group.engine.logger.info "#{group.banner}All compute resources are ACTIVE"
|
74
74
|
if group.ssh_accessible?(vms)
|
75
75
|
group.engine.logger.info "#{group.banner}All compute resources are SSH-able"
|
data/lib/bfire/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bfire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
default_executable:
|
12
|
+
date: 2012-03-14 00:00:00.000000000Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: restfully
|
17
|
-
requirement: &
|
16
|
+
requirement: &2153663260 !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
18
|
requirements:
|
20
19
|
- - ! '>='
|
@@ -22,10 +21,10 @@ dependencies:
|
|
22
21
|
version: '0'
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
|
-
version_requirements: *
|
24
|
+
version_requirements: *2153663260
|
26
25
|
- !ruby/object:Gem::Dependency
|
27
26
|
name: libxml-ruby
|
28
|
-
requirement: &
|
27
|
+
requirement: &2153662620 !ruby/object:Gem::Requirement
|
29
28
|
none: false
|
30
29
|
requirements:
|
31
30
|
- - ! '>='
|
@@ -33,10 +32,10 @@ dependencies:
|
|
33
32
|
version: '0'
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
|
-
version_requirements: *
|
35
|
+
version_requirements: *2153662620
|
37
36
|
- !ruby/object:Gem::Dependency
|
38
37
|
name: backports
|
39
|
-
requirement: &
|
38
|
+
requirement: &2153662100 !ruby/object:Gem::Requirement
|
40
39
|
none: false
|
41
40
|
requirements:
|
42
41
|
- - ! '>='
|
@@ -44,10 +43,10 @@ dependencies:
|
|
44
43
|
version: '0'
|
45
44
|
type: :runtime
|
46
45
|
prerelease: false
|
47
|
-
version_requirements: *
|
46
|
+
version_requirements: *2153662100
|
48
47
|
- !ruby/object:Gem::Dependency
|
49
48
|
name: net-sftp
|
50
|
-
requirement: &
|
49
|
+
requirement: &2153661520 !ruby/object:Gem::Requirement
|
51
50
|
none: false
|
52
51
|
requirements:
|
53
52
|
- - ! '>='
|
@@ -55,10 +54,10 @@ dependencies:
|
|
55
54
|
version: '0'
|
56
55
|
type: :runtime
|
57
56
|
prerelease: false
|
58
|
-
version_requirements: *
|
57
|
+
version_requirements: *2153661520
|
59
58
|
- !ruby/object:Gem::Dependency
|
60
59
|
name: net-scp
|
61
|
-
requirement: &
|
60
|
+
requirement: &2153660160 !ruby/object:Gem::Requirement
|
62
61
|
none: false
|
63
62
|
requirements:
|
64
63
|
- - ! '>='
|
@@ -66,10 +65,10 @@ dependencies:
|
|
66
65
|
version: '0'
|
67
66
|
type: :runtime
|
68
67
|
prerelease: false
|
69
|
-
version_requirements: *
|
68
|
+
version_requirements: *2153660160
|
70
69
|
- !ruby/object:Gem::Dependency
|
71
70
|
name: net-ssh-multi
|
72
|
-
requirement: &
|
71
|
+
requirement: &2153659720 !ruby/object:Gem::Requirement
|
73
72
|
none: false
|
74
73
|
requirements:
|
75
74
|
- - ! '>='
|
@@ -77,10 +76,10 @@ dependencies:
|
|
77
76
|
version: '0'
|
78
77
|
type: :runtime
|
79
78
|
prerelease: false
|
80
|
-
version_requirements: *
|
79
|
+
version_requirements: *2153659720
|
81
80
|
- !ruby/object:Gem::Dependency
|
82
81
|
name: net-ssh-gateway
|
83
|
-
requirement: &
|
82
|
+
requirement: &2153659180 !ruby/object:Gem::Requirement
|
84
83
|
none: false
|
85
84
|
requirements:
|
86
85
|
- - ! '>='
|
@@ -88,10 +87,10 @@ dependencies:
|
|
88
87
|
version: '0'
|
89
88
|
type: :runtime
|
90
89
|
prerelease: false
|
91
|
-
version_requirements: *
|
90
|
+
version_requirements: *2153659180
|
92
91
|
- !ruby/object:Gem::Dependency
|
93
92
|
name: rgl
|
94
|
-
requirement: &
|
93
|
+
requirement: &2153658760 !ruby/object:Gem::Requirement
|
95
94
|
none: false
|
96
95
|
requirements:
|
97
96
|
- - ! '>='
|
@@ -99,10 +98,10 @@ dependencies:
|
|
99
98
|
version: '0'
|
100
99
|
type: :runtime
|
101
100
|
prerelease: false
|
102
|
-
version_requirements: *
|
101
|
+
version_requirements: *2153658760
|
103
102
|
- !ruby/object:Gem::Dependency
|
104
103
|
name: uuidtools
|
105
|
-
requirement: &
|
104
|
+
requirement: &2153658320 !ruby/object:Gem::Requirement
|
106
105
|
none: false
|
107
106
|
requirements:
|
108
107
|
- - ! '>='
|
@@ -110,10 +109,10 @@ dependencies:
|
|
110
109
|
version: '0'
|
111
110
|
type: :runtime
|
112
111
|
prerelease: false
|
113
|
-
version_requirements: *
|
112
|
+
version_requirements: *2153658320
|
114
113
|
- !ruby/object:Gem::Dependency
|
115
114
|
name: rake
|
116
|
-
requirement: &
|
115
|
+
requirement: &2153657700 !ruby/object:Gem::Requirement
|
117
116
|
none: false
|
118
117
|
requirements:
|
119
118
|
- - ~>
|
@@ -121,10 +120,10 @@ dependencies:
|
|
121
120
|
version: '0.8'
|
122
121
|
type: :development
|
123
122
|
prerelease: false
|
124
|
-
version_requirements: *
|
123
|
+
version_requirements: *2153657700
|
125
124
|
- !ruby/object:Gem::Dependency
|
126
125
|
name: rspec
|
127
|
-
requirement: &
|
126
|
+
requirement: &2153657120 !ruby/object:Gem::Requirement
|
128
127
|
none: false
|
129
128
|
requirements:
|
130
129
|
- - ~>
|
@@ -132,10 +131,10 @@ dependencies:
|
|
132
131
|
version: '2'
|
133
132
|
type: :development
|
134
133
|
prerelease: false
|
135
|
-
version_requirements: *
|
134
|
+
version_requirements: *2153657120
|
136
135
|
- !ruby/object:Gem::Dependency
|
137
136
|
name: webmock
|
138
|
-
requirement: &
|
137
|
+
requirement: &2153656680 !ruby/object:Gem::Requirement
|
139
138
|
none: false
|
140
139
|
requirements:
|
141
140
|
- - ! '>='
|
@@ -143,10 +142,10 @@ dependencies:
|
|
143
142
|
version: '0'
|
144
143
|
type: :development
|
145
144
|
prerelease: false
|
146
|
-
version_requirements: *
|
145
|
+
version_requirements: *2153656680
|
147
146
|
- !ruby/object:Gem::Dependency
|
148
147
|
name: autotest
|
149
|
-
requirement: &
|
148
|
+
requirement: &2153656220 !ruby/object:Gem::Requirement
|
150
149
|
none: false
|
151
150
|
requirements:
|
152
151
|
- - ! '>='
|
@@ -154,10 +153,10 @@ dependencies:
|
|
154
153
|
version: '0'
|
155
154
|
type: :development
|
156
155
|
prerelease: false
|
157
|
-
version_requirements: *
|
156
|
+
version_requirements: *2153656220
|
158
157
|
- !ruby/object:Gem::Dependency
|
159
158
|
name: autotest-growl
|
160
|
-
requirement: &
|
159
|
+
requirement: &2153655760 !ruby/object:Gem::Requirement
|
161
160
|
none: false
|
162
161
|
requirements:
|
163
162
|
- - ! '>='
|
@@ -165,7 +164,7 @@ dependencies:
|
|
165
164
|
version: '0'
|
166
165
|
type: :development
|
167
166
|
prerelease: false
|
168
|
-
version_requirements: *
|
167
|
+
version_requirements: *2153655760
|
169
168
|
description: Launch experiments on BonFIRE
|
170
169
|
email:
|
171
170
|
- cyril.rohr@inria.fr
|
@@ -187,10 +186,13 @@ files:
|
|
187
186
|
- lib/bfire/template.rb
|
188
187
|
- lib/bfire/version.rb
|
189
188
|
- lib/bfire.rb
|
189
|
+
- examples/api.snooze
|
190
190
|
- examples/benchmark.rb
|
191
191
|
- examples/dag.rb
|
192
192
|
- examples/elasticity.rb
|
193
193
|
- examples/ibbt.rb
|
194
|
+
- examples/manifests/vm1.pp
|
195
|
+
- examples/manifests/vm2.pp
|
194
196
|
- examples/mine.rb
|
195
197
|
- examples/modules/apache2/manifests/init.pp
|
196
198
|
- examples/modules/app/files/app/app.rb
|
@@ -199,8 +201,10 @@ files:
|
|
199
201
|
- examples/modules/app/manifests/init.pp
|
200
202
|
- examples/modules/common/manifests/init.pp
|
201
203
|
- examples/modules/haproxy/files/default
|
204
|
+
- examples/modules/haproxy/files/haproxy.cfg
|
202
205
|
- examples/modules/haproxy/files/haproxy.rsyslog.conf
|
203
206
|
- examples/modules/haproxy/manifests/init.pp
|
207
|
+
- examples/modules/iozone/manifests/init.pp
|
204
208
|
- examples/modules/mysql/manifests/init.pp
|
205
209
|
- examples/modules/rsyslog/files/rsyslog.conf
|
206
210
|
- examples/modules/rsyslog/manifests/init.pp
|
@@ -212,7 +216,6 @@ files:
|
|
212
216
|
- examples/simple.rb
|
213
217
|
- LICENSE
|
214
218
|
- README.md
|
215
|
-
has_rdoc: true
|
216
219
|
homepage: http://github.com/crohr/bfire
|
217
220
|
licenses: []
|
218
221
|
post_install_message:
|
@@ -234,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
237
|
version: '1.3'
|
235
238
|
requirements: []
|
236
239
|
rubyforge_project:
|
237
|
-
rubygems_version: 1.
|
240
|
+
rubygems_version: 1.8.13
|
238
241
|
signing_key:
|
239
242
|
specification_version: 3
|
240
243
|
summary: Launch experiments on BonFIRE
|