contained_mr 0.3.3 → 0.3.4
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 +3 -3
- data/lib/contained_mr/runner.rb +22 -4
- data/test/helper.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa36265b30cbc358e74b368ebdf5cf9a90c6ebaa
|
4
|
+
data.tar.gz: f10177d6247c5be5e24c7c47cc72e1511f1805d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be014222e385e4b87ac25e5d4e979bd1931b1d6f3ffc304543a11fab3857fb82030eca49d68818c8d3ffe33366518d7b178e77af96c546459afd2e3200afe4d5
|
7
|
+
data.tar.gz: 9a31100c13d897147cd0ca6bef0dc53fd5109d701b0dc4c6c3a5bd469a246d7385e5fe71d33a9e93124c679bc82ef97424048a430159e8f41c79c7ad2063990d
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.4
|
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.3.
|
5
|
+
# stub: contained_mr 0.3.4 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.4"
|
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-
|
14
|
+
s.date = "2015-10-13"
|
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 = [
|
data/lib/contained_mr/runner.rb
CHANGED
@@ -87,10 +87,28 @@ class ContainedMr::Runner
|
|
87
87
|
#
|
88
88
|
# @param {Docker::Container} container the mapper / reducer's container
|
89
89
|
def fetch_console_output(container)
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
90
|
+
stdout_buffer = []
|
91
|
+
stderr_buffer = []
|
92
|
+
container.streaming_logs stdout: true, stderr: true,
|
93
|
+
since: 0, timestamps: false, tail: false do |stream, chunk|
|
94
|
+
case stream
|
95
|
+
when :stdout
|
96
|
+
stdout_buffer << chunk
|
97
|
+
when :stderr
|
98
|
+
stderr_buffer << chunk
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
@stdout = stdout_buffer.join ''
|
103
|
+
@stderr = stderr_buffer.join ''
|
104
|
+
|
105
|
+
# NOTE: The method below is simpler, but hangs on Swarm.
|
106
|
+
# https://github.com/docker/swarm/issues/1284
|
107
|
+
#
|
108
|
+
# messages = container.attach stream: false, logs: true, stdin: nil,
|
109
|
+
# stdout: true, stderr: true
|
110
|
+
# @stdout = messages[0].join ''
|
111
|
+
# @stderr = messages[1].join ''
|
94
112
|
end
|
95
113
|
private :fetch_console_output
|
96
114
|
|
data/test/helper.rb
CHANGED
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.3.
|
4
|
+
version: 0.3.4
|
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-
|
11
|
+
date: 2015-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docker-api
|