sisfc 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/LICENSE +20 -0
- data/README.md +55 -0
- data/Rakefile +9 -0
- data/bin/sisfc +32 -0
- data/examples/generator.R +45 -0
- data/examples/simulator.conf +70 -0
- data/examples/vm_allocation.conf +8 -0
- data/lib/sisfc/configuration.rb +60 -0
- data/lib/sisfc/data_center.rb +59 -0
- data/lib/sisfc/evaluation.rb +36 -0
- data/lib/sisfc/event.rb +36 -0
- data/lib/sisfc/generator.rb +80 -0
- data/lib/sisfc/request.rb +122 -0
- data/lib/sisfc/service_type.rb +16 -0
- data/lib/sisfc/simulation.rb +205 -0
- data/lib/sisfc/sorted_array.rb +57 -0
- data/lib/sisfc/statistics.rb +29 -0
- data/lib/sisfc/support/dsl_helper.rb +18 -0
- data/lib/sisfc/version.rb +3 -0
- data/lib/sisfc/vm.rb +86 -0
- data/lib/sisfc.rb +4 -0
- data/sisfc.gemspec +27 -0
- data/test/sisfc/configuration_test.rb +94 -0
- data/test/sisfc/generator_test.rb +63 -0
- data/test/sisfc/reference_configuration.rb +178 -0
- data/test/sisfc/request_test.rb +13 -0
- data/test/test_helper.rb +4 -0
- metadata +148 -0
@@ -0,0 +1,178 @@
|
|
1
|
+
require 'sisfc/configuration'
|
2
|
+
|
3
|
+
START_TIME = Time.utc(1978, 'Aug', 12, 14, 30, 0).to_f
|
4
|
+
DURATION = 1.minute.to_f
|
5
|
+
WARMUP_DURATION = 10.seconds.to_f
|
6
|
+
SIMULATION_CHARACTERIZATION = <<END
|
7
|
+
# start time, duration, and warmup time for simulations
|
8
|
+
start_time Time.utc(1978, 'Aug', 12, 14, 30, 0)
|
9
|
+
duration 1.minute
|
10
|
+
warmup_duration 10.seconds
|
11
|
+
END
|
12
|
+
|
13
|
+
|
14
|
+
# characterization of data centers
|
15
|
+
DATA_CENTERS_CHARACTERIZATION = <<END
|
16
|
+
data_centers \
|
17
|
+
1 => {
|
18
|
+
:maximum_vm_capacity => {
|
19
|
+
:tiny => 300,
|
20
|
+
:small => 300,
|
21
|
+
:medium => 300,
|
22
|
+
:large => 300,
|
23
|
+
:huge => 300,
|
24
|
+
},
|
25
|
+
},
|
26
|
+
2 => {
|
27
|
+
:maximum_vm_capacity => {
|
28
|
+
:tiny => 300,
|
29
|
+
:small => 300,
|
30
|
+
:medium => 300,
|
31
|
+
:large => 300,
|
32
|
+
:huge => 300,
|
33
|
+
},
|
34
|
+
},
|
35
|
+
3 => {
|
36
|
+
:maximum_vm_capacity => {
|
37
|
+
:tiny => 300,
|
38
|
+
:small => 300,
|
39
|
+
:medium => 300,
|
40
|
+
:large => 300,
|
41
|
+
:huge => 300,
|
42
|
+
},
|
43
|
+
},
|
44
|
+
4 => {
|
45
|
+
:maximum_vm_capacity => {
|
46
|
+
:tiny => 300,
|
47
|
+
:small => 300,
|
48
|
+
:medium => 300,
|
49
|
+
:large => 300,
|
50
|
+
:huge => 300,
|
51
|
+
},
|
52
|
+
},
|
53
|
+
5 => {
|
54
|
+
:maximum_vm_capacity => {
|
55
|
+
:tiny => 300,
|
56
|
+
:small => 300,
|
57
|
+
:medium => 300,
|
58
|
+
:large => 300,
|
59
|
+
:huge => 300,
|
60
|
+
},
|
61
|
+
}
|
62
|
+
END
|
63
|
+
|
64
|
+
|
65
|
+
# characterization of component types
|
66
|
+
SERVICE_COMPONENT_TYPES_CHARACTERIZATION = <<END
|
67
|
+
service_component_types \
|
68
|
+
'Web Server' => {
|
69
|
+
:allowed_vm_types => [ :medium, :large ],
|
70
|
+
:service_time_distribution => {
|
71
|
+
:medium => { :distribution => :gaussian,
|
72
|
+
:mu => 0.009, # 1 request processed every 9ms
|
73
|
+
:sigma => 0.001 },
|
74
|
+
:large => { :distribution => :gaussian,
|
75
|
+
:mu => 0.007, # 1 request processed every 7ms
|
76
|
+
:sigma => 0.001 } },
|
77
|
+
:estimated_workload => 50,
|
78
|
+
},
|
79
|
+
'App Server' => {
|
80
|
+
:allowed_vm_types => [ :medium, :large, :huge ],
|
81
|
+
:service_time_distribution => {
|
82
|
+
:medium => { :distribution => :gaussian,
|
83
|
+
:mu => 0.015, # 1 request processed every 15ms
|
84
|
+
:sigma => 0.005 },
|
85
|
+
:large => { :distribution => :gaussian,
|
86
|
+
:mu => 0.012, # 1 request processed every 12ms
|
87
|
+
:sigma => 0.003 },
|
88
|
+
:huge => { :distribution => :gaussian,
|
89
|
+
:mu => 0.009, # 1 request processed every 7ms
|
90
|
+
:sigma => 0.002 } },
|
91
|
+
:estimated_workload => 70,
|
92
|
+
},
|
93
|
+
'Financial Transaction Server' => {
|
94
|
+
:allowed_vm_types => [ :large, :huge ],
|
95
|
+
:service_time_distribution => {
|
96
|
+
:large => { :distribution => :gaussian,
|
97
|
+
:mu => 0.015, # 1 request processed every 15ms
|
98
|
+
:sigma => 0.004 },
|
99
|
+
:huge => { :distribution => :gaussian,
|
100
|
+
:mu => 0.008, # 1 request processed every 8ms
|
101
|
+
:sigma => 0.003 } },
|
102
|
+
:estimated_workload => 80,
|
103
|
+
}
|
104
|
+
END
|
105
|
+
|
106
|
+
|
107
|
+
# workflow (or job) types descriptions
|
108
|
+
WORKFLOW_TYPES_CHARACTERIZATION = <<END
|
109
|
+
workflow_types \
|
110
|
+
1 => {
|
111
|
+
:component_sequence => [
|
112
|
+
{ :name => 'Web Server' }, # no need for :type => dedicated / shared
|
113
|
+
{ :name => 'App Server' },
|
114
|
+
{ :name => 'Financial Transaction Server' },
|
115
|
+
],
|
116
|
+
:next_component_selection => :random,
|
117
|
+
},
|
118
|
+
2 => {
|
119
|
+
:component_sequence => [
|
120
|
+
{ :name => 'Web Server' }, # no need for :type => dedicated / shared
|
121
|
+
{ :name => 'App Server' },
|
122
|
+
],
|
123
|
+
# :next_component_selection => :least_loaded,
|
124
|
+
:next_component_selection => :random,
|
125
|
+
}
|
126
|
+
END
|
127
|
+
|
128
|
+
|
129
|
+
REQUEST_GENERATION_CHARACTERIZATION = <<END
|
130
|
+
request_generation \
|
131
|
+
command: "<pwd>/generator.R"
|
132
|
+
END
|
133
|
+
|
134
|
+
|
135
|
+
# this is the whole reference configuration
|
136
|
+
# (useful for spec'ing configuration.rb)
|
137
|
+
REFERENCE_CONFIGURATION =
|
138
|
+
SIMULATION_CHARACTERIZATION +
|
139
|
+
DATA_CENTERS_CHARACTERIZATION +
|
140
|
+
SERVICE_COMPONENT_TYPES_CHARACTERIZATION +
|
141
|
+
WORKFLOW_TYPES_CHARACTERIZATION +
|
142
|
+
REQUEST_GENERATION_CHARACTERIZATION
|
143
|
+
|
144
|
+
|
145
|
+
evaluator = Object.new
|
146
|
+
evaluator.extend SISFC::Configurable
|
147
|
+
evaluator.instance_eval(REFERENCE_CONFIGURATION)
|
148
|
+
|
149
|
+
# these are preprocessed portions of the reference configuration
|
150
|
+
# (useful for spec'ing everything else)
|
151
|
+
DATA_CENTERS = evaluator.data_centers
|
152
|
+
SERVICE_COMPONENT_TYPES = evaluator.service_component_types
|
153
|
+
WORKFLOW_TYPES = evaluator.workflow_types
|
154
|
+
|
155
|
+
|
156
|
+
def with_reference_config(opts={})
|
157
|
+
begin
|
158
|
+
# create temporary file with reference configuration
|
159
|
+
tf = Tempfile.open('REFERENCE_CONFIGURATION')
|
160
|
+
tf.write(REFERENCE_CONFIGURATION)
|
161
|
+
tf.close
|
162
|
+
|
163
|
+
# create a configuration object from the reference configuration file
|
164
|
+
conf = SISFC::Configuration.load_from_file(tf.path)
|
165
|
+
|
166
|
+
# apply any change from the opts parameter and validate the modified configuration
|
167
|
+
opts.each do |k,v|
|
168
|
+
conf.send(k, v)
|
169
|
+
end
|
170
|
+
conf.validate
|
171
|
+
|
172
|
+
# pass the configuration object to the block
|
173
|
+
yield conf
|
174
|
+
ensure
|
175
|
+
# delete temporary file
|
176
|
+
tf.delete
|
177
|
+
end
|
178
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sisfc
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mauro Tortonesi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-02-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.0.0
|
20
|
+
requirement: !ruby/object:Gem::Requirement
|
21
|
+
requirements:
|
22
|
+
- - ~>
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 4.0.0
|
25
|
+
prerelease: false
|
26
|
+
type: :runtime
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: awesome_print
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.2.0
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ~>
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: 1.2.0
|
39
|
+
prerelease: false
|
40
|
+
type: :runtime
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: erv
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.0.2
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ~>
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 0.0.2
|
53
|
+
prerelease: false
|
54
|
+
type: :runtime
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.5.3
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ~>
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 1.5.3
|
67
|
+
prerelease: false
|
68
|
+
type: :development
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 10.1.1
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ~>
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 10.1.1
|
81
|
+
prerelease: false
|
82
|
+
type: :development
|
83
|
+
description: Simulator for IT Services in Federated Clouds
|
84
|
+
email:
|
85
|
+
- mauro.tortonesi@unife.it
|
86
|
+
executables:
|
87
|
+
- sisfc
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- Gemfile
|
92
|
+
- LICENSE
|
93
|
+
- README.md
|
94
|
+
- Rakefile
|
95
|
+
- bin/sisfc
|
96
|
+
- examples/generator.R
|
97
|
+
- examples/simulator.conf
|
98
|
+
- examples/vm_allocation.conf
|
99
|
+
- lib/sisfc.rb
|
100
|
+
- lib/sisfc/configuration.rb
|
101
|
+
- lib/sisfc/data_center.rb
|
102
|
+
- lib/sisfc/evaluation.rb
|
103
|
+
- lib/sisfc/event.rb
|
104
|
+
- lib/sisfc/generator.rb
|
105
|
+
- lib/sisfc/request.rb
|
106
|
+
- lib/sisfc/service_type.rb
|
107
|
+
- lib/sisfc/simulation.rb
|
108
|
+
- lib/sisfc/sorted_array.rb
|
109
|
+
- lib/sisfc/statistics.rb
|
110
|
+
- lib/sisfc/support/dsl_helper.rb
|
111
|
+
- lib/sisfc/version.rb
|
112
|
+
- lib/sisfc/vm.rb
|
113
|
+
- sisfc.gemspec
|
114
|
+
- test/sisfc/configuration_test.rb
|
115
|
+
- test/sisfc/generator_test.rb
|
116
|
+
- test/sisfc/reference_configuration.rb
|
117
|
+
- test/sisfc/request_test.rb
|
118
|
+
- test/test_helper.rb
|
119
|
+
homepage: https://github.com/mtortonesi/sisfc
|
120
|
+
licenses:
|
121
|
+
- MIT
|
122
|
+
metadata: {}
|
123
|
+
post_install_message:
|
124
|
+
rdoc_options: []
|
125
|
+
require_paths:
|
126
|
+
- lib
|
127
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - '>='
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
137
|
+
requirements: []
|
138
|
+
rubyforge_project:
|
139
|
+
rubygems_version: 2.2.1
|
140
|
+
signing_key:
|
141
|
+
specification_version: 4
|
142
|
+
summary: A simulator for business-driven IT management research capable of evaluating IT service component placement in federated Cloud environments
|
143
|
+
test_files:
|
144
|
+
- test/sisfc/configuration_test.rb
|
145
|
+
- test/sisfc/generator_test.rb
|
146
|
+
- test/sisfc/reference_configuration.rb
|
147
|
+
- test/sisfc/request_test.rb
|
148
|
+
- test/test_helper.rb
|