<commit_before>#
# Cookbook Name:: bdas
# Recipe:: [Setup a Berkeley Data Analysis Stack Environment]
#
# Copyright 2013, Velankani Information Systems, Inc <EMAIL>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# cookbooksributed under the License is cookbooksributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


include_recipe "java::oracle"

mesos_rpm = node[:bdas][:mesos][:wget_path]
scala_source_path = node[:bdas][:scala][:wget_path]
spark_source_path = node[:bdas][:spark][:wget_path]
scala_dist = node[:bdas][:scala][:dist]
spark_dist = node[:bdas][:spark][:dist]

remote_file "/tmp/#{scala_dist}.tar.gz" do
  source "#{scala_source_path}"
  not_if { File.exists?("/tmp/#{scala_dist}.tar.gz") }
end

remote_file "/tmp/#{spark_dist}.tar.gz" do
  source "#{spark_source_path}"
  not_if { File.exists?("/tmp/#{spark_dist}.tar.gz") }
end

script "Installing Mesos" do
  interpreter "bash"
  code <<-EOH
  rpm -ivh #{mesos_rpm}
  EOH
  
  not_if "rpm -qa | egrep 'mesos'"
end

script "Installing Scala" do
  interpreter "bash"
  code <<-EOH
  tar -zxvf /tmp/#{scala_dist}.tar.gz -C /usr/local/
  EOH
  
  not_if "/usr/local/#{scala_dist}"
end


# template "/etc/hadoop/conf/core-site.xml" do
#   source "core-site.xml.erb"
#   mode 0644
# end<commit_msg>Updates<commit_after>#
# Cookbook Name:: bdas
# Recipe:: [Setup a Berkeley Data Analysis Stack Environment]
#
# Copyright 2013, Velankani Information Systems, Inc <EMAIL>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# cookbooksributed under the License is cookbooksributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


include_recipe "java::oracle"

mesos_rpm = node[:bdas][:mesos][:wget_path]
scala_source_path = node[:bdas][:scala][:wget_path]
spark_source_path = node[:bdas][:spark][:wget_path]
scala_dist = node[:bdas][:scala][:dist]
spark_dist = node[:bdas][:spark][:dist]

remote_file "/tmp/#{scala_dist}.tar.gz" do
  source "#{scala_source_path}"
  not_if { File.exists?("/tmp/#{scala_dist}.tar.gz") }
end

remote_file "/tmp/#{spark_dist}.tar.gz" do
  source "#{spark_source_path}"
  not_if { File.exists?("/tmp/#{spark_dist}.tar.gz") }
end

script "Installing Mesos" do
  interpreter "bash"
  code <<-EOH
  rpm -ivh #{mesos_rpm}
  EOH
  
  not_if "rpm -qa | egrep 'mesos'"
end

script "Installing Scala" do
  interpreter "bash"
  code <<-EOH
  tar -zxvf /tmp/#{scala_dist}.tar.gz -C /usr/local/
  EOH
  
  not_if { File.exists?("/usr/local/#{scala_dist}") }
end


# template "/etc/hadoop/conf/core-site.xml" do
#   source "core-site.xml.erb"
#   mode 0644
# end
{'fraction_non_alphanumeric': 0.13791044776119402, 'fraction_numerical': 0.007164179104477612, 'mean_word_length': 4.4754901960784315, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5916289', 'n_tokens_mistral': 1230, 'n_tokens_neox': 1160, 'n_words': 335}