kumogata-template 0.0.13 → 0.0.14
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/Gemfile.lock +11 -11
- data/lib/kumogata/template/emr.rb +39 -1
- data/lib/kumogata/template/version.rb +1 -1
- data/test/emr_test.rb +53 -5
- 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: 2a50c2750395bd793e1bb9210c05e925f6632d4a
|
|
4
|
+
data.tar.gz: d6faff601811cb365049b0880e731de5f9bb6360
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ab98967ab2b353665b672bb35c3eea3edcf12d0670650603784eb80d4ff97cafcc65ae9a54351b42ba23e2f66e2feb7b7c669abbb0d8797f2788cbc9b27d7882
|
|
7
|
+
data.tar.gz: a069fe45f07e2dc691f60881ced851ec96b3922acf67648dc66cbe27440f47b7017baf3319ceef17756185665c80b91e8663c87c8dede9d72577fc086617cff6
|
data/Gemfile.lock
CHANGED
|
@@ -8,13 +8,13 @@ PATH
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
-
aws-sdk (2.6.
|
|
12
|
-
aws-sdk-resources (= 2.6.
|
|
13
|
-
aws-sdk-core (2.6.
|
|
11
|
+
aws-sdk (2.6.44)
|
|
12
|
+
aws-sdk-resources (= 2.6.44)
|
|
13
|
+
aws-sdk-core (2.6.44)
|
|
14
14
|
aws-sigv4 (~> 1.0)
|
|
15
15
|
jmespath (~> 1.0)
|
|
16
|
-
aws-sdk-resources (2.6.
|
|
17
|
-
aws-sdk-core (= 2.6.
|
|
16
|
+
aws-sdk-resources (2.6.44)
|
|
17
|
+
aws-sdk-core (= 2.6.44)
|
|
18
18
|
aws-sdk-v1 (1.66.0)
|
|
19
19
|
json (~> 1.4)
|
|
20
20
|
nokogiri (>= 1.4.4)
|
|
@@ -30,7 +30,7 @@ GEM
|
|
|
30
30
|
hashie (3.4.6)
|
|
31
31
|
highline (1.7.8)
|
|
32
32
|
jmespath (1.3.1)
|
|
33
|
-
json (1.8.
|
|
33
|
+
json (1.8.5)
|
|
34
34
|
json5 (0.0.1)
|
|
35
35
|
kumogata (0.5.10)
|
|
36
36
|
aws-sdk-v1
|
|
@@ -50,16 +50,16 @@ GEM
|
|
|
50
50
|
libv8 (3.16.14.17)
|
|
51
51
|
mini_portile2 (2.1.0)
|
|
52
52
|
minitest (5.10.1)
|
|
53
|
-
net-ssh (
|
|
54
|
-
nokogiri (1.
|
|
53
|
+
net-ssh (4.0.1)
|
|
54
|
+
nokogiri (1.7.0.1)
|
|
55
55
|
mini_portile2 (~> 2.1.0)
|
|
56
56
|
rake (11.3.0)
|
|
57
57
|
ref (2.0.0)
|
|
58
58
|
retryable (2.0.4)
|
|
59
59
|
term-ansicolor (1.4.0)
|
|
60
60
|
tins (~> 1.0)
|
|
61
|
-
therubyracer (0.12.
|
|
62
|
-
libv8 (~> 3.16.14.
|
|
61
|
+
therubyracer (0.12.3)
|
|
62
|
+
libv8 (~> 3.16.14.15)
|
|
63
63
|
ref
|
|
64
64
|
tins (1.13.0)
|
|
65
65
|
uuidtools (2.1.5)
|
|
@@ -74,4 +74,4 @@ DEPENDENCIES
|
|
|
74
74
|
rake (~> 11.1)
|
|
75
75
|
|
|
76
76
|
BUNDLED WITH
|
|
77
|
-
1.13.
|
|
77
|
+
1.13.7
|
|
@@ -4,6 +4,44 @@
|
|
|
4
4
|
require 'kumogata/template/helper'
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
def _emr_to_configurations_default_hadoop_spark(max_age: 14)
|
|
8
|
+
_emr_to_configurations_default_hadoop | _emr_to_configurations_default_spark(max_age: max_age)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def _emr_to_configurations_default_hadoop()
|
|
12
|
+
[
|
|
13
|
+
{
|
|
14
|
+
classification: "hadoop-env",
|
|
15
|
+
properties: {},
|
|
16
|
+
configurations: [
|
|
17
|
+
classification: "export",
|
|
18
|
+
properties: { JAVA_HOME: "/usr/java/default" },
|
|
19
|
+
],
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def _emr_to_configurations_default_spark(max_age: 14)
|
|
25
|
+
[
|
|
26
|
+
{
|
|
27
|
+
classification: "spark-env",
|
|
28
|
+
properties: {},
|
|
29
|
+
configurations: [
|
|
30
|
+
classification: "export",
|
|
31
|
+
properties: { JAVA_HOME: "/usr/java/default" },
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
classification: "spark-defaults",
|
|
36
|
+
properties: {
|
|
37
|
+
"spark.history.fs.cleaner.enabled" => "true",
|
|
38
|
+
"spark.history.fs.cleaner.interval" => "1d",
|
|
39
|
+
"spark.history.fs.cleaner.maxAge" => "#{max_age}d",
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
end
|
|
44
|
+
|
|
7
45
|
def _emr_applications(args)
|
|
8
46
|
applications = args[:applications] || []
|
|
9
47
|
|
|
@@ -174,7 +212,7 @@ def _emr_step_properties(args)
|
|
|
174
212
|
|
|
175
213
|
array = []
|
|
176
214
|
properties.each do |property|
|
|
177
|
-
_{
|
|
215
|
+
array << _{
|
|
178
216
|
Key property[:key]
|
|
179
217
|
Value property[:value]
|
|
180
218
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
KUMOGATA_TEMPLATE_VERSION = '0.0.
|
|
1
|
+
KUMOGATA_TEMPLATE_VERSION = '0.0.14'
|
data/test/emr_test.rb
CHANGED
|
@@ -2,6 +2,54 @@ require 'abstract_unit'
|
|
|
2
2
|
require 'kumogata/template/emr'
|
|
3
3
|
|
|
4
4
|
class EmrTest < Minitest::Test
|
|
5
|
+
def test_emr_to_configurations_default_hadoop_spark
|
|
6
|
+
template = <<-EOS
|
|
7
|
+
Test _emr_to_configurations_default_hadoop_spark(max_age: 1)
|
|
8
|
+
EOS
|
|
9
|
+
act_template = run_client_as_json(template)
|
|
10
|
+
exp_template = <<-EOS
|
|
11
|
+
{
|
|
12
|
+
"Test": [
|
|
13
|
+
{
|
|
14
|
+
"classification": "hadoop-env",
|
|
15
|
+
"properties": {
|
|
16
|
+
},
|
|
17
|
+
"configurations": [
|
|
18
|
+
{
|
|
19
|
+
"classification": "export",
|
|
20
|
+
"properties": {
|
|
21
|
+
"JAVA_HOME": "/usr/java/default"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"classification": "spark-env",
|
|
28
|
+
"properties": {
|
|
29
|
+
},
|
|
30
|
+
"configurations": [
|
|
31
|
+
{
|
|
32
|
+
"classification": "export",
|
|
33
|
+
"properties": {
|
|
34
|
+
"JAVA_HOME": "/usr/java/default"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"classification": "spark-defaults",
|
|
41
|
+
"properties": {
|
|
42
|
+
"spark.history.fs.cleaner.enabled": "true",
|
|
43
|
+
"spark.history.fs.cleaner.interval": "1d",
|
|
44
|
+
"spark.history.fs.cleaner.maxAge": "1d"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
EOS
|
|
50
|
+
assert_equal exp_template.chomp, act_template
|
|
51
|
+
end
|
|
52
|
+
|
|
5
53
|
def test_emr_applications
|
|
6
54
|
template = <<-EOS
|
|
7
55
|
Test _emr_applications(applications: [ { name: "test", version: "test" } ])
|
|
@@ -179,9 +227,9 @@ Test _emr_instance_group({ name: "test" })
|
|
|
179
227
|
assert_equal exp_template.chomp, act_template
|
|
180
228
|
end
|
|
181
229
|
|
|
182
|
-
def
|
|
230
|
+
def test_emr_hadoop_jar_step_config
|
|
183
231
|
template = <<-EOS
|
|
184
|
-
Test
|
|
232
|
+
Test _emr_hadoop_jar_step_config(jar: "test")
|
|
185
233
|
EOS
|
|
186
234
|
act_template = run_client_as_json(template)
|
|
187
235
|
exp_template = <<-EOS
|
|
@@ -194,9 +242,9 @@ Test _emr_hadopo_jar_config(jar: "test")
|
|
|
194
242
|
assert_equal exp_template.chomp, act_template
|
|
195
243
|
end
|
|
196
244
|
|
|
197
|
-
def
|
|
245
|
+
def test_emr_step_properties
|
|
198
246
|
template = <<-EOS
|
|
199
|
-
Test _emr_step_properties([ key: "test", value: "test" ])
|
|
247
|
+
Test _emr_step_properties(step_properties: [ { key: "test", value: "test" } ])
|
|
200
248
|
EOS
|
|
201
249
|
act_template = run_client_as_json(template)
|
|
202
250
|
exp_template = <<-EOS
|
|
@@ -204,7 +252,7 @@ Test _emr_step_properties([ key: "test", value: "test" ])
|
|
|
204
252
|
"Test": [
|
|
205
253
|
{
|
|
206
254
|
"Key": "test",
|
|
207
|
-
"
|
|
255
|
+
"Value": "test"
|
|
208
256
|
}
|
|
209
257
|
]
|
|
210
258
|
}
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kumogata-template
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Naoya Nakazawa
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-01-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aws-sdk
|