contained_mr 0.1.0 → 0.1.1

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: 92996839ff48bb11fd7dd367fe661163a7b33c25
4
- data.tar.gz: f44046ae3b61c5c10fc9dfbe0311a48b725e26fd
3
+ metadata.gz: c256acd59c0cb4cafca0aa814733eba82b076b06
4
+ data.tar.gz: 86164b32282388fa75d53310f62437082e32d801
5
5
  SHA512:
6
- metadata.gz: b570c230d4c6c5a2a74bffbda9e88667bfe8f2a420e6b992b8bc4368d94e4fecc12b5541b6090d5dba5e6376cf1abffb342ed0dd0da1ef254fe5f3ee97f261d0
7
- data.tar.gz: c296cc24c02982f2018f968f6338db78af78a32c9140a0c885c2ca2f1fd711a62b8c39166539021ffee870de044a26b45aa3337967b8f371bcb23af5200a92cb
6
+ metadata.gz: 3b4e879f960930faf614cff7398e380eb52fe0e2fafc254e2fa7e2fc6832b3746fa61425ed72fcd782fdee9b3d2d58bd439f3b0a056861f404b0b5daba0b32b7
7
+ data.tar.gz: dfd206cfcf2ddc73b3747659131363cf787dfda94444b45a62235629dcad23e404beed38609acefdaafab7e23f36237007bf2e7828580dad890428cd25638b45
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'docker-api', '>= 1.22.3', require: 'docker'
3
+ gem 'docker-api', '>= 1.22.4', require: 'docker'
4
4
  gem 'rubyzip', '>= 1.1.7', require: 'zip'
5
5
 
6
6
  # Add dependencies to develop your gem here.
data/Gemfile.lock CHANGED
@@ -6,7 +6,7 @@ GEM
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.3)
9
+ docker-api (1.22.4)
10
10
  excon (>= 0.38.0)
11
11
  json
12
12
  excon (0.45.4)
@@ -64,7 +64,7 @@ PLATFORMS
64
64
 
65
65
  DEPENDENCIES
66
66
  bundler (>= 1.6.1)
67
- docker-api (>= 1.22.3)
67
+ docker-api (>= 1.22.4)
68
68
  jeweler (>= 2.0.1)
69
69
  minitest
70
70
  rdoc (>= 3.12)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -0,0 +1,88 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: contained_mr 0.1.1 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "contained_mr"
