Skip to content
Permalink
Browse files
Workflow distribution
  • Loading branch information
DImuthuUpe committed Aug 11, 2021
1 parent 1b8273d commit 65d01f2e2600a976acdbdcb95ec6ffd8fc6a30e1
Show file tree
Hide file tree
Showing 24 changed files with 1,328 additions and 2 deletions.
@@ -63,6 +63,29 @@
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.1</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven.assembly.plugin}</version>
<executions>
<execution>
<id>wf-manager-package</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<tarLongFileMode>posix</tarLongFileMode>
<finalName>WF-Manager-${project.version}</finalName>
<descriptors>
<descriptor>src/main/dist/wf-manager-assembly.xml</descriptor>
</descriptors>
<attach>false</attach>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

@@ -0,0 +1,46 @@
#!/bin/sh

# 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.

# resolve links - $0 may be a softlink
PRG="$0"

while [ -h "$PRG" ]; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '.*/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done

PRGDIR=`dirname "$PRG"`

# Only set AIRAVATA_HOME if not already set
[ -z "$AIRAVATA_HOME" ] && AIRAVATA_HOME=`cd "$PRGDIR/.." ; pwd`

AIRAVATA_CLASSPATH=""

for f in "$AIRAVATA_HOME"/lib/*.jar
do
AIRAVATA_CLASSPATH="$AIRAVATA_CLASSPATH":$f
done

export AIRAVATA_HOME
export AIRAVATA_CLASSPATH
@@ -0,0 +1,113 @@
#!/usr/bin/env 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.

. `dirname $0`/setenv.sh
# Capture user's working dir before changing directory
CWD="$PWD"
cd ${AIRAVATA_HOME}/bin
LOGO_FILE="logo.txt"

JAVA_OPTS="-Dspring.config.location=${AIRAVATA_HOME}/conf/ -Dairavata.home=${AIRAVATA_HOME} -Dlogback.configurationFile=file:${AIRAVATA_HOME}/conf/logback.xml"
AIRAVATA_COMMAND=""
EXTRA_ARGS=""
SERVERS=""
LOGO=true
IS_SUBSET=false
SUBSET=""
DEFAULT_LOG_FILE="${AIRAVATA_HOME}/logs/airavata-daemon.out"
LOG_FILE=$DEFAULT_LOG_FILE

SERVICE_NAME="Workflow Manager"
PID_PATH_NAME="${AIRAVATA_HOME}/bin/service-pid"

case $1 in
start)
echo "Starting $SERVICE_NAME ..."
if [ ! -f $PID_PATH_NAME ]; then
nohup java ${JAVA_OPTS} -classpath "${AIRAVATA_CLASSPATH}" \
org.apache.airavata.datalake.workflow.engine.wm.datasync.WorkflowManagerRunner ${AIRAVATA_COMMAND} $* > $LOG_FILE 2>&1 &
echo $! > $PID_PATH_NAME
echo "$SERVICE_NAME started ..."
else
echo "$SERVICE_NAME is already running ..."
fi
;;
stop)
if [ -f $PID_PATH_NAME ]; then
PID=$(cat $PID_PATH_NAME);
echo "$SERVICE_NAME stoping ..."
kill $PID;
RETRY=0
while kill -0 $PID 2> /dev/null; do
echo "Waiting for the process $PID to be stopped"
RETRY=`expr ${RETRY} + 1`
if [ "${RETRY}" -gt "20" ]
then
echo "Forcefully killing the process as it is not responding ..."
kill -9 $PID
fi
sleep 1
done
echo "$SERVICE_NAME stopped ..."
rm $PID_PATH_NAME
else
echo "$SERVICE_NAME is not running ..."
fi
;;
restart)
if [ -f $PID_PATH_NAME ]; then
PID=$(cat $PID_PATH_NAME);
echo "$SERVICE_NAME stopping ...";
kill $PID;
RETRY=0
while kill -0 $PID 2> /dev/null; do
echo "Waiting for the process $PID to be stopped"
RETRY=`expr ${RETRY} + 1`
if [ "${RETRY}" -gt "20" ]
then
echo "Forcefully killing the process as it is not responding ..."
kill -9 $PID
fi
sleep 1
done
echo "$SERVICE_NAME stopped ...";
rm $PID_PATH_NAME
echo "$SERVICE_NAME starting ..."
nohup java ${JAVA_OPTS} -classpath "${AIRAVATA_CLASSPATH}" \
org.apache.airavata.datalake.workflow.engine.wm.datasync.WorkflowManagerRunner ${AIRAVATA_COMMAND} $* > $LOG_FILE 2>&1 &
echo $! > $PID_PATH_NAME
echo "$SERVICE_NAME started ..."
else
echo "$SERVICE_NAME is not running ..."
fi
;;
-h)
echo "Usage: wf-manager-daemon.sh"

echo "command options:"
echo " start Start server in daemon mode"
echo " stop Stop server running in daemon mode"
echo " restart Restart server in daemon mode"
echo " -log <LOG_FILE> Where to redirect stdout/stderr (defaults to $DEFAULT_LOG_FILE)"
echo " -h Display this help and exit"
shift
exit 0
;;
esac

@@ -0,0 +1,71 @@
#!/usr/bin/env 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.

. `dirname $0`/setenv.sh
# Capture user's working dir before changing directory
CWD="$PWD"
cd ${AIRAVATA_HOME}/bin
LOGO_FILE="logo.txt"

JAVA_OPTS="-Dspring.config.location=${AIRAVATA_HOME}/conf/ -Dairavata.home=${AIRAVATA_HOME} -Dlogback.configurationFile=file:${AIRAVATA_HOME}/conf/logback.xml"
AIRAVATA_COMMAND=""
EXTRA_ARGS=""
SERVERS=""
IS_SUBSET=false
SUBSET=""
DEFAULT_LOG_FILE="${AIRAVATA_HOME}/logs/console.out"
LOG_FILE=$DEFAULT_LOG_FILE

# parse command arguments
for var in "$@"
do
case ${var} in
-xdebug)
AIRAVATA_COMMAND="${AIRAVATA_COMMAND}"
JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000"
shift
;;
-log)
shift
LOG_FILE="$1"
shift
# If relative path, expand to absolute path using the user's $CWD
if [ -z "`echo "$LOG_FILE" | egrep "^/"`" ]; then
LOG_FILE="${CWD}/${LOG_FILE}"
fi
;;
-h)
echo "Usage: wf-manager.sh"

echo "command options:"
echo " -xdebug Start Workflow Manager under JPDA debugger"
echo " -h Display this help and exit"
shift
exit 0
;;
*)
EXTRA_ARGS="${EXTRA_ARGS} ${var}"
shift
;;
esac
done

java ${JAVA_OPTS} -classpath "${AIRAVATA_CLASSPATH}" \
org.apache.airavata.datalake.workflow.engine.wm.datasync.WorkflowManagerRunner ${AIRAVATA_COMMAND} $*

@@ -0,0 +1,48 @@
#
# 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.
#

cluster.name=datalake
zookeeper.connection=localhost:2181

datasync.wm.name=datasync_wf
parsing.wm.name=parsing_wf

kafka.url=localhost:9092
kafka.mft.publisher.name=mft-status-publisher
kafka.mft.status.publish.topic=mft-status-topic
kafka.mft.status.consumer.group=mft-even-group

datasync.wm.grpc.host=localhost
datasync.wm.grpc.port=6565
spring.config.use-legacy-processing=true

mft.callback.url=localhost:33335
mft.host=localhost
mft.port=7004
mft.clientId=CHANGE_ME
mft.clientSecret=CHANGE_ME

custos.host=custos.scigap.org
custos.port=31499
custos.id=CHANGE_ME
custos.secret=CHANGE_ME

drms.host=localhost
drms.port=7070
server.port=88991
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<configuration>

<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d [%t] %-5p %c{30} %m [%X]%n</pattern>
</encoder>
</appender>

<appender name="LOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>../logs/airavata.log</File>
<Append>true</Append>
<encoder>
<pattern>%d [%t] %-5p %c{30} %m [%X]%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>../logs/airavata.log.%d{yyyy-MM-dd}</fileNamePattern>
<maxHistory>30</maxHistory>
<totalSizeCap>1GB</totalSizeCap>
</rollingPolicy>
</appender>

<logger name="ch.qos.logback" level="WARN"/>
<logger name="org.apache.helix" level="WARN"/>
<logger name="org.apache.zookeeper" level="ERROR"/>
<logger name="org.apache.helix" level="ERROR"/>
<logger name="org.apache.airavata" level="INFO"/>
<logger name="org.hibernate" level="ERROR"/>
<logger name="net.schmizz.sshj" level="WARN"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="LOGFILE"/>
</root>
</configuration>

0 comments on commit 65d01f2

Please sign in to comment.