Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #131 and use of Quantum 2.1.51 #132

Merged
merged 9 commits into from
Dec 9, 2016
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ subprojects {
warp10Version['crypto'] = commonVersion
warp10Version['token'] = commonVersion

quantumVersion = '2.1.49'
quantumVersion = '2.1.51'

stagingUser = project.hasProperty('stagingUser') ? project.property('stagingUser') : System.getenv('STAGING_USER')
stagingURL = project.hasProperty('stagingURL') ? project.property('stagingURL') : System.getenv('STAGING_URL')
Expand Down
28 changes: 16 additions & 12 deletions warp10/src/main/sh/warp10-standalone.init
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fi
QUANTUM_REVISION=@QUANTUM_VERSION@
QUANTUM_PLUGIN_JAR=${WARP10_HOME}/bin/warp10-quantum-plugin-${QUANTUM_REVISION}.jar
QUANTUM_PLUGIN_NAME=io.warp10.plugins.quantum.QuantumPlugin
QUANTUM_START=true
QUANTUM_STARTED=true

WARP10_REVISION=@VERSION@
WARP10_USER=warp10
Expand All @@ -53,6 +53,8 @@ WARP10_HEAP=1g
WARP10_HEAP_MAX=1g
INITCONFIG=false

LEVELDB_HOME=${WARP10_HOME}/data

SENSISION_EVENTS_DIR=/var/run/sensision/metrics

LOG4J_CONF=${WARP10_HOME}/etc/log4j.properties
Expand Down Expand Up @@ -142,11 +144,6 @@ start() {
exit 1
fi

if [ "`su ${WARP10_USER} -c "${JAVA_HOME}/bin/jps -lm|grep warp10-quantum-server-${QUANTUM_REVISION}|cut -f 1 -d' '"`" != "" ]; then
echo "Start failed! - A Quantum instance is currently running"
exit 1
fi

#
# Config file exists ?
#
Expand All @@ -155,14 +152,21 @@ start() {
initConfig
fi

LEVELDB_HOME="`su ${WARP10_USER} -c "${JAVA_HOME}/bin/java -Xms64m -Xmx64m -XX:+UseG1GC -cp ${WARP10_CP} io.warp10.WarpConfig ${WARP10_CONFIG} 'leveldb.home'" | grep 'leveldb.home' | sed -e 's/^.*=//'`"

#
# Leveldb exists ?
#
if [ "$(find -L ${WARP10_HOME}/data -maxdepth 1 -type f | wc -l)" -eq 0 ]; then
if [ ! -e ${LEVELDB_HOME} ]; then
echo "${LEVELDB_HOME} does not exist - Creating it..."
su ${WARP10_USER} -c "mkdir -p ${LEVELDB_HOME} 2>&1"
fi

if [ "$(find -L ${LEVELDB_HOME} -maxdepth 1 -type f | wc -l)" -eq 0 ]; then
echo "Init leveldb"
# Create leveldb database
su ${WARP10_USER} -c "echo \"Init leveldb database...\" >> ${WARP10_HOME}/logs/warp10.log"
su ${WARP10_USER} -c "${JAVA_HOME}/bin/java ${JAVA_OPTS} -cp ${WARP10_CP} ${WARP10_INIT} ${WARP10_HOME}/data >> ${WARP10_HOME}/logs/warp10.log 2>&1"
su ${WARP10_USER} -c "${JAVA_HOME}/bin/java ${JAVA_OPTS} -cp ${WARP10_CP} ${WARP10_INIT} ${LEVELDB_HOME} >> ${WARP10_HOME}/logs/warp10.log 2>&1"
fi

WARP10_LISTENSTO_HOST="`su ${WARP10_USER} -c "${JAVA_HOME}/bin/java -Xms64m -Xmx64m -XX:+UseG1GC -cp ${WARP10_CP} io.warp10.WarpConfig ${WARP10_CONFIG} 'standalone.host'" | grep 'standalone.host' | sed -e 's/^.*=//'`"
Expand All @@ -175,12 +179,12 @@ start() {
QUANTUM_PLUGIN="`su ${WARP10_USER} -c "${JAVA_HOME}/bin/java -Xms64m -Xmx64m -XX:+UseG1GC -cp ${WARP10_CP} io.warp10.WarpConfig ${WARP10_CONFIG} 'warp10.plugins'" | grep ${QUANTUM_PLUGIN_NAME}`"

if [ "$QUANTUM_PLUGIN" != "" ]; then
QUANTUM_START=true
QUANTUM_STARTED=true
QUANTUM_LISTENSTO_HOST="`su ${WARP10_USER} -c "${JAVA_HOME}/bin/java -Xms64m -Xmx64m -XX:+UseG1GC -cp ${WARP10_CP} io.warp10.WarpConfig ${WARP10_CONFIG} 'quantum.host'" | grep 'quantum.host' | sed -e 's/^.*=//'`"
QUANTUM_LISTENSTO_PORT="`su ${WARP10_USER} -c "${JAVA_HOME}/bin/java -Xms64m -Xmx64m -XX:+UseG1GC -cp ${WARP10_CP} io.warp10.WarpConfig ${WARP10_CONFIG} 'quantum.port'" | grep 'quantum.port' | sed -e 's/^.*=//'`"
QUANTUM_LISTENSTO="${QUANTUM_LISTENSTO_HOST}:${QUANTUM_LISTENSTO_PORT}"
else
QUANTUM_START=false
QUANTUM_STARTED=false
# Delete Quantum from CP
WARP10_CP=etc:${WARP10_JAR}
fi
Expand All @@ -205,7 +209,7 @@ start() {
echo "##"
echo "## Warp 10 listens on ${WARP10_LISTENSTO}"
echo "##"
if [ "$QUANTUM_START" = true ]; then
if [ "$QUANTUM_STARTED" = true ]; then
echo "## Quantum listens on ${QUANTUM_LISTENSTO}"
echo "##"
fi
Expand All @@ -229,7 +233,7 @@ start() {
echo "##"
echo "## curl http://${WARP10_LISTENSTO}/api/v0/exec --data-binary @path/to/WarpScriptFile"
echo "##"
if [ "$QUANTUM_START" = true ]; then
if [ "$QUANTUM_STARTED" = true ]; then
echo "## The alternative to command-line interaction is Quantum, a web application to interact with the platform in an user-friendly way:"
echo "##"
echo "## http://${QUANTUM_LISTENSTO}"
Expand Down