itamae-plugin-recipe-spark 0.1.4 → 0.1.5

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
  SHA256:
3
- metadata.gz: a942c57a61e3be0a5d65916011b4c4a93ccce2665152f480cb4a5d79fd07a415
4
- data.tar.gz: 1f8bf34d5120a62bedd9f245dff03a62956e31e17d90839cda8ec68df478b4e6
3
+ metadata.gz: 201de04bbae7c37fcb100e26b798361d35f7064b2809e01e1a34b1efb2e0768b
4
+ data.tar.gz: 92cf7328ac3cd04c97f948e6fb8ccb10e114040d03ac50bc8556ecb8b60e5d9b
5
5
  SHA512:
6
- metadata.gz: d2a4069326bbcdccf2e57a6470299d5111576c43aa7614527b24ec89abd81939adf830a55033e227caeb4d429e6a26d93fd8382bfbe18919d92374f91530da15
7
- data.tar.gz: 945aa06cf08dbf9523cbb9e339d8e33073127c66b0eff1abf230ebdbc33096bc93391f98a34ae4272dd1d3e4dda32eead921814a6f40322c1c8a4486be5ef69b
6
+ metadata.gz: 90e5650f5f509b8f29d2bde84b16df9f11278f8b9d2ff3f099e920f1728423c957dea0d29b698d229a8ec32dfe4196d4e3ae32aa8f5e53126929b1b6e6c0ad3f
7
+ data.tar.gz: 7f84c85db7a99f58fe1036483dc81157b2eba1f1f857b612ab26607110f9bf09cd75c94df74376c5c0f701ad830d2b38c987d5b4bfb6c97535780c8ffc0c0122
@@ -1,13 +1,20 @@
1
1
  version = ENV['SPARK_VERSION'] || Itamae::Plugin::Recipe::Spark::SPARK_VERSION
2
2
  hadoop_version = ENV['HADOOP_VERSION'] || Itamae::Plugin::Recipe::Hadoop::HADOOP_VERSION
3
+ hadoop_type = if Gem::Version.create(hadoop_version) >= Gem::Version.create('3.2')
4
+ '3.2'
5
+ elsif Gem::Version.create(hadoop_version) >= Gem::Version.create('2.7')
6
+ '2.7'
7
+ else
8
+ raise "Hadoop version #{hadoop_version} is not supported."
9
+ end
3
10
 
4
11
  execute "download spark-#{version}" do
5
12
  cwd '/tmp'
6
13
  command <<-EOF
7
- rm -f spark-#{version}-bin-hadoop2.7.tgz
8
- wget https://archive.apache.org/dist/spark/spark-#{version}/spark-#{version}-bin-hadoop2.7.tgz
14
+ rm -f spark-#{version}-bin-hadoop#{hadoop_type}.tgz
15
+ wget https://archive.apache.org/dist/spark/spark-#{version}/spark-#{version}-bin-hadoop#{hadoop_type}.tgz
9
16
  EOF
10
- not_if "test -e /opt/spark/spark-#{version}-bin-hadoop2.7/INSTALLED || echo #{::File.read(::File.join(::File.dirname(__FILE__), "spark-#{version}_sha256.txt")).strip} | sha256sum -c"
17
+ not_if "test -e /opt/spark/spark-#{version}-bin-hadoop#{hadoop_type}/INSTALLED || echo #{::File.read(::File.join(::File.dirname(__FILE__), "spark-#{version}_hadoop_#{hadoop_type}_sha256.txt")).strip} | sha256sum -c"
11
18
  end
12
19
 
13
20
  directory '/opt/spark' do
@@ -20,37 +27,37 @@ end
20
27
  execute "install spark-#{version}" do
21
28
  cwd '/tmp'
22
29
  command <<-EOF
23
- rm -Rf spark-#{version}-bin-hadoop2.7/
24
- tar zxf spark-#{version}-bin-hadoop2.7.tgz
25
- sudo rm -Rf /opt/spark/spark-#{version}-bin-hadoop2.7
26
- sudo mv spark-#{version}-bin-hadoop2.7 /opt/spark/
27
- sudo touch /opt/spark/spark-#{version}-bin-hadoop2.7/INSTALLED
30
+ rm -Rf spark-#{version}-bin-hadoop#{hadoop_type}/
31
+ tar zxf spark-#{version}-bin-hadoop#{hadoop_type}.tgz
32
+ sudo rm -Rf /opt/spark/spark-#{version}-bin-hadoop#{hadoop_type}
33
+ sudo mv spark-#{version}-bin-hadoop#{hadoop_type} /opt/spark/
34
+ sudo touch /opt/spark/spark-#{version}-bin-hadoop#{hadoop_type}/INSTALLED
28
35
  EOF
29
- not_if "test -e /opt/spark/spark-#{version}-bin-hadoop2.7/INSTALLED"
36
+ not_if "test -e /opt/spark/spark-#{version}-bin-hadoop#{hadoop_type}/INSTALLED"
30
37
  end
31
38
 
32
39
  execute 'install hadoop aws jars' do
33
40
  cwd '/opt/hadoop/current'
34
41
  command <<-EOF
