contained_mr 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2802a380e19e314a40493959bace7208a0a8109
4
- data.tar.gz: fb912e50f9e146624364edda1272faeff971f133
3
+ metadata.gz: 0939e46065ffcf543130f1ed6243a896482a286c
4
+ data.tar.gz: 3dee0167b3909de88614c152777feb90673e3874
5
5
  SHA512:
6
- metadata.gz: 82d975a57ef901d4909d8dce6f92d240725fb3ad09d8c3e8f0614c51d98df0cdfbc6c7435bffeb1f734b40025d9487bb89f7e2c40c2e41fb9433d48df2b6238a
7
- data.tar.gz: 6f034abfe4bf32dd2ab17ac17c89eab1c7b6d3f1cf2e4bd4296288c638421ec89f3d97cf8252836ef88d1473fe8e4bf166399f1cbf6f51a56816d2597db19981
6
+ metadata.gz: 9d1296d5f4926d089a5669028f71cba8486575463e0eb2b0de3a264c6e05d8f27a014270b29e30990307681063a39dedfccef6e596d6ba83c577897e56a11269
7
+ data.tar.gz: 1d2a656d0b2001fa683ee76e4b9e59294ea1a315ef8cea99770fffd2daafc43e3634dc34b42ab28a75b3bc68b3d0c4e97faa508e83250a829949c39d14716e2a
data/.travis.yml CHANGED
@@ -3,5 +3,11 @@ language: ruby
3
3
  services:
4
4
  - docker
5
5
  rvm:
6
- - 2.2.2
7
- script: rake test
6
+ - 2.2.4
7
+ - 2.3.0
8
+ before_install:
9
+ - gem install bundler
10
+ before_script:
11
+ - bundle install --jobs=3 --retry=3 --deployment
12
+ script:
13
+ - rake test
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'docker-api', '>= 1.22.4', require: 'docker'
3
+ gem 'docker-api', '>= 1.24.1', require: 'docker'
4
4
  gem 'rubyzip', '>= 1.1.7', require: 'zip'
5
5
 
6
6
  # Add dependencies to develop your gem here.
@@ -8,7 +8,7 @@ gem 'rubyzip', '>= 1.1.7', require: 'zip'
8
8
  group :development do
9
9
  gem 'bundler', '>= 1.6.1'
10
10
  gem 'jeweler', '>= 2.0.1'
11
- gem 'minitest', '>= 5.8.0'
11
+ gem 'minitest', '>= 5.8.3'
12
12
  gem 'mocha', '>= 1.1.0'
13
13
  gem 'rdoc', '>= 4.2.0'
14
14
  gem 'simplecov', '>= 0.10.0'
data/Gemfile.lock CHANGED
@@ -1,28 +1,27 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- addressable (2.3.8)
4
+ addressable (2.4.0)
5
5
  builder (3.2.2)
6
6
  descendants_tracker (0.0.4)
7
7
  thread_safe (~> 0.3, >= 0.3.1)
8
8
  docile (1.1.5)
9
- docker-api (1.22.4)
9
+ docker-api (1.24.1)
10
10
  excon (>= 0.38.0)
11
11
  json
12
12
  excon (0.45.4)
13
- faraday (0.9.1)
13
+ faraday (0.9.2)
14
14
  multipart-post (>= 1.2, < 3)
15
15
  git (1.2.9.1)
16
- github_api (0.12.4)
17
- addressable (~> 2.3)
16
+ github_api (0.13.1)
17
+ addressable (~> 2.4.0)
18
18
  descendants_tracker (~> 0.0.4)
19
19
  faraday (~> 0.8, < 0.10)
20
20
  hashie (>= 3.4)
21
21
  multi_json (>= 1.7.5, < 2.0)
22
- nokogiri (~> 1.6.6)
23
22
  oauth2
24
- hashie (3.4.2)
25
- highline (1.7.5)
23
+ hashie (3.4.3)
24
+ highline (1.7.8)
26
25
  jeweler (2.0.1)
27
26
  builder
28
27
  bundler (>= 1.0)
@@ -33,17 +32,17 @@ GEM
33
32
  rake
34
33
  rdoc
35
34
  json (1.8.3)
36
- jwt (1.5.1)
35
+ jwt (1.5.2)
37
36
  metaclass (0.0.4)
