forked from czentgr/presto-minio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuselvl_presto
executable file
·92 lines (72 loc) · 3.73 KB
/
uselvl_presto
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/sh
set -e
SCRIPT_DIR=`dirname -- "$( readlink -f -- "$0"; )";`
# Check if PRESTO_TOP env var is set.
# The env var must point to the repro
# directory "presto"
# e.g. $HOME/presto if the "presto" repo
# was cloned into the home directory.
if [ -z ${PRESTO_TOP} ]; then
echo "Set PRESTO_TOP environment variable."
exit 1
fi
if [ -z ${PRESTO_HOME} ]; then
echo "Set PRESTO_HOME environment variable. Where should presto go?"
exit 1
fi
# Setup base dir if it does not exist
if [ ! -d ${PRESTO_HOME} ]; then
mkdir -p ${PRESTO_HOME}/data
fi
# Link in the directories built.
# Some directories are created such as the etc if
# it does not exist.
if [ ! -d ${PRESTO_HOME}/etc/catalog ]; then
mkdir -p ${PRESTO_HOME}/etc
fi
cp -rf ${SCRIPT_DIR}/presto/etc/* ${PRESTO_HOME}/etc
# Replace the container hadoop-master with locahost access to the exposed port
echo "Setting up configuration..."
sed -e 's/hadoop-master/127.0.0.1/' ${PRESTO_HOME}/etc/catalog/minio.properties | tee ${PRESTO_HOME}/etc/catalog/minio.properties
echo ""
# Cleanup of the copy and links except for the configuration in etc.
rm -rf ${PRESTO_HOME}/bin
rm -rf ${PRESTO_HOME}/lib
rm -rf ${PRESTO_HOME}/plugin
rm -rf ${PRESTO_HOME}/NOTICE
rm -rf ${PRESTO_HOME}/README.txt
# Setting up etc for HiveHttpRunner (instead of presto-server)
#if [ ! -d ${PRESTO_HOME}/hrunner-etc ]; then
# mkdir ${PRESTO_HOME}/hrunner-etc
#fi
if [ ! -d ${PRESTO_HOME}/velox-etc ]; then
mkdir ${PRESTO_HOME}/velox-etc
fi
#cp -rf ${SCRIPT_DIR}/presto/etc/* ${PRESTO_HOME}/hrunner-etc
cp -rf ${SCRIPT_DIR}/presto/etc/* ${PRESTO_HOME}/velox-etc
# Setting up the config for regular java presto-server
cp ${PRESTO_HOME}/etc/config.properties.presto-server ${PRESTO_HOME}/etc/config.properties
# Set up HiveRunner coordinator for use with Velox worker
#cp ${PRESTO_HOME}/hrunner-etc/config.properties.hrunner ${PRESTO_HOME}/hrunner-etc/config.properties
#cp ${PRESTO_HOME}/hrunner-etc/node.properties.hrunner ${PRESTO_HOME}/hrunner-etc/node.properties
#rm ${PRESTO_HOME}/hrunner-etc/catalog/*
#cp ${PRESTO_TOP}/presto-native-execution/etc/catalog/* ${PRESTO_HOME}/hrunner-etc/catalog/
# Setting up the config for Velox worker
# Velox worker listens on port 8082 - used for receiving work from the coordinator
cp ${PRESTO_HOME}/velox-etc/config.properties.velox ${PRESTO_HOME}/velox-etc/config.properties
cp ${PRESTO_HOME}/velox-etc/node.properties.velox ${PRESTO_HOME}/velox-etc/node.properties
rm ${PRESTO_HOME}/velox-etc/catalog/*
cp ${PRESTO_TOP}/presto-native-execution/etc/catalog/* ${PRESTO_HOME}/velox-etc/catalog/
# Copy in bin dir (needed because the launcher will look at the config based on its actual location).
# Copy in the presto-cli to communicate with the presto server.
# Link in lib and other files.
cp -r ${PRESTO_TOP}/presto-server/target/presto-server-*-SNAPSHOT/presto-server-*-SNAPSHOT/bin ${PRESTO_HOME}/bin
cp ${PRESTO_TOP}/presto-cli/target/presto-cli-*-SNAPSHOT-executable.jar ${PRESTO_HOME}/bin/presto-cli
cp ${SCRIPT_DIR}/bin/startHiveQueryRunner.sh ${PRESTO_HOME}/bin/startHiveQueryRunner.sh
cp ${SCRIPT_DIR}/bin/startPrestoVeloxWorker.sh ${PRESTO_HOME}/bin/startPrestoVeloxWorker.sh
cp ${SCRIPT_DIR}/bin/runPrestoE2ETest.sh ${PRESTO_HOME}/bin/runPrestoE2ETest.sh
ln -s ${PRESTO_TOP}/presto-server/target/presto-server-*-SNAPSHOT/presto-server-*-SNAPSHOT/lib ${PRESTO_HOME}/lib
ln -s ${PRESTO_TOP}/presto-server/target/presto-server-*-SNAPSHOT/presto-server-*-SNAPSHOT/plugin ${PRESTO_HOME}/plugin
ln -s ${PRESTO_TOP}/presto-server/target/presto-server-*-SNAPSHOT/presto-server-*-SNAPSHOT/NOTICE ${PRESTO_HOME}/NOTICE
ln -s ${PRESTO_TOP}/presto-server/target/presto-server-*-SNAPSHOT/presto-server-*-SNAPSHOT/README.txt ${PRESTO_HOME}/README.txt
echo "uselvl_presto complete in ${PRESTO_HOME}"