35
42
  cp -f share/hadoop/tools/lib/aws-java-sdk-*.jar \
36
- /opt/spark/spark-#{version}-bin-hadoop2.7/jars/
43
+ /opt/spark/spark-#{version}-bin-hadoop#{hadoop_type}/jars/
37
44
  cp -f share/hadoop/tools/lib/hadoop-aws-#{hadoop_version}.jar \
38
- /opt/spark/spark-#{version}-bin-hadoop2.7/jars/
45
+ /opt/spark/spark-#{version}-bin-hadoop#{hadoop_type}/jars/
39
46
  EOF
40
- not_if "test `ls -1 /opt/spark/spark-#{version}-bin-hadoop2.7/jars/ | egrep '(hadoop-)?aws-.*' | wc -l` = 4"
47
+ not_if "test `ls -1 /opt/spark/spark-#{version}-bin-hadoop#{hadoop_type}/jars/ | egrep '(hadoop-)?aws-.*' | wc -l` = 4"
41
48
  end
42
49
 
43
- template "/opt/spark/spark-#{version}-bin-hadoop2.7/conf/spark-defaults.conf"
50
+ template "/opt/spark/spark-#{version}-bin-hadoop#{hadoop_type}/conf/spark-defaults.conf"
44
51
 
45
52
  if ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
46
- template "/opt/spark/spark-#{version}-bin-hadoop2.7/conf/hdfs-site.xml" do
53
+ template "/opt/spark/spark-#{version}-bin-hadoop#{hadoop_type}/conf/hdfs-site.xml" do
47
54
  variables aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
48
55
  aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY']
49
56
  end
50
57
  end
51
58
 
52
59
  link '/opt/spark/current' do
53
- to "/opt/spark/spark-#{version}-bin-hadoop2.7"
60
+ to "/opt/spark/spark-#{version}-bin-hadoop#{hadoop_type}"
54
61
  user 'root'
55
62
  force true
56
63
  end
@@ -0,0 +1 @@
1
+ e2d05efa1c657dd5180628a83ea36c97c00f972b4aee935b7affa2e1058b0279 spark-3.0.1-bin-hadoop3.2.tgz
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module Spark
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
 
7
7
  SPARK_VERSION = [
8
8
  SPARK_VERSION_MAJOR = '3',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-spark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichylinux
@@ -92,16 +92,17 @@ files:
92
92
  - itamae-plugin-recipe-spark.gemspec
93
93
  - lib/itamae/plugin/recipe/spark.rb
94
94
  - lib/itamae/plugin/recipe/spark/install.rb
95
- - lib/itamae/plugin/recipe/spark/spark-2.2.0_sha256.txt
96
- - lib/itamae/plugin/recipe/spark/spark-2.3.1_sha256.txt
97
- - lib/itamae/plugin/recipe/spark/spark-2.3.2_sha256.txt
98
- - lib/itamae/plugin/recipe/spark/spark-2.4.0_sha256.txt
99
- - lib/itamae/plugin/recipe/spark/spark-2.4.3_sha256.txt
100
- - lib/itamae/plugin/recipe/spark/spark-2.4.4_sha256.txt
101
- - lib/itamae/plugin/recipe/spark/spark-2.4.5_sha256.txt
102
- - lib/itamae/plugin/recipe/spark/spark-2.4.6_sha256.txt
103
- - lib/itamae/plugin/recipe/spark/spark-2.4.7_sha256.txt
104
- - lib/itamae/plugin/recipe/spark/spark-3.0.1_sha256.txt
95
+ - lib/itamae/plugin/recipe/spark/spark-2.2.0_hadoop_2.7_sha256.txt
96
+ - lib/itamae/plugin/recipe/spark/spark-2.3.1_hadoop_2.7_sha256.txt
97
+ - lib/itamae/plugin/recipe/spark/spark-2.3.2_hadoop_2.7_sha256.txt
98
+ - lib/itamae/plugin/recipe/spark/spark-2.4.0_hadoop_2.7_sha256.txt
99
+ - lib/itamae/plugin/recipe/spark/spark-2.4.3_hadoop_2.7_sha256.txt
100
+ - lib/itamae/plugin/recipe/spark/spark-2.4.4_hadoop_2.7_sha256.txt
101
+ - lib/itamae/plugin/recipe/spark/spark-2.4.5_hadoop_2.7_sha256.txt
102
+ - lib/itamae/plugin/recipe/spark/spark-2.4.6_hadoop_2.7_sha256.txt
103
+ - lib/itamae/plugin/recipe/spark/spark-2.4.7_hadoop_2.7_sha256.txt
104
+ - lib/itamae/plugin/recipe/spark/spark-3.0.1_hadoop_2.7_sha256.txt
105
+ - lib/itamae/plugin/recipe/spark/spark-3.0.1_hadoop_3.2_sha256.txt
105
106
  - lib/itamae/plugin/recipe/spark/templates/hdfs-site.xml.erb
106
107
  - lib/itamae/plugin/recipe/spark/templates/spark-defaults.conf.erb
107
108
  - lib/itamae/plugin/recipe/spark/version.rb