38
- mini_portile (0.6.2)
39
- minitest (5.8.0)
37
+ mini_portile2 (2.0.0)
38
+ minitest (5.8.3)
40
39
  mocha (1.1.0)
41
40
  metaclass (~> 0.0.1)
42
41
  multi_json (1.11.2)
43
42
  multi_xml (0.5.5)
44
43
  multipart-post (2.0.0)
45
- nokogiri (1.6.6.2)
46
- mini_portile (~> 0.6.0)
44
+ nokogiri (1.6.7.1)
45
+ mini_portile2 (~> 2.0.0.rc2)
47
46
  oauth2 (1.0.0)
48
47
  faraday (>= 0.8, < 0.10)
49
48
  jwt (~> 1.0)
@@ -52,9 +51,10 @@ GEM
52
51
  rack (~> 1.2)
53
52
  rack (1.6.4)
54
53
  rake (10.4.2)
55
- rdoc (4.2.0)
54
+ rdoc (4.2.1)
55
+ json (~> 1.4)
56
56
  rubyzip (1.1.7)
57
- simplecov (0.10.0)
57
+ simplecov (0.11.1)
58
58
  docile (~> 1.1.0)
59
59
  json (~> 1.8)
60
60
  simplecov-html (~> 0.10.0)
@@ -67,9 +67,9 @@ PLATFORMS
67
67
 
68
68
  DEPENDENCIES
69
69
  bundler (>= 1.6.1)
70
- docker-api (>= 1.22.4)
70
+ docker-api (>= 1.24.1)
71
71
  jeweler (>= 2.0.1)
72
- minitest (>= 5.8.0)
72
+ minitest (>= 5.8.3)
73
73
  mocha (>= 1.1.0)
74
74
  rdoc (>= 4.2.0)
75
75
  rubyzip (>= 1.1.7)
@@ -77,4 +77,4 @@ DEPENDENCIES
77
77
  yard (>= 0.8.7.6)
78
78
 
79
79
  BUNDLED WITH
80
- 1.10.6
80
+ 1.11.2
data/README.md CHANGED
@@ -5,32 +5,41 @@
5
5
 
6
6
  Map-Reduce where both the mappers and the reducer run inside Docker containers.
7
7
 
8
+
8
9
  ## Development Environment
9
10
 
10
- `contained-mr` requires access to a Docker daemon. The easiest way to
11
+ `contained-mr` requires access to a Docker Swarm daemon. The easiest way to
11
12
  bring up a development setup is to install
