Commit b9f5d141 authored by Marco Mariani's avatar Marco Mariani

hadoop: deploy tar in instance, not SR

parent 207570a3
#!/bin/bash
# exit on error
set -e
source environment.sh
echo cp -a $HADOOP_PREFIX/etc ${buildout:directory}/
[buildout] [buildout]
parts = parts =
deploy-config
sh-environment sh-environment
put-files put-files
mapper mapper
reducer reducer
run-demo run-demo
start-daemons
deploy-tar
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
...@@ -18,29 +19,37 @@ recipe = collective.recipe.template ...@@ -18,29 +19,37 @@ recipe = collective.recipe.template
output = $${buildout:directory}/environment.sh output = $${buildout:directory}/environment.sh
input = inline: input = inline:
export JAVA_HOME="${java:location}" export JAVA_HOME="${java:location}"
export HADOOP_PREFIX="${hadoop:location}" export HADOOP_PREFIX="$${directories:hadoop-prefix}"
export PATH=$PATH:$HADOOP_PREFIX/bin export PATH="$PATH:$HADOOP_PREFIX/bin"
export HADOOP_HOME="${hadoop:location} " export HADOOP_HOME="$HADOOP_PREFIX"
export HADOOP_COMMON_HOME="${hadoop:location}" export HADOOP_COMMON_HOME="$HADOOP_PREFIX"
export HADOOP_CONF_DIR="$${buildout:directory}/etc/hadoop" export HADOOP_CONF_DIR="$HADOOP_PREFIX/etc/"
export HADOOP_HDFS_HOME="${hadoop:location}" export HADOOP_HDFS_HOME="$HADOOP_PREFIX"
export HADOOP_MAPRED_HOME="${hadoop:location}" export HADOOP_MAPRED_HOME="$HADOOP_PREFIX"
export HADOOP_YARN_HOME="${hadoop:location}" export HADOOP_YARN_HOME="$HADOOP_PREFIX"
[deploy-tar]
recipe = plone.recipe.command
update = true
command =
[ -d $${directories:hadoop-prefix}/bin} ] || tar xf ${hadoop:location}/${hadoop:filename} -C $${directories:hadoop-prefix} --strip-components=1
[deploy-config]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/deploy-config.sh.in [directories]
output = $${buildout:directory}/deploy-config.sh recipe = slapos.cookbook:mkdirectory
# md5sum = bin = $${buildout:directory}/bin
mode = 0755 etc = $${buildout:directory}/etc
hadoop-prefix = $${buildout:directory}/hadoop
services = $${directories:etc}/service
promises = $${directories:etc}/promise
[put-files] [put-files]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/put-files.sh.in url = ${:_profile_base_location_}/template/bin/put-files.sh.in
output = $${buildout:directory}/put-files.sh output = $${directories:bin}/put-files.sh
# md5sum = # md5sum =
mode = 0755 mode = 0755
...@@ -49,23 +58,30 @@ mode = 0755 ...@@ -49,23 +58,30 @@ mode = 0755
[mapper] [mapper]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/gutenberg-mapper.py.in url = ${:_profile_base_location_}/template/bin/gutenberg-mapper.py.in
output = $${buildout:directory}/gutenberg-mapper.py output = $${directories:bin}/gutenberg-mapper.py
# md5sum = # md5sum =
mode = 0755 mode = 0755
[reducer] [reducer]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/gutenberg-reducer.py.in url = ${:_profile_base_location_}/template/bin/gutenberg-reducer.py.in
output = $${buildout:directory}/gutenberg-reducer.py output = $${directories:bin}/gutenberg-reducer.py
# md5sum = # md5sum =
mode = 0755 mode = 0755
[run-demo] [run-demo]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/run-demo.sh.in url = ${:_profile_base_location_}/template/bin/run-demo.sh.in
output = $${buildout:directory}/run-demo.sh output = $${directories:bin}/run-demo.sh
# md5sum =
mode = 0755
[start-daemons]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template/bin/start-daemons.sh.in
output = $${directories:bin}/start-daemons.sh
# md5sum = # md5sum =
mode = 0755 mode = 0755
...@@ -25,8 +25,11 @@ eggs = ...@@ -25,8 +25,11 @@ eggs =
[hadoop] [hadoop]
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = http://apache.mirrors.spacedump.net/hadoop/common/stable/hadoop-2.2.0.tar.gz filename = hadoop-2.2.0.tar.gz
url = http://apache.mirrors.spacedump.net/hadoop/common/stable/${:filename}
md5sum = 25f27eb0b5617e47c032319c0bfd9962 md5sum = 25f27eb0b5617e47c032319c0bfd9962
download-only = true
mode = 0644
strip-top-level-dir = true strip-top-level-dir = true
...@@ -35,6 +38,7 @@ recipe = hexagonit.recipe.download ...@@ -35,6 +38,7 @@ recipe = hexagonit.recipe.download
url = http://repo1.maven.org/maven2/org/apache/hadoop/hadoop-streaming/0.20.203.0/hadoop-streaming-0.20.203.0.jar url = http://repo1.maven.org/maven2/org/apache/hadoop/hadoop-streaming/0.20.203.0/hadoop-streaming-0.20.203.0.jar
download-only = true download-only = true
#md5sum = #md5sum =
mode = 0644
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment