This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/master by this push:
     new 4febeff575 Adding the distribution for connection service
4febeff575 is described below

commit 4febeff5754d612f40a5a7440099be0529425fe9
Author: Dimuthu Wannipurage <[email protected]>
AuthorDate: Sun Jul 21 09:23:31 2024 -0400

    Adding the distribution for connection service
---
 modules/agent-framework/connection-service/pom.xml |  38 ++++---
 .../assembly/connection-service-bin-assembly.xml   |  90 +++++++++++++++++
 .../distribution/bin/connection-service-daemon.sh  | 112 +++++++++++++++++++++
 .../distribution/bin/connection-service.sh         |  70 +++++++++++++
 .../src/main/resources/distribution/bin/setenv.sh  |  46 +++++++++
 .../resources/distribution/conf/application.yml    |  19 ++++
 .../resources/distribution/conf/truststore.jks     | Bin 0 -> 1654 bytes
 7 files changed, 360 insertions(+), 15 deletions(-)

diff --git a/modules/agent-framework/connection-service/pom.xml 
b/modules/agent-framework/connection-service/pom.xml
index 525c4aa7e5..619c872692 100644
--- a/modules/agent-framework/connection-service/pom.xml
+++ b/modules/agent-framework/connection-service/pom.xml
@@ -24,6 +24,7 @@
         <protobuf.version>3.23.4</protobuf.version>
         <protobuf-plugin.version>0.6.1</protobuf-plugin.version>
         <grpc.version>1.63.0</grpc.version>
+        
<connection.service.dist.name>Connection-Service-0.01</connection.service.dist.name>
     </properties>
 
     <dependencyManagement>
@@ -91,6 +92,28 @@
         </extensions>
 
         <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>${maven.assembly.plugin}</version>
+                <executions>
+                    <execution>
+                        <id>mft-controller-distribution-package</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <tarLongFileMode>posix</tarLongFileMode>
+                            
<finalName>${connection.service.dist.name}</finalName>
+                            <descriptors>
+                                
<descriptor>src/main/assembly/connection-service-bin-assembly.xml</descriptor>
+                            </descriptors>
+                            <attach>false</attach>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <groupId>org.xolstice.maven.plugins</groupId>
                 <artifactId>protobuf-maven-plugin</artifactId>
@@ -117,21 +140,6 @@
                     <target>14</target>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <version>${spring.boot.version}</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <executable>true</executable>
-                </configuration>
-            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-remote-resources-plugin</artifactId>
diff --git 
a/modules/agent-framework/connection-service/src/main/assembly/connection-service-bin-assembly.xml
 
