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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb47353419e6a56f1246d06934b63c123edfb442
4
- data.tar.gz: 594990cbb031cd9e9298832c0374b2d76e81196d
3
+ metadata.gz: aa36265b30cbc358e74b368ebdf5cf9a90c6ebaa
4
+ data.tar.gz: f10177d6247c5be5e24c7c47cc72e1511f1805d3
5
5
  SHA512:
6
- metadata.gz: b0bd1266cfdbaf5d1b24757d8bf52e37a0780b5912d78bf987c1f0b50247874709a832ad7aaec06649d7b8b80ca48c58f301bed0d91ea9632041d20ec697ca9b
7
- data.tar.gz: 2925db33e8bb0179a80b7e93968c6728139d1b4735dc86918fd30d72a50f8355b3ba8d372357cfab01d2f16bb5ce15f77fffff4bf4cc8c5487fb7eb7c4f9d86f
6
+ metadata.gz: be014222e385e4b87ac25e5d4e979bd1931b1d6f3ffc304543a11fab3857fb82030eca49d68818c8d3ffe33366518d7b178e77af96c546459afd2e3200afe4d5
7
+ data.tar.gz: 9a31100c13d897147cd0ca6bef0dc53fd5109d701b0dc4c6c3a5bd469a246d7385e5fe71d33a9e93124c679bc82ef97424048a430159e8f41c79c7ad2063990d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.3
1
+ 0.3.4
@@ -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.3 ruby lib
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.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-12"
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 = [
@@ -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
- messages = container.attach stream: false, logs: true, stdin: nil,
91
- stdout: true, stderr: true
92
- @stdout = messages[0].join ''
93
- @stderr = messages[1].join ''
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
 
@@ -47,5 +47,6 @@ end
47
47
  end
48
48
  end
49
49
  end
50
+ ContainedMr::Cleaner.new('contained_mrtests').destroy_all!
50
51
 
51
52
  MiniTest.autorun
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.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-12 00:00:00.000000000 Z
11
+ date: 2015-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api