wf_node_api 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +22 -18
- data/Gemfile.lock +3 -3
- data/LICENSE +19 -340
- data/Vagrantfile +28 -23
- data/_docs/api/Api.html +22 -18
- data/_docs/api/Api/NodeApi.html +1 -1
- data/_docs/api/ConfigCheck.html +34 -30
- data/_docs/api/ContainerManager.html +176 -77
- data/_docs/api/ContainerManagerAdapter.html +22 -18
- data/_docs/api/ContainerManagerAdapter/Lxc.html +169 -58
- data/_docs/api/ContainerManagerAdapter/Vserver.html +169 -58
- data/_docs/api/NotFoundError.html +22 -18
- data/_docs/api/OS.html +26 -22
- data/_docs/api/ResourceManager.html +11 -11
- data/_docs/api/ResourceManagerAdapter.html +22 -18
- data/_docs/api/ResourceManagerAdapter/Linux.html +13 -13
- data/_docs/api/WfNodeApi.html +23 -19
- data/_docs/api/_index.html +1 -1
- data/_docs/api/file.README.html +96 -66
- data/_docs/api/index.html +96 -66
- data/_docs/api/method_list.html +60 -42
- data/_docs/api/top-level-namespace.html +7 -7
- data/_docs/rest/api_data.js +934 -1
- data/_docs/rest/api_data.json +934 -1
- data/_docs/rest/api_project.js +31 -1
- data/_docs/rest/api_project.json +31 -1
- data/bin/wf_node_api +25 -21
- data/lib/wf_node_api.rb +25 -21
- data/lib/wf_node_api/api/node_api.rb +36 -27
- data/lib/wf_node_api/config/config_template.erb +36 -4
- data/lib/wf_node_api/config_check.rb +25 -21
- data/lib/wf_node_api/container_manager.rb +34 -22
- data/lib/wf_node_api/container_manager_adapter/lxc.rb +43 -25
- data/lib/wf_node_api/container_manager_adapter/vserver.rb +45 -27
- data/lib/wf_node_api/error/not_found.rb +22 -18
- data/lib/wf_node_api/os.rb +22 -18
- data/lib/wf_node_api/resource_manager.rb +24 -20
- data/lib/wf_node_api/resource_manager_adapter/linux.rb +25 -21
- data/lib/wf_node_api/translations.rb +22 -18
- data/lib/wf_node_api/version.rb +22 -18
- data/wf-node-api.gemspec +26 -22
- metadata +4 -3
@@ -1,26 +1,30 @@
|
|
1
1
|
=begin
|
2
|
-
__ ___ _ _ _____ ____ __ __
|
3
|
-
\ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
__ ___ _ _ _____ ____ __ __
|
3
|
+
\ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
|
4
|
+
\ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
|
5
|
+
\ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
|
6
|
+
\_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
|
7
7
|
Container Manager
|
8
8
|
|
9
|
-
Copyright (
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
9
|
+
Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
|
10
|
+
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
12
|
+
this software and associated documentation files (the "Software"), to deal in
|
13
|
+
the Software without restriction, including without limitation the rights to
|
14
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
15
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
16
|
+
so, subject to the following conditions:
|
17
|
+
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
19
|
+
copies or substantial portions of the Software.
|
20
|
+
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
27
|
+
SOFTWARE.
|
24
28
|
=end
|
25
29
|
|
26
30
|
# Manager for containers, meta class
|
@@ -178,6 +182,13 @@ class ContainerManager
|
|
178
182
|
@adapter.container(name)
|
179
183
|
end
|
180
184
|
|
185
|
+
# Returns a list of supported templates
|
186
|
+
#
|
187
|
+
# @return [Hash] List of supported templates
|
188
|
+
def supported_templates
|
189
|
+
@adapter.supported_templates
|
190
|
+
end
|
191
|
+
|
181
192
|
# Returns the amount of free cpu cores
|
182
193
|
#
|
183
194
|
# @param resman [ResourceManager] A ResourceManager instance
|
@@ -258,13 +269,14 @@ class ContainerManager
|
|
258
269
|
# @param disk_size_gb [Integer] The disk size in GB
|
259
270
|
# @param memory_limit_mb [Integer] The memory limit in MB
|
260
271
|
# @param cpu_core_count [Integer] Amount of Vcores to assign
|
272
|
+
# @param template [String] Name of the template to use
|
261
273
|
#
|
262
274
|
# @raise [RuntimeError]
|
263
275
|
# @raise [NotFoundError]
|
264
276
|
# @raise [ArgumentError]
|
265
277
|
#
|
266
278
|
# @return [String] CLI output
|
267
|
-
def create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count)
|
279
|
+
def create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count, template)
|
268
280
|
disk_size_gb = disk_size_gb.to_i
|
269
281
|
memory_limit_mb = memory_limit_mb.to_i
|
270
282
|
cpu_core_count = cpu_core_count.to_i
|
@@ -281,6 +293,6 @@ class ContainerManager
|
|
281
293
|
raise ::NotFoundError
|
282
294
|
end
|
283
295
|
|
284
|
-
@adapter.create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count)
|
296
|
+
@adapter.create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count, template)
|
285
297
|
end
|
286
298
|
end
|
@@ -1,26 +1,30 @@
|
|
1
1
|
=begin
|
2
|
-
__ ___ _ _ _____ ____ __ __
|
3
|
-
\ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
__ ___ _ _ _____ ____ __ __
|
3
|
+
\ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
|
4
|
+
\ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
|
5
|
+
\ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
|
6
|
+
\_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
|
7
7
|
Container Manager
|
8
8
|
|
9
|
-
Copyright (
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
9
|
+
Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
|
10
|
+
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
12
|
+
this software and associated documentation files (the "Software"), to deal in
|
13
|
+
the Software without restriction, including without limitation the rights to
|
14
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
15
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
16
|
+
so, subject to the following conditions:
|
17
|
+
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
19
|
+
copies or substantial portions of the Software.
|
20
|
+
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
27
|
+
SOFTWARE.
|
24
28
|
=end
|
25
29
|
|
26
30
|
module ContainerManagerAdapter
|
@@ -144,11 +148,12 @@ module ContainerManagerAdapter
|
|
144
148
|
# @param disk_size_gb [Integer] The disk size in GB
|
145
149
|
# @param memory_limit_mb [Integer] The memory limit in MB
|
146
150
|
# @param cpu_core_count [Integer] Amount of Vcores to assign. 0 if no limit should be set
|
151
|
+
# @param template [String] Name of the template to use
|
147
152
|
#
|
148
153
|
# @raise [RuntimeError]
|
149
154
|
#
|
150
155
|
# @return [String] CLI output
|
151
|
-
def create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count)
|
156
|
+
def create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count, template)
|
152
157
|
output = ''
|
153
158
|
|
154
159
|
begin
|
@@ -156,7 +161,11 @@ module ContainerManagerAdapter
|
|
156
161
|
cpuset = self.generate_cpu_set(cpu_core_count, ResourceManager.new('linux'))
|
157
162
|
end
|
158
163
|
|
159
|
-
|
164
|
+
if false == $lxc_cmd_create.has_key?(template)
|
165
|
+
raise ArgumentError, "template does not exist"
|
166
|
+
end
|
167
|
+
|
168
|
+
create_result = Open3.capture3($lxc_cmd_create[template].gsub('[name]', name))
|
160
169
|
|
161
170
|
output += create_result[0]
|
162
171
|
output += create_result[1]
|
@@ -168,11 +177,13 @@ module ContainerManagerAdapter
|
|
168
177
|
f << "lxc.start.auto=1\n"
|
169
178
|
f << "lxc.start.delay=5\n"
|
170
179
|
|
171
|
-
if cpu_core_count != 0
|
180
|
+
if cpu_core_count.to_i != 0
|
172
181
|
f << "lxc.cgroup.cpuset.cpus=#{cpuset}\n"
|
173
182
|
end
|
174
183
|
|
175
|
-
|
184
|
+
if memory_limit_mb.to_i != 0
|
185
|
+
f << "lxc.cgroup.memory.limit_in_bytes=#{memory_limit_mb.to_s}M\n"
|
186
|
+
end
|
176
187
|
end
|
177
188
|
|
178
189
|
$logger.info("creation of container " + name + " successful")
|
@@ -206,6 +217,13 @@ module ContainerManagerAdapter
|
|
206
217
|
self.free_cpu_cores(resman).count
|
207
218
|
end
|
208
219
|
|
220
|
+
# Returns a list of supported templates
|
221
|
+
#
|
222
|
+
# @return [Hash] List of supported templates
|
223
|
+
def supported_templates
|
224
|
+
$lxc_cmd_create.keys
|
225
|
+
end
|
226
|
+
|
209
227
|
protected
|
210
228
|
# Reads the config file of a LXC container
|
211
229
|
#
|
@@ -428,4 +446,4 @@ module ContainerManagerAdapter
|
|
428
446
|
cores_to_use.join(',')
|
429
447
|
end
|
430
448
|
end
|
431
|
-
end
|
449
|
+
end
|
@@ -1,26 +1,30 @@
|
|
1
1
|
=begin
|
2
|
-
__ ___ _ _ _____ ____ __ __
|
3
|
-
\ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
__ ___ _ _ _____ ____ __ __
|
3
|
+
\ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
|
4
|
+
\ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
|
5
|
+
\ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
|
6
|
+
\_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
|
7
7
|
Container Manager
|
8
8
|
|
9
|
-
Copyright (
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
9
|
+
Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
|
10
|
+
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
12
|
+
this software and associated documentation files (the "Software"), to deal in
|
13
|
+
the Software without restriction, including without limitation the rights to
|
14
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
15
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
16
|
+
so, subject to the following conditions:
|
17
|
+
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
19
|
+
copies or substantial portions of the Software.
|
20
|
+
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
27
|
+
SOFTWARE.
|
24
28
|
=end
|
25
29
|
|
26
30
|
module ContainerManagerAdapter
|
@@ -142,11 +146,12 @@ module ContainerManagerAdapter
|
|
142
146
|
# @param disk_size_gb [Integer] The disk size in GB
|
143
147
|
# @param memory_limit_mb [Integer] The memory limit in MB
|
144
148
|
# @param cpu_core_count [Integer] Amount of Vcores to assign. 0 for no limit
|
149
|
+
# @param template [String] Name of the template to use
|
145
150
|
#
|
146
151
|
# @raise [RuntimeError]
|
147
152
|
#
|
148
153
|
# @return [String] CLI output
|
149
|
-
def create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count)
|
154
|
+
def create_container(name, ip_address, disk_size_gb, memory_limit_mb, cpu_core_count, template)
|
150
155
|
output = ''
|
151
156
|
|
152
157
|
begin
|
@@ -154,8 +159,12 @@ module ContainerManagerAdapter
|
|
154
159
|
cpuset = generate_cpu_set(cpu_core_count, ResourceManager.new('linux'))
|
155
160
|
end
|
156
161
|
|
162
|
+
if false == $vserver_cmd_create.has_key?(template)
|
163
|
+
raise ArgumentError, "template does not exist"
|
164
|
+
end
|
165
|
+
|
157
166
|
new_context = highest_context() + 1
|
158
|
-
cmd = $vserver_cmd_create.gsub('[name]', name).gsub('[ip_address]', ip_address).gsub('[context]', new_context.to_s)
|
167
|
+
cmd = $vserver_cmd_create[template].gsub('[name]', name).gsub('[ip_address]', ip_address).gsub('[context]', new_context.to_s)
|
159
168
|
|
160
169
|
create_result = Open3.capture3(cmd)
|
161
170
|
|
@@ -167,11 +176,13 @@ module ContainerManagerAdapter
|
|
167
176
|
end
|
168
177
|
|
169
178
|
# memory limit
|
170
|
-
|
171
|
-
|
172
|
-
|
179
|
+
if memory_limit_mb.to_i != 0
|
180
|
+
memory_limit_bytes = memory_limit_mb.to_i * 1024 * 1024
|
181
|
+
page_size = `#{$page_size_cmd}`.to_i
|
182
|
+
memory_limit_pages = memory_limit_bytes / page_size
|
173
183
|
|
174
|
-
|
184
|
+
write_config_file(name, '/rlimits/rss.hard', memory_limit_pages.to_s)
|
185
|
+
end
|
175
186
|
|
176
187
|
if cpu_core_count != 0
|
177
188
|
# cpu core limit
|
@@ -209,6 +220,13 @@ module ContainerManagerAdapter
|
|
209
220
|
self.free_cpu_cores(resman).count
|
210
221
|
end
|
211
222
|
|
223
|
+
# Returns a list of supported templates
|
224
|
+
#
|
225
|
+
# @return [Hash] List of supported templates
|
226
|
+
def supported_templates
|
227
|
+
$vserver_cmd_create.keys
|
228
|
+
end
|
229
|
+
|
212
230
|
protected
|
213
231
|
# Writes the config file of a vserver
|
214
232
|
#
|
@@ -445,4 +463,4 @@ module ContainerManagerAdapter
|
|
445
463
|
`#{$vserver_cmd_ls}`.lines.map(&:strip).uniq
|
446
464
|
end
|
447
465
|
end
|
448
|
-
end
|
466
|
+
end
|
@@ -1,27 +1,31 @@
|
|
1
1
|
=begin
|
2
|
-
__ ___ _ _ _____ ____ __ __
|
3
|
-
\ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
__ ___ _ _ _____ ____ __ __
|
3
|
+
\ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
|
4
|
+
\ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
|
5
|
+
\ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
|
6
|
+
\_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
|
7
7
|
Container Manager
|
8
8
|
|
9
|
-
Copyright (
|
9
|
+
Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
12
|
+
this software and associated documentation files (the "Software"), to deal in
|
13
|
+
the Software without restriction, including without limitation the rights to
|
14
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
15
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
16
|
+
so, subject to the following conditions:
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19
|
-
GNU General Public License for more details.
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
19
|
+
copies or substantial portions of the Software.
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
27
|
+
SOFTWARE.
|
24
28
|
=end
|
25
29
|
|
26
30
|
class NotFoundError < StandardError
|
27
|
-
end
|
31
|
+
end
|
data/lib/wf_node_api/os.rb
CHANGED
@@ -1,26 +1,30 @@
|
|
1
1
|
=begin
|
2
|
-
__ ___ _ _ _____ ____ __ __
|
3
|
-
\ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
__ ___ _ _ _____ ____ __ __
|
3
|
+
\ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
|
4
|
+
\ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
|
5
|
+
\ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
|
6
|
+
\_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
|
7
7
|
Container Manager
|
8
8
|
|
9
|
-
Copyright (
|
9
|
+
Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
12
|
+
this software and associated documentation files (the "Software"), to deal in
|
13
|
+
the Software without restriction, including without limitation the rights to
|
14
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
15
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
16
|
+
so, subject to the following conditions:
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19
|
-
GNU General Public License for more details.
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
19
|
+
copies or substantial portions of the Software.
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
27
|
+
SOFTWARE.
|
24
28
|
=end
|
25
29
|
|
26
30
|
module OS
|
@@ -29,4 +33,4 @@ module OS
|
|
29
33
|
def self.linux?
|
30
34
|
RUBY_PLATFORM.include?('linux')
|
31
35
|
end
|
32
|
-
end
|
36
|
+
end
|
@@ -1,26 +1,30 @@
|
|
1
1
|
=begin
|
2
|
-
__ ___ _ _ _____ ____ __ __
|
3
|
-
\ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
__ ___ _ _ _____ ____ __ __
|
3
|
+
\ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ |
|
4
|
+
\ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| |
|
5
|
+
\ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | |
|
6
|
+
\_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_|
|
7
7
|
Container Manager
|
8
8
|
|
9
|
-
Copyright (
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
9
|
+
Copyright (c) 2015 David Prandzioch <kontakt@davidprandzioch.de>
|
10
|
+
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
12
|
+
this software and associated documentation files (the "Software"), to deal in
|
13
|
+
the Software without restriction, including without limitation the rights to
|
14
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
15
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
16
|
+
so, subject to the following conditions:
|
17
|
+
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
19
|
+
copies or substantial portions of the Software.
|
20
|
+
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
27
|
+
SOFTWARE.
|
24
28
|
=end
|
25
29
|
|
26
30
|
# Top level class for resource management
|