b/modules/agent-framework/connection-service/src/main/assembly/connection-service-bin-assembly.xml
new file mode 100644
index 0000000000..38d8f1c565
--- /dev/null
+++ 
b/modules/agent-framework/connection-service/src/main/assembly/connection-service-bin-assembly.xml
@@ -0,0 +1,90 @@
+
+<!--
+
+    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.
+
+-->
+<!DOCTYPE assembly [
+        <!ELEMENT assembly 
(id|includeBaseDirectory|baseDirectory|formats|fileSets|dependencySets)*>
+        <!ELEMENT id (#PCDATA)>
+        <!ELEMENT includeBaseDirectory (#PCDATA)>
+        <!ELEMENT baseDirectory (#PCDATA)>
+        <!ELEMENT formats (format)*>
+        <!ELEMENT format (#PCDATA)>
+        <!ELEMENT fileSets (fileSet)*>
+        <!ELEMENT fileSet (directory|outputDirectory|fileMode|includes)*>
+        <!ELEMENT directory (#PCDATA)>
+        <!ELEMENT outputDirectory (#PCDATA)>
+        <!ELEMENT includes (include)*>
+        <!ELEMENT include (#PCDATA)>
+        <!ELEMENT dependencySets (dependencySet)*>
+        <!ELEMENT dependencySet 
(outputDirectory|outputFileNameMapping|includes)*>
+        ]>
+<assembly>
+    <id>bin</id>
+    <includeBaseDirectory>true</includeBaseDirectory>
+    <baseDirectory>${connection.service.dist.name}</baseDirectory>
+    <formats>
+        <format>tar.gz</format>
+        <format>zip</format>
+    </formats>
+
+    <fileSets>
+        <fileSet>
+            <directory>src/main/resources/distribution/bin</directory>
+            <outputDirectory>bin</outputDirectory>
+            <fileMode>777</fileMode>
+            <includes>
+                <include>*.sh</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>src/main/resources/distribution/conf</directory>
+            <outputDirectory>conf</outputDirectory>
+            <includes>
+                <include>application.yml</include>
+                <include>truststore.jks</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>./</directory>
+            <outputDirectory>logs</outputDirectory>
+            <excludes>
+                <exclude>*/**</exclude>
+            </excludes>
+        </fileSet>
+        <fileSet>
+            <directory>target</directory>
+            <outputDirectory>lib</outputDirectory>
+            <includes>
+                <include>*.jar</include>
+            </includes>
+        </fileSet>
+    </fileSets>
+
+    <dependencySets>
+        <dependencySet>
+            <useProjectArtifact>false</useProjectArtifact>
+            <outputDirectory>lib</outputDirectory>
+            <includes>
+                <include>*</include>
+            </includes>
+        </dependencySet>
+    </dependencySets>
+
+</assembly>
diff --git 
a/modules/agent-framework/connection-service/src/main/resources/distribution/bin/connection-service-daemon.sh
 
b/modules/agent-framework/connection-service/src/main/resources/distribution/bin/connection-service-daemon.sh
new file mode 100644
index 0000000000..63a4a0e767
--- /dev/null
+++ 
b/modules/agent-framework/connection-service/src/main/resources/distribution/bin/connection-service-daemon.sh
@@ -0,0 +1,112 @@
+#!/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="--airavata.server.truststore.path=${AIRAVATA_HOME}/conf/truststore.jks
 -Dspring.config.location=${AIRAVATA_HOME}/conf/ 
-Dairavata.home=${AIRAVATA_HOME} 
-Dlog4j.configurationFile=file:${AIRAVATA_HOME}/conf/log4j2.xml"
+AIRAVATA_COMMAND="--airavata.server.truststore.path=${AIRAVATA_HOME}/conf/truststore.jks"
+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="Connection Service"
+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.agent.connection.service.ConnectionServiceApplication 
${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 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
+        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.agent.connection.service.ConnectionServiceApplication 
${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: connection-service-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
\ No newline at end of file
diff --git 
a/modules/agent-framework/connection-service/src/main/resources/distribution/bin/connection-service.sh
 
b/modules/agent-framework/connection-service/src/main/resources/distribution/bin/connection-service.sh
new file mode 100644
index 0000000000..c725442b86
--- /dev/null
+++ 
b/modules/agent-framework/connection-service/src/main/resources/distribution/bin/connection-service.sh
@@ -0,0 +1,70 @@
+#!/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} 
-Dlog4j.configurationFile=file:${AIRAVATA_HOME}/conf/log4j2.xml"
+AIRAVATA_COMMAND="--airavata.server.truststore.path=${AIRAVATA_HOME}/conf/truststore.jks"
+EXTRA_ARGS=""
+SERVERS=""
+IS_SUBSET=false
+SUBSET=""
+DEFAULT_LOG_FILE="${AIRAVATA_HOME}/logs/airavata.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: connection-service.sh"
+
+            echo "command options:"
+            echo "  -xdebug             Start Connection Service 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.agent.connection.service.ConnectionServiceApplication 
${AIRAVATA_COMMAND} $*
\ No newline at end of file
diff --git 
a/modules/agent-framework/connection-service/src/main/resources/distribution/bin/setenv.sh
 
b/modules/agent-framework/connection-service/src/main/resources/distribution/bin/setenv.sh
new file mode 100644
index 0000000000..3f1d7632bf
--- /dev/null
+++ 
b/modules/agent-framework/connection-service/src/main/resources/distribution/bin/setenv.sh
@@ -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
\ No newline at end of file
diff --git 
a/modules/agent-framework/connection-service/src/main/resources/distribution/conf/application.yml
 
b/modules/agent-framework/connection-service/src/main/resources/distribution/conf/application.yml
new file mode 100644
index 0000000000..b7f87714ed
--- /dev/null
+++ 
b/modules/agent-framework/connection-service/src/main/resources/distribution/conf/application.yml
@@ -0,0 +1,19 @@
+grpc:
+  server:
+    port: 19900
+
+server:
+  port: 18880
+  address: 0.0.0.0
+
+airavata:
+  server:
+    url: scigap02.sciencegateways.iu.edu
+    port: 9930
+    truststore:
+      path: 
/Users/lahiruj/Projects/airavata/lahiruj/modules/agent-framework/connection-service/src/main/resources/trustore.jks
+  storageResourceId: gf4.ucs.indiana.edu_61552681-96f0-462a-a36c-a62a010bffc6
+  cluster:
+    applicationInterfaceId:
+      expanse: AiravataAgent_f4313e4d-20c2-4bf6-bff1-8aa0f0b0c1d6
+      jetstream: AiravataAgent_f4313e4d-20c2-4bf6-bff1-xcver3343
diff --git 
a/modules/agent-framework/connection-service/src/main/resources/distribution/conf/truststore.jks
 
b/modules/agent-framework/connection-service/src/main/resources/distribution/conf/truststore.jks
new file mode 100644
index 0000000000..7006e55ba6
Binary files /dev/null and 
b/modules/agent-framework/connection-service/src/main/resources/distribution/conf/truststore.jks
 differ

Reply via email to