contained_mr 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/contained_mr.gemspec +2 -2
- data/lib/contained_mr/job_logic.rb +2 -2
- data/lib/contained_mr/mock/runner.rb +2 -2
- data/test/test_job_logic.rb +2 -2
- data/test/test_mock_runner.rb +2 -2
- data/test/test_runner_logic.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb47353419e6a56f1246d06934b63c123edfb442
|
4
|
+
data.tar.gz: 594990cbb031cd9e9298832c0374b2d76e81196d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0bd1266cfdbaf5d1b24757d8bf52e37a0780b5912d78bf987c1f0b50247874709a832ad7aaec06649d7b8b80ca48c58f301bed0d91ea9632041d20ec697ca9b
|
7
|
+
data.tar.gz: 2925db33e8bb0179a80b7e93968c6728139d1b4735dc86918fd30d72a50f8355b3ba8d372357cfab01d2f16bb5ce15f77fffff4bf4cc8c5487fb7eb7c4f9d86f
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
data/contained_mr.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: contained_mr 0.3.
|
5
|
+
# stub: contained_mr 0.3.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "contained_mr"
|
9
|
-
s.version = "0.3.
|
9
|
+
s.version = "0.3.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
@@ -109,8 +109,8 @@ module ContainedMr::JobLogic
|
|
109
109
|
|
110
110
|
{
|
111
111
|
'Memory' => ram_bytes, 'MemorySwap' => swap_bytes,
|
112
|
-
'
|
113
|
-
'
|
112
|
+
'CpuPeriod' => cpu_period,
|
113
|
+
'CpuQuota' => (job_section[:vcpus] * cpu_period).to_i,
|
114
114
|
}
|
115
115
|
end
|
116
116
|
private :container_host_config
|
@@ -112,8 +112,8 @@ class ContainedMr::Mock::Runner
|
|
112
112
|
def _vcpus
|
113
113
|
return nil unless host_config = @_container_options['HostConfig']
|
114
114
|
return nil unless period = host_config['CpuPeriod']
|
115
|
-
return nil unless
|
115
|
+
return nil unless quota = host_config['CpuQuota']
|
116
116
|
|
117
|
-
|
117
|
+
quota / period.to_f
|
118
118
|
end
|
119
119
|
end
|
data/test/test_job_logic.rb
CHANGED
@@ -40,7 +40,7 @@ class TestJobLogic < MiniTest::Test
|
|
40
40
|
'HostConfig' => {
|
41
41
|
'Memory' => 256.5 * 1024 * 1024,
|
42
42
|
'MemorySwap' => (256.5 + 64) * 1024 * 1024,
|
43
|
-
'
|
43
|
+
'CpuQuota' => 1500000,
|
44
44
|
'CpuPeriod' => 1000000,
|
45
45
|
},
|
46
46
|
}
|
@@ -63,7 +63,7 @@ class TestJobLogic < MiniTest::Test
|
|
63
63
|
'HostConfig' => {
|
64
64
|
'Memory' => 768.5 * 1024 * 1024,
|
65
65
|
'MemorySwap' => -1,
|
66
|
-
'
|
66
|
+
'CpuQuota' => 500000,
|
67
67
|
'CpuPeriod' => 1000000,
|
68
68
|
},
|
69
69
|
}
|
data/test/test_mock_runner.rb
CHANGED
@@ -17,7 +17,7 @@ class TestMockRunner < MiniTest::Test
|
|
17
17
|
'HostConfig' => {
|
18
18
|
'Memory' => 256.5 * 1024 * 1024,
|
19
19
|
'MemorySwap' => (256.5 + 64) * 1024 * 1024,
|
20
|
-
'
|
20
|
+
'CpuQuota' => 1500000,
|
21
21
|
'CpuPeriod' => 1000000,
|
22
22
|
},
|
23
23
|
}
|
@@ -137,7 +137,7 @@ class TestMockRunner < MiniTest::Test
|
|
137
137
|
end
|
138
138
|
|
139
139
|
def test_memory_cpu_limits_without_host_config_cpu_shares
|
140
|
-
@container_options['HostConfig'].delete '
|
140
|
+
@container_options['HostConfig'].delete 'CpuQuota'
|
141
141
|
runner = ContainedMr::Mock::Runner.new @container_options, 2.5,
|
142
142
|
'/usr/mrd/map-output'
|
143
143
|
assert_equal 256.5, runner._ram_limit
|
data/test/test_runner_logic.rb
CHANGED