-
Notifications
You must be signed in to change notification settings - Fork 0
/
local-runme.sh
executable file
·72 lines (50 loc) · 1.53 KB
/
local-runme.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#! /usr/bin/env bash
echo "Clean directory..."
rm -rf scratch
rm inception.jar
rm nmr-eames.jar
echo "Clean HDFS..."
hadoop fs -rmr /tmp/inceptions
hadoop fs -rmr /tmp/outputs
echo "Generate computation steps in scratch."
mkdir scratch
cd scratch
# Framework is compiled into buildbin
echo "Compile framework into scratch."
mkdir buildbin
javac -d -Xlint -classpath $HADOOP_HOME/hadoop-core-0.20.204.0.jar:$HADOOP_HOME/lib/commons-cli-1.2.jar -d buildbin ../framework/uk/ac/ed/inf/nmr/*/*.java
echo "Compiling the classes into a jar!"
ls -Rl buildbin
echo " "
echo "Compile classes into jar"
jar cvf nmr-eames.jar -C buildbin .
echo " "
echo " ================== Compile User Code with NMR ================== "
echo " "
ls -l
echo "Composing layer-2"
mkdir layer-2
mkdir layer-1
javac -Xlint -classpath $HADOOP_HOME/hadoop-core-0.20.204.0.jar:$HADOOP_HOME/lib/commons-cli-1.2.jar:./nmr-eames.jar -d layer-2 ../src/*.java
mv nmr-eames.jar ../
cp -r buildbin/uk layer-2
mkdir layer-2/lib
ls -l layer-2
echo " "
echo " ================== Moving all code in layer-1 ================== "
echo " "
cp -r layer-2/* layer-1/
jar cvf inception.jar -C layer-2 .
mv inception.jar layer-1/lib/
ls -Rl layer-1
echo " "
echo " ================== JARing code and ship it ================== "
echo " "
jar cvf inception.jar -C layer-1 .
mv inception.jar ../
cd ../
ls -l scratch/layer-1
echo " "
echo " ================== Submitted to cluster ! ================== "
echo " "
hadoop jar inception.jar MRMain -D mapred.reduce.tasks=1 /tmp/nestin /tmp/outputs