12
- [Docker Machine](https://github.com/docker/machine) and
13
+ [Docker Machine](https://github.com/docker/machine),
14
+ [Docker Swarm](https://github.com/docker/swarm) and
13
15
  [VirtualBox](https://www.virtualbox.org/).
14
16
 
15
17
  The commands below install the prerequisites on OSX using
16
18
  [Homebrew](http://brew.sh/).
17
19
 
18
20
  ```bash
19
- brew install brew-cask docker docker-machine
21
+ brew install docker docker-machine docker-swarm
22
+ brew tap Caskroom/cask
20
23
  brew cask install virtualbox
21
24
  ```
22
25
 
23
- Create a Docker VM. This is a one-time setup.
26
+ Create a Docker Swarm cluster. This is a one-time setup.
24
27
 
25
28
  ```bash
26
- docker-machine create --driver virtualbox --engine-storage-driver overlay dev
29
+ TOKEN=$(docker-swarm create)
30
+ docker-machine create --driver virtualbox --engine-storage-driver overlay \
31
+ --swarm --swarm-master --swarm-discovery "token://$TOKEN" swarm-master
32
+ docker-machine create --driver virtualbox --engine-storage-driver overlay \
33
+ --swarm --swarm-discovery "token://$TOKEN" swarm-agent-1
34
+ docker-machine create --driver virtualbox --engine-storage-driver overlay \
35
+ --swarm --swarm-discovery "token://$TOKEN" swarm-agent-2
27
36
  ```
28
37
 
29
- Set up the local environment to point to the Docker daemon in the VM. This must
30
- be executed in every shell where `contained-mr` is used.
38
+ Set up the local environment to point to the Swarm master. This must be
39
+ executed in every shell where `contained-mr` is used.
31
40
 
32
41
  ```bash
33
- eval "$(docker-machine env dev)"
42
+ eval "$(docker-machine env --swarm swarm-master)"
34
43
  ```
35
44
 
36
45
  ### Cleanup
@@ -44,6 +53,29 @@ docker ps --all --quiet --no-trunc | xargs docker rm
44
53
  docker images --quiet --no-trunc | xargs docker rmi
45
54
  ```
46
55
 
56
+ ### Testing Against Experimental Docker
57
+
58
+ This cluster setup will use the development version of Docker.
59
+
60
+ ```bash
61
+ TOKEN=$(docker-swarm create)
62
+ ISO_URL=$(curl \
63
+ https://api.github.com/repos/ahbeng/boot2docker-experimental/releases/latest \
64
+ | grep -o https://.*/boot2docker.iso)
65
+ docker-machine create --driver virtualbox --engine-storage-driver overlay \
66
+ --swarm --swarm-master --swarm-discovery "token://$TOKEN" \
67
+ --swarm-image "dockerswarm/swarm:master" \
68
+ --virtualbox-boot2docker-url $ISO_URL swarm-master
69
+ docker-machine create --driver virtualbox --engine-storage-driver overlay \
70
+ --swarm --swarm-discovery "token://$TOKEN" \
71
+ --swarm-image "dockerswarm/swarm:master" \
72
+ --virtualbox-boot2docker-url $ISO_URL swarm-agent-1
73
+ docker-machine create --driver virtualbox --engine-storage-driver overlay \
74
+ --swarm --swarm-discovery "token://$TOKEN" \
75
+ --swarm-image "dockerswarm/swarm:master" \
76
+ --virtualbox-boot2docker-url $ISO_URL swarm-agent-2
77
+ ```
78
+
47
79
 
48
80
  ## Contributing to contained_mr
49
81
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.5.0
data/contained_mr.gemspec CHANGED
@@ -2,16 +2,16 @@
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.4.1 ruby lib
5
+ # stub: contained_mr 0.5.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "contained_mr"
9
- s.version = "0.4.1"
9
+ s.version = "0.5.0"
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"]
13
13
  s.authors = ["Victor Costan"]
14
- s.date = "2015-10-27"
14
+ s.date = "2016-01-29"
15
15
  s.description = "Plumbing for running mappers and reducers inside Docker containers"
16
16
  s.email = "victor@costan.us"
17
17
  s.extra_rdoc_files = [
@@ -68,39 +68,39 @@ Gem::Specification.new do |s|
68
68
  ]
69
69
  s.homepage = "http://github.com/pwnall/contained_mr"
70
70
  s.licenses = ["MIT"]
71
- s.rubygems_version = "2.4.5.1"
71
+ s.rubygems_version = "2.5.1"
72
72
  s.summary = "Map-Reduce with Docker containers"
73
73
 
74
74
  if s.respond_to? :specification_version then
75
75
  s.specification_version = 4
76
76
 
77
77
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
78
- s.add_runtime_dependency(%q<docker-api>, [">= 1.22.4"])
78
+ s.add_runtime_dependency(%q<docker-api>, [">= 1.24.1"])
79
79
  s.add_runtime_dependency(%q<rubyzip>, [">= 1.1.7"])
80
80
  s.add_development_dependency(%q<bundler>, [">= 1.6.1"])
81
81
  s.add_development_dependency(%q<jeweler>, [">= 2.0.1"])
82
- s.add_development_dependency(%q<minitest>, [">= 5.8.0"])
82
+ s.add_development_dependency(%q<minitest>, [">= 5.8.3"])
83
83
  s.add_development_dependency(%q<mocha>, [">= 1.1.0"])
84
84
  s.add_development_dependency(%q<rdoc>, [">= 4.2.0"])
85
85
  s.add_development_dependency(%q<simplecov>, [">= 0.10.0"])
86
86
  s.add_development_dependency(%q<yard>, [">= 0.8.7.6"])
87
87
  else
88
- s.add_dependency(%q<docker-api>, [">= 1.22.4"])
88
+ s.add_dependency(%q<docker-api>, [">= 1.24.1"])
89
89
  s.add_dependency(%q<rubyzip>, [">= 1.1.7"])
90
90
  s.add_dependency(%q<bundler>, [">= 1.6.1"])
91
91
  s.add_dependency(%q<jeweler>, [">= 2.0.1"])
92
- s.add_dependency(%q<minitest>, [">= 5.8.0"])
92
+ s.add_dependency(%q<minitest>, [">= 5.8.3"])
93
93
  s.add_dependency(%q<mocha>, [">= 1.1.0"])
94
94
  s.add_dependency(%q<rdoc>, [">= 4.2.0"])
95
95
  s.add_dependency(%q<simplecov>, [">= 0.10.0"])
96
96
  s.add_dependency(%q<yard>, [">= 0.8.7.6"])
97
97
  end
98
98
  else
99
- s.add_dependency(%q<docker-api>, [">= 1.22.4"])
99
+ s.add_dependency(%q<docker-api>, [">= 1.24.1"])
100
100
  s.add_dependency(%q<rubyzip>, [">= 1.1.7"])
101
101
  s.add_dependency(%q<bundler>, [">= 1.6.1"])
102
102
  s.add_dependency(%q<jeweler>, [">= 2.0.1"])
103
- s.add_dependency(%q<minitest>, [">= 5.8.0"])
103
+ s.add_dependency(%q<minitest>, [">= 5.8.3"])
104
104
  s.add_dependency(%q<mocha>, [">= 1.1.0"])
105
105
  s.add_dependency(%q<rdoc>, [">= 4.2.0"])
106
106
  s.add_dependency(%q<simplecov>, [">= 0.10.0"])
@@ -108,6 +108,8 @@ module ContainedMr::JobLogic
108
108
  'MemorySwappiness' => 0,
109
109
  'CpuPeriod' => cpu_period,
110
110
  'CpuQuota' => (job_section[:vcpus] * cpu_period).to_i,
111
+ # NOTE: This interpretation of CpuShares only works on Docker Swarm.
112
+ 'CpuShares' => job_section[:vcpus],
111
113
  'LogConfig' => {
112
114
  'Type' => 'json-file',
113
115
  'Config' => {
@@ -41,8 +41,9 @@ class TestJobLogic < MiniTest::Test
41
41
  'Memory' => 256.5 * 1024 * 1024,
42
42
  'MemorySwap' => (256.5 + 64) * 1024 * 1024,
43
43
  'MemorySwappiness' => 0,
44
- 'CpuQuota' => 1500000,
44
+ 'CpuQuota' => 1000000,
45
45
  'CpuPeriod' => 1000000,
46
+ 'CpuShares' => 1,
46
47
  'LogConfig' => {
47
48
  'Type' => 'json-file',
48
49
  'Config' => {
@@ -72,8 +73,9 @@ class TestJobLogic < MiniTest::Test
72
73
  'Memory' => 768.5 * 1024 * 1024,
73
74
  'MemorySwap' => 768.5 * 1024 * 1024,
74
75
  'MemorySwappiness' => 0,
75
- 'CpuQuota' => 500000,
76
+ 'CpuQuota' => 1000000,
76
77
  'CpuPeriod' => 1000000,
78
+ 'CpuShares' => 1,
77
79
  'LogConfig' => {
78
80
  'Type' => 'json-file',
79
81
  'Config' => {
@@ -18,8 +18,9 @@ class TestMockRunner < MiniTest::Test
18
18
  'Memory' => 256.5 * 1024 * 1024,
19
19
  'MemorySwap' => (256.5 + 64) * 1024 * 1024,
20
20
  'MemorySwappiness' => 0,
21
- 'CpuQuota' => 1500000,
21
+ 'CpuQuota' => 1000000,
22
22
  'CpuPeriod' => 1000000,
23
+ 'CpuShares' => 1,
23
24
  'LogConfig' => {
24
25
  'Type' => 'json-file',
25
26
  'Config' => {
@@ -114,7 +115,7 @@ class TestMockRunner < MiniTest::Test
114
115
  def test_resources
115
116
  assert_equal 256.5, @runner._ram_limit
116
117
  assert_equal 64, @runner._swap_limit
117
- assert_equal 1.5, @runner._vcpus
118
+ assert_equal 1, @runner._vcpus
118
119
  assert_equal 4.5, @runner._logs
119
120
  end
120
121
 
@@ -134,7 +135,7 @@ class TestMockRunner < MiniTest::Test
134
135
  '/usr/mrd/map-output'
135
136
  assert_equal nil, runner._ram_limit
136
137
  assert_equal nil, runner._swap_limit
137
- assert_equal 1.5, runner._vcpus
138
+ assert_equal 1, runner._vcpus
138
139
  assert_equal 4.5, runner._logs
139
140
  end
140
141
 
@@ -144,7 +145,7 @@ class TestMockRunner < MiniTest::Test
144
145
  '/usr/mrd/map-output'
145
146
  assert_equal 256.5, runner._ram_limit
146
147
  assert_equal nil, runner._swap_limit
147
- assert_equal 1.5, runner._vcpus
148
+ assert_equal 1, runner._vcpus
148
149
  assert_equal 4.5, runner._logs
149
150
  end
150
151
 
@@ -174,7 +175,7 @@ class TestMockRunner < MiniTest::Test
174
175
  '/usr/mrd/map-output'
175
176
  assert_equal 256.5, runner._ram_limit
176
177
  assert_equal 64, runner._swap_limit
177
- assert_equal 1.5, runner._vcpus
178
+ assert_equal 1, runner._vcpus
178
179
  assert_equal nil, runner._logs
179
180
  end
180
181
 
@@ -184,7 +185,7 @@ class TestMockRunner < MiniTest::Test
184
185
  '/usr/mrd/map-output'
185
186
  assert_equal 256.5, runner._ram_limit
186
187
  assert_equal 64, runner._swap_limit
187
- assert_equal 1.5, runner._vcpus
188
+ assert_equal 1, runner._vcpus
188
189
  assert_equal nil, runner._logs
189
190
  end
190
191
 
@@ -194,7 +195,7 @@ class TestMockRunner < MiniTest::Test
194
195
  '/usr/mrd/map-output'
195
196
  assert_equal 256.5, runner._ram_limit
196
197
  assert_equal 64, runner._swap_limit
197
- assert_equal 1.5, runner._vcpus
198
+ assert_equal 1, runner._vcpus
198
199
  assert_equal nil, runner._logs
199
200
  end
200
201
 
@@ -204,7 +205,7 @@ class TestMockRunner < MiniTest::Test
204
205
  '/usr/mrd/map-output'
205
206
  assert_equal 256.5, runner._ram_limit
206
207
  assert_equal 0, runner._swap_limit
207
- assert_equal 1.5, runner._vcpus
208
+ assert_equal 1, runner._vcpus
208
209
  assert_equal 4.5, runner._logs
209
210
  end
210
211
  end
@@ -17,8 +17,9 @@ class TestRunnerLogic < MiniTest::Test
17
17
  'Memory' => 256.5 * 1024 * 1024,
18
18
  'MemorySwap' => (256.5 + 64) * 1024 * 1024,
19
19
  'MemorySwappiness' => 0,
20
- 'CpuQuota' => 1500000,
20
+ 'CpuQuota' => 1000000,
21
21
  'CpuPeriod' => 1000000,
22
+ 'CpuShares' => 1,
22
23
  'LogConfig' => {
23
24
  'Type' => 'json-file',
24
25
  'Config' => {
data/testdata/job.hello CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "mapper": {
3
3
  "wait_time": 2.5,
4
- "vcpus": 1.5,
4
+ "vcpus": 1,
5
5
  "ram": 256.5,
6
6
  "swap": 64,
7
7
  "logs": 4.5,
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "reducer": {
11
11
  "wait_time": 2,
12
- "vcpus": 0.5,
12
+ "vcpus": 1,
13
13
  "ram": 768.5,
14
14
  "swap": 0,
15
15
  "logs": 6.5,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contained_mr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Costan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-27 00:00:00.000000000 Z
11
+ date: 2016-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.22.4
19
+ version: 1.24.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.22.4
26
+ version: 1.24.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubyzip
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 5.8.0
75
+ version: 5.8.3
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 5.8.0
82
+ version: 5.8.3
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: mocha
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -210,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
210
  version: '0'
211
211
  requirements: []
212
212
  rubyforge_project:
213
- rubygems_version: 2.4.5.1
213
+ rubygems_version: 2.5.1
214
214
  signing_key:
215
215
  specification_version: 4
216
216
  summary: Map-Reduce with Docker containers