You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/04/27 14:15:53 UTC
incubator-tinkerpop git commit: Added init-tp-spark.sh to console
distribution.
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/TINKERPOP-1272 [created] 51eba35d4
Added init-tp-spark.sh to console distribution.
This shell script was referenced in the docs but was not contained in the console zip. Moved the source location of the script to spark-gremlin as that seemed consistent with how things were being done for external configuration files (i.e. hadoop-gremlin config stuff).
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/51eba35d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/51eba35d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/51eba35d
Branch: refs/heads/TINKERPOP-1272
Commit: 51eba35d48cc47614682a5e7987be748df1d9109
Parents: 5f9d2f9
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 27 08:13:47 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 27 08:13:47 2016 -0400
----------------------------------------------------------------------
bin/init-tp-spark.sh | 75 --------------------
.../reference/implementations-hadoop.asciidoc | 2 +-
gremlin-console/src/assembly/distribution.xml | 9 +++
gremlin-console/src/assembly/standalone.xml | 5 ++
spark-gremlin/src/main/bin/init-tp-spark.sh | 75 ++++++++++++++++++++
5 files changed, 90 insertions(+), 76 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eba35d/bin/init-tp-spark.sh
----------------------------------------------------------------------
diff --git a/bin/init-tp-spark.sh b/bin/init-tp-spark.sh
deleted file mode 100755
index 51eca6b..0000000
--- a/bin/init-tp-spark.sh
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/bash
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you 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 distributed under the License is distributed 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.
-#
-
-if [ -z $2 ]; then
- echo
- echo "Usage:"
- echo
- echo " $0 SPARK_HOME SPARK_NODE_1 SPARK_NODE_2 ..."
- echo
- echo "Example:"
- echo
- echo " $0 /usr/local/spark-1.5.2-bin-hadoop2.6 spark@master spark@slave1 spark@slave2 spark@slave3"
- echo
- exit 1
-fi
-
-if [ -z ${HADOOP_GREMLIN_LIBS} ]; then
- echo
- echo "HADOOP_GREMLIN_LIBS is not set; thus no jars to deploy."
- echo
- exit 1
-fi
-
-LOCAL_SPARK_GREMLIN_LIBS=$(tr ':' $'\n' <<< ${HADOOP_GREMLIN_LIBS} | grep 'spark-gremlin')
-LIB_DIRNAME="hadoop-gremlin-libs"
-TMP_DIR=/tmp/init-tp-spark
-TMP_DIR2=${TMP_DIR}/${LIB_DIRNAME}
-
-mkdir -p ${TMP_DIR2}
-cp -R ${LOCAL_SPARK_GREMLIN_LIBS}/*.jar ${TMP_DIR2}
-
-DIR=`dirname $0`
-
-SPARK_HOME=${1}
-SPARK_LIBS=${SPARK_HOME}/lib
-SPARK_NODES=${@:2}
-
-cat > ${TMP_DIR}/init-conf.sh <<EOF
-#!/bin/bash
-
-if [ ! -f "${SPARK_HOME}/conf/spark-env.sh" ]; then
- cp ${SPARK_HOME}/conf/spark-env.sh.template ${SPARK_HOME}/conf/spark-env.sh
-fi
-grep -F GREMLIN_LIBS ${SPARK_HOME}/conf/spark-env.sh > /dev/null || {
- echo >> ${SPARK_HOME}/conf/spark-env.sh
- echo "GREMLIN_LIBS=\\\$(find ${SPARK_LIBS}/${LIB_DIRNAME} -name '*.jar' | paste -sd ':')" >> ${SPARK_HOME}/conf/spark-env.sh
- echo "export SPARK_CLASSPATH=\\\${SPARK_CLASSPATH}:\\\${GREMLIN_LIBS}" >> ${SPARK_HOME}/conf/spark-env.sh
-}
-EOF
-
-for node in ${SPARK_NODES}
-do
- rsync -az --delete ${TMP_DIR2} ${node}:${SPARK_LIBS}
- ssh ${node} "bash -s" -- < ${TMP_DIR}/init-conf.sh
-done
-
-rm -rf ${TMP_DIR}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eba35d/docs/src/reference/implementations-hadoop.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/implementations-hadoop.asciidoc b/docs/src/reference/implementations-hadoop.asciidoc
index 41b003d..8c591e2 100644
--- a/docs/src/reference/implementations-hadoop.asciidoc
+++ b/docs/src/reference/implementations-hadoop.asciidoc
@@ -283,7 +283,7 @@ Furthermore the `lib/` directory should be distributed across all machines in th
provides a helper script, which takes the Spark installation directory and the the Spark machines as input:
[source,shell]
-bin/init-tp-spark.sh /usr/local/spark spark@10.0.0.1 spark@10.0.0.2 spark@10.0.0.3
+bin/hadoop/init-tp-spark.sh /usr/local/spark spark@10.0.0.1 spark@10.0.0.2 spark@10.0.0.3
Once the `lib/` directory is distributed, `SparkGraphComputer` can be used as follows.
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eba35d/gremlin-console/src/assembly/distribution.xml
----------------------------------------------------------------------
diff --git a/gremlin-console/src/assembly/distribution.xml b/gremlin-console/src/assembly/distribution.xml
index bb3e77d..ab161fb 100644
--- a/gremlin-console/src/assembly/distribution.xml
+++ b/gremlin-console/src/assembly/distribution.xml
@@ -30,6 +30,15 @@ limitations under the License.
</includes>
</fileSet>
<fileSet>
+ <fileMode>0775</fileMode>
+ <directory>target/apache-${project.artifactId}-${project.version}-standalone/bin/hadoop</directory>
+ <outputDirectory>bin/hadoop</outputDirectory>
+ <includes>
+ <include>*.sh</include>
+ <include>*.bat</include>
+ </includes>
+ </fileSet>
+ <fileSet>
<directory>src/main/static/licenses</directory>
<outputDirectory>licenses</outputDirectory>
</fileSet>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eba35d/gremlin-console/src/assembly/standalone.xml
----------------------------------------------------------------------
diff --git a/gremlin-console/src/assembly/standalone.xml b/gremlin-console/src/assembly/standalone.xml
index ca27a51..e4115d5 100644
--- a/gremlin-console/src/assembly/standalone.xml
+++ b/gremlin-console/src/assembly/standalone.xml
@@ -28,6 +28,11 @@ limitations under the License.
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
+ <directory>../spark-gremlin/src/main/bin</directory>
+ <outputDirectory>/bin/hadoop</outputDirectory>
+ <fileMode>0755</fileMode>
+ </fileSet>
+ <fileSet>
<directory>conf</directory>
<outputDirectory>/conf</outputDirectory>
</fileSet>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eba35d/spark-gremlin/src/main/bin/init-tp-spark.sh
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/main/bin/init-tp-spark.sh b/spark-gremlin/src/main/bin/init-tp-spark.sh
new file mode 100755
index 0000000..51eca6b
--- /dev/null
+++ b/spark-gremlin/src/main/bin/init-tp-spark.sh
@@ -0,0 +1,75 @@
+#!/bin/bash
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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 distributed under the License is distributed 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.
+#
+
+if [ -z $2 ]; then
+ echo
+ echo "Usage:"
+ echo
+ echo " $0 SPARK_HOME SPARK_NODE_1 SPARK_NODE_2 ..."
+ echo
+ echo "Example:"
+ echo
+ echo " $0 /usr/local/spark-1.5.2-bin-hadoop2.6 spark@master spark@slave1 spark@slave2 spark@slave3"
+ echo
+ exit 1
+fi
+
+if [ -z ${HADOOP_GREMLIN_LIBS} ]; then
+ echo
+ echo "HADOOP_GREMLIN_LIBS is not set; thus no jars to deploy."
+ echo
+ exit 1
+fi
+
+LOCAL_SPARK_GREMLIN_LIBS=$(tr ':' $'\n' <<< ${HADOOP_GREMLIN_LIBS} | grep 'spark-gremlin')
+LIB_DIRNAME="hadoop-gremlin-libs"
+TMP_DIR=/tmp/init-tp-spark
+TMP_DIR2=${TMP_DIR}/${LIB_DIRNAME}
+
+mkdir -p ${TMP_DIR2}
+cp -R ${LOCAL_SPARK_GREMLIN_LIBS}/*.jar ${TMP_DIR2}
+
+DIR=`dirname $0`
+
+SPARK_HOME=${1}
+SPARK_LIBS=${SPARK_HOME}/lib
+SPARK_NODES=${@:2}
+
+cat > ${TMP_DIR}/init-conf.sh <<EOF
+#!/bin/bash
+
+if [ ! -f "${SPARK_HOME}/conf/spark-env.sh" ]; then
+ cp ${SPARK_HOME}/conf/spark-env.sh.template ${SPARK_HOME}/conf/spark-env.sh
+fi
+grep -F GREMLIN_LIBS ${SPARK_HOME}/conf/spark-env.sh > /dev/null || {
+ echo >> ${SPARK_HOME}/conf/spark-env.sh
+ echo "GREMLIN_LIBS=\\\$(find ${SPARK_LIBS}/${LIB_DIRNAME} -name '*.jar' | paste -sd ':')" >> ${SPARK_HOME}/conf/spark-env.sh
+ echo "export SPARK_CLASSPATH=\\\${SPARK_CLASSPATH}:\\\${GREMLIN_LIBS}" >> ${SPARK_HOME}/conf/spark-env.sh
+}
+EOF
+
+for node in ${SPARK_NODES}
+do
+ rsync -az --delete ${TMP_DIR2} ${node}:${SPARK_LIBS}
+ ssh ${node} "bash -s" -- < ${TMP_DIR}/init-conf.sh
+done
+
+rm -rf ${TMP_DIR}