9
+ s.version = "0.1.1"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["Victor Costan"]
14
+ s.date = "2015-09-03"
15
+ s.description = "Plumbing for running mappers and reducers inside Docker containers"
16
+ s.email = "victor@costan.us"
17
+ s.extra_rdoc_files = [
18
+ "LICENSE",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "LICENSE",
26
+ "README.rdoc",
27
+ "Rakefile",
28
+ "VERSION",
29
+ "contained_mr.gemspec",
30
+ "lib/contained_mr.rb",
31
+ "lib/contained_mr/cleaner.rb",
32
+ "lib/contained_mr/job.rb",
33
+ "lib/contained_mr/runner.rb",
34
+ "lib/contained_mr/template.rb",
35
+ "test/helper.rb",
36
+ "test/test_job.rb",
37
+ "test/test_runner.rb",
38
+ "test/test_template.rb",
39
+ "testdata/Dockerfile.hello.mapper",
40
+ "testdata/Dockerfile.hello.reducer",
41
+ "testdata/hello/Dockerfile",
42
+ "testdata/hello/data/goodbye.txt",
43
+ "testdata/hello/data/hello.txt",
44
+ "testdata/hello/mapper.sh",
45
+ "testdata/hello/mapreduced.yml",
46
+ "testdata/hello/reducer.sh",
47
+ "testdata/input.hello",
48
+ "testdata/job.hello"
49
+ ]
50
+ s.homepage = "http://github.com/pwnall/contained_mr"
51
+ s.licenses = ["MIT"]
52
+ s.rubygems_version = "2.4.5"
53
+ s.summary = "Map-Reduce with Docker containers"
54
+
55
+ if s.respond_to? :specification_version then
56
+ s.specification_version = 4
57
+
58
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
59
+ s.add_runtime_dependency(%q<docker-api>, [">= 1.22.4"])
60
+ s.add_runtime_dependency(%q<rubyzip>, [">= 1.1.7"])
61
+ s.add_development_dependency(%q<minitest>, [">= 0"])
62
+ s.add_development_dependency(%q<yard>, [">= 0.7"])
63
+ s.add_development_dependency(%q<rdoc>, [">= 3.12"])
64
+ s.add_development_dependency(%q<bundler>, [">= 1.6.1"])
65
+ s.add_development_dependency(%q<jeweler>, [">= 2.0.1"])
66
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
67
+ else
68
+ s.add_dependency(%q<docker-api>, [">= 1.22.4"])
69
+ s.add_dependency(%q<rubyzip>, [">= 1.1.7"])
70
+ s.add_dependency(%q<minitest>, [">= 0"])
71
+ s.add_dependency(%q<yard>, [">= 0.7"])
72
+ s.add_dependency(%q<rdoc>, [">= 3.12"])
73
+ s.add_dependency(%q<bundler>, [">= 1.6.1"])
74
+ s.add_dependency(%q<jeweler>, [">= 2.0.1"])
75
+ s.add_dependency(%q<simplecov>, [">= 0"])
76
+ end
77
+ else
78
+ s.add_dependency(%q<docker-api>, [">= 1.22.4"])
79
+ s.add_dependency(%q<rubyzip>, [">= 1.1.7"])
80
+ s.add_dependency(%q<minitest>, [">= 0"])
81
+ s.add_dependency(%q<yard>, [">= 0.7"])
82
+ s.add_dependency(%q<rdoc>, [">= 3.12"])
83
+ s.add_dependency(%q<bundler>, [">= 1.6.1"])
84
+ s.add_dependency(%q<jeweler>, [">= 2.0.1"])
85
+ s.add_dependency(%q<simplecov>, [">= 0"])
86
+ end
87
+ end
88
+
@@ -104,12 +104,16 @@ DOCKER_END
104
104
  Zip::File.open_buffer zip_io.read do |zip|
105
105
  zip.each do |zip_entry|
106
106
  file_name = zip_entry.name
107
- if file_name == 'mapreduced.yml'
108
- read_definition zip_entry.get_input_stream
109
- next
110
- end
111
- tar.add_file file_name, 0644 do |tar_file_io|
112
- IO.copy_stream zip_entry.get_input_stream, tar_file_io
107
+ if zip_entry.directory?
108
+ tar.mkdir file_name, 0755
109
+ elsif zip_entry.file?
110
+ if file_name == 'mapreduced.yml'
111
+ read_definition zip_entry.get_input_stream
112
+ next
113
+ end
114
+ tar.add_file file_name, 0644 do |tar_file_io|
115
+ IO.copy_stream zip_entry.get_input_stream, tar_file_io
116
+ end
113
117
  end
114
118
  end
115
119
  end
data/test/helper.rb CHANGED
@@ -37,8 +37,11 @@ Zip::File.open('testdata/hello.zip', Zip::File::CREATE) do |zip|
37
37
  files = Dir.chdir('testdata/hello') { Dir.glob('**/*') }.sort
38
38
  files.each do |file|
39
39
  path = File.join 'testdata/hello', file
40
- next unless File.file?(path)
41
- zip.add file, path
40
+ if File.directory? path
41
+ zip.mkdir file
42
+ elsif File.file? path
43
+ zip.add file, path
44
+ end
42
45
  end
43
46
  end
44
47
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contained_mr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Costan
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.22.3
19
+ version: 1.22.4
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.3
26
+ version: 1.22.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubyzip
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -137,6 +137,7 @@ files:
137
137
  - README.rdoc
138
138
  - Rakefile
139
139
  - VERSION
140
+ - contained_mr.gemspec
140
141
  - lib/contained_mr.rb
141
142
  - lib/contained_mr/cleaner.rb
142
143
  - lib/contained_mr/job.rb