You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2020/04/02 16:39:30 UTC

[airavata-mft] branch master updated: Adding build and local execution scripts

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-mft.git


The following commit(s) were added to refs/heads/master by this push:
     new 75494b3  Adding build and local execution scripts
75494b3 is described below

commit 75494b3ab13758caf993fd9cc388bd82cf540431
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Thu Apr 2 12:39:13 2020 -0400

    Adding build and local execution scripts
---
 .gitignore                                         |  4 +-
 .../distribution/bin/api-service-daemon.sh         |  2 +-
 .../main/resources/distribution/bin/api-service.sh |  4 +-
 .../distribution/bin/controller-daemon.sh          |  2 +-
 .../main/resources/distribution/bin/controller.sh  |  4 +-
 pom.xml                                            |  2 +-
 scripts/build.sh                                   | 33 ++++++++++++++
 scripts/log.sh                                     | 52 ++++++++++++++++++++++
 scripts/start-consul.sh                            | 46 +++++++++++++++++++
 scripts/start-mft.sh                               | 24 ++++++++++
 scripts/stop-consul.sh                             | 27 +++++++++++
 scripts/stop-mft.sh                                | 24 ++++++++++
 services/resource-service/server/pom.xml           |  5 +++
 .../src/main/resources/application.properties      |  1 +
 .../resources/distribution/bin/resource-service.sh |  4 +-
 .../resources/distribution/bin/secret-service.sh   |  4 +-
 16 files changed, 226 insertions(+), 12 deletions(-)

diff --git a/.gitignore b/.gitignore
index 57eb21d..c6c0bcc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,4 +29,6 @@ atlassian-ide-plugin.xml
 # generated by Crashlytics plugin (for Android Studio and Intellij)
 com_crashlytics_export_strings.xml
 
-.DS_Store
\ No newline at end of file
+.DS_Store
+
+build/
\ No newline at end of file
diff --git a/api/service/src/main/resources/distribution/bin/api-service-daemon.sh b/api/service/src/main/resources/distribution/bin/api-service-daemon.sh
index 341770e..9480de7 100644
--- a/api/service/src/main/resources/distribution/bin/api-service-daemon.sh
+++ b/api/service/src/main/resources/distribution/bin/api-service-daemon.sh
@@ -33,7 +33,7 @@ SUBSET=""
 DEFAULT_LOG_FILE="${AIRAVATA_HOME}/logs/airavata-daemon.out"
 LOG_FILE=$DEFAULT_LOG_FILE
 
-SERVICE_NAME="MFT Agent"
+SERVICE_NAME="MFT API Service"
 PID_PATH_NAME="${AIRAVATA_HOME}/bin/service-pid"
 
 case $1 in
diff --git a/api/service/src/main/resources/distribution/bin/api-service.sh b/api/service/src/main/resources/distribution/bin/api-service.sh
index ccd77b5..d4de43d 100644
--- a/api/service/src/main/resources/distribution/bin/api-service.sh
+++ b/api/service/src/main/resources/distribution/bin/api-service.sh
@@ -51,10 +51,10 @@ do
             fi
         ;;
         -h)
-            echo "Usage: agent.sh"
+            echo "Usage: api-service.sh"
 
             echo "command options:"
-            echo "  -xdebug             Start MFT Agent under JPDA debugger"
+            echo "  -xdebug             Start MFT API Service under JPDA debugger"
             echo "  -h                  Display this help and exit"
             shift
             exit 0
diff --git a/controller/src/main/resources/distribution/bin/controller-daemon.sh b/controller/src/main/resources/distribution/bin/controller-daemon.sh
index 306119f..4292d11 100644
--- a/controller/src/main/resources/distribution/bin/controller-daemon.sh
+++ b/controller/src/main/resources/distribution/bin/controller-daemon.sh
@@ -33,7 +33,7 @@ SUBSET=""
 DEFAULT_LOG_FILE="${AIRAVATA_HOME}/logs/airavata-daemon.out"
 LOG_FILE=$DEFAULT_LOG_FILE
 
-SERVICE_NAME="MFT Agent"
+SERVICE_NAME="MFT Controller"
 PID_PATH_NAME="${AIRAVATA_HOME}/bin/service-pid"
 
 case $1 in
diff --git a/controller/src/main/resources/distribution/bin/controller.sh b/controller/src/main/resources/distribution/bin/controller.sh
index 5aef420..e0130a1 100644
--- a/controller/src/main/resources/distribution/bin/controller.sh
+++ b/controller/src/main/resources/distribution/bin/controller.sh
@@ -51,10 +51,10 @@ do
             fi
         ;;
         -h)
-            echo "Usage: agent.sh"
+            echo "Usage: controller.sh"
 
             echo "command options:"
-            echo "  -xdebug             Start MFT Agent under JPDA debugger"
+            echo "  -xdebug             Start MFT Controller under JPDA debugger"
             echo "  -h                  Display this help and exit"
             shift
             exit 0
diff --git a/pom.xml b/pom.xml
index c295f44..d577bba 100755
--- a/pom.xml
+++ b/pom.xml
@@ -112,7 +112,7 @@
         <javax.annotation>1.3.2</javax.annotation>
         <consul.client>1.3.8</consul.client>
         <h2>1.4.191</h2>
-        <protobuf.java>3.9.1</protobuf.java>
+        <protobuf.java>3.10.0</protobuf.java>
         <grpc.spring.boot>3.5.1</grpc.spring.boot>
         <spring.boot.data.jpa>2.2.1.RELEASE</spring.boot.data.jpa>
         <log4j.over.slf4j>1.7.26</log4j.over.slf4j>
diff --git a/scripts/build.sh b/scripts/build.sh
new file mode 100755
index 0000000..5bb68ab
--- /dev/null
+++ b/scripts/build.sh
@@ -0,0 +1,33 @@
+#!/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.
+
+cd ../
+mvn clean install
+mkdir -p build
+cp agent/target/MFT-Agent-0.01-bin.zip build/
+cp controller/target/MFT-Controller-0.01-bin.zip build/
+cp services/resource-service/server/target/Resource-Service-0.01-bin.zip build/
+cp services/secret-service/server/target/Secret-Service-0.01-bin.zip build/
+cp api/service/target/API-Service-0.01-bin.zip build/
+
+unzip -o build/MFT-Agent-0.01-bin.zip -d build/
+unzip -o build/MFT-Controller-0.01-bin.zip -d build/
+unzip -o build/Resource-Service-0.01-bin.zip -d build/
+unzip -o build/Secret-Service-0.01-bin.zip -d build/
+unzip -o build/API-Service-0.01-bin.zip -d build/
\ No newline at end of file
diff --git a/scripts/log.sh b/scripts/log.sh
new file mode 100755
index 0000000..b367fc3
--- /dev/null
+++ b/scripts/log.sh
@@ -0,0 +1,52 @@
+#!/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.
+
+case $1 in
+    agent)
+        tail -100f ../build/MFT-Agent-0.01/logs/airavata.log
+    ;;
+    resource)
+        tail -100f ../build/Resource-Service-0.01/logs/airavata.log
+    ;;
+    secret)
+        tail -100f ../build/Secret-Service-0.01/logs/airavata.log
+    ;;
+    api)
+        tail -100f ../build/API-Service-0.01/logs/airavata.log
+    ;;
+    controller)
+        tail -100f ../build/MFT-Controller-0.01/logs/airavata.log
+    ;;
+    consul)
+        tail -100f ../build/consul/consul.log
+    ;;
+    -h)
+        echo "Usage: log.sh"
+
+        echo "command options:"
+        echo "  agent                View logs of MFT Agent"
+        echo "  resource             View logs of MFT Resource Service"
+        echo "  secret               View logs of MFT Secret Service"
+        echo "  api                  View logs of MFT API Service"
+        echo "  controller           View logs of MFT Controller"
+        echo "  -h                   Display this help and exit"
+        shift
+        exit 0
+    ;;
+esac
\ No newline at end of file
diff --git a/scripts/start-consul.sh b/scripts/start-consul.sh
new file mode 100755
index 0000000..4025d6b
--- /dev/null
+++ b/scripts/start-consul.sh
@@ -0,0 +1,46 @@
+#!/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.
+
+PID_PATH_NAME="../build/consul/service-pid"
+LOG_FILE="../build/consul/consul.log"
+
+case $1 in
+    mac)
+        if [ ! -f $PID_PATH_NAME ]; then
+            mkdir -p ../build/consul
+            curl -O https://releases.hashicorp.com/consul/1.7.1/consul_1.7.1_darwin_amd64.zip
+            unzip -o consul_1.7.1_darwin_amd64.zip -d ../build/consul
+            rm consul_1.7.1_darwin_amd64.zip
+            nohup ../build/consul/consul agent -dev > $LOG_FILE 2>&1 &
+            echo $! > $PID_PATH_NAME
+            echo "Consul started"
+        else
+            echo "Consul is already running ..."
+        fi
+    ;;
+    -h)
+        echo "Usage: start-consul.sh"
+
+        echo "command options:"
+        echo "  mac                  Start for mac"
+        echo "  -h                   Display this help and exit"
+        shift
+        exit 0
+    ;;
+esac
\ No newline at end of file
diff --git a/scripts/start-mft.sh b/scripts/start-mft.sh
new file mode 100755
index 0000000..9522ab6
--- /dev/null
+++ b/scripts/start-mft.sh
@@ -0,0 +1,24 @@
+#!/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.
+
+./../build/API-Service-0.01/bin/api-service-daemon.sh start
+./../build/MFT-Controller-0.01/bin/controller-daemon.sh start
+./../build/Resource-Service-0.01/bin/resource-service-daemon.sh start
+./../build/Secret-Service-0.01/bin/secret-service-daemon.sh start
+./../build/MFT-Agent-0.01/bin/agent-daemon.sh start
\ No newline at end of file
diff --git a/scripts/stop-consul.sh b/scripts/stop-consul.sh
new file mode 100755
index 0000000..bcc8654
--- /dev/null
+++ b/scripts/stop-consul.sh
@@ -0,0 +1,27 @@
+#!/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.
+
+PID_PATH_NAME="../build/consul/service-pid"
+
+if [ -f $PID_PATH_NAME ]; then
+    PID=$(cat $PID_PATH_NAME);
+    kill $PID;
+    echo "Consul stopped ..."
+    rm $PID_PATH_NAME
+fi
\ No newline at end of file
diff --git a/scripts/stop-mft.sh b/scripts/stop-mft.sh
new file mode 100755
index 0000000..2061cc0
--- /dev/null
+++ b/scripts/stop-mft.sh
@@ -0,0 +1,24 @@
+#!/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.
+
+./../build/API-Service-0.01/bin/api-service-daemon.sh stop
+./../build/MFT-Controller-0.01/bin/controller-daemon.sh stop
+./../build/Resource-Service-0.01/bin/resource-service-daemon.sh stop
+./../build/Secret-Service-0.01/bin/secret-service-daemon.sh stop
+./../build/MFT-Agent-0.01/bin/agent-daemon.sh stop
\ No newline at end of file
diff --git a/services/resource-service/server/pom.xml b/services/resource-service/server/pom.xml
index 1870c40..3239b55 100644
--- a/services/resource-service/server/pom.xml
+++ b/services/resource-service/server/pom.xml
@@ -59,6 +59,11 @@
             <artifactId>json-simple</artifactId>
             <version>1.1.1</version>
         </dependency>
+        <dependency>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-services</artifactId>
+            <version>1.25.0</version>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/services/resource-service/server/src/main/resources/application.properties b/services/resource-service/server/src/main/resources/application.properties
index d69baaa..37f554e 100644
--- a/services/resource-service/server/src/main/resources/application.properties
+++ b/services/resource-service/server/src/main/resources/application.properties
@@ -17,5 +17,6 @@
 
 server.port=8080
 grpc.port=7002
+grpc.enableReflection=true
 registry.server.host=149.165.170.103
 registry.server.port=8970
\ No newline at end of file
diff --git a/services/resource-service/server/src/main/resources/distribution/bin/resource-service.sh b/services/resource-service/server/src/main/resources/distribution/bin/resource-service.sh
index 0d88366..4db00b7 100644
--- a/services/resource-service/server/src/main/resources/distribution/bin/resource-service.sh
+++ b/services/resource-service/server/src/main/resources/distribution/bin/resource-service.sh
@@ -51,10 +51,10 @@ do
             fi
         ;;
         -h)
-            echo "Usage: agent.sh"
+            echo "Usage: resource-service.sh"
 
             echo "command options:"
-            echo "  -xdebug             Start MFT Agent under JPDA debugger"
+            echo "  -xdebug             Start MFT Resource Service under JPDA debugger"
             echo "  -h                  Display this help and exit"
             shift
             exit 0
diff --git a/services/secret-service/server/src/main/resources/distribution/bin/secret-service.sh b/services/secret-service/server/src/main/resources/distribution/bin/secret-service.sh
index ae729be..c5909b8 100644
--- a/services/secret-service/server/src/main/resources/distribution/bin/secret-service.sh
+++ b/services/secret-service/server/src/main/resources/distribution/bin/secret-service.sh
@@ -51,10 +51,10 @@ do
             fi
         ;;
         -h)
-            echo "Usage: agent.sh"
+            echo "Usage: secret-service.sh"
 
             echo "command options:"
-            echo "  -xdebug             Start MFT Agent under JPDA debugger"
+            echo "  -xdebug             Start MFT Secret Service under JPDA debugger"
             echo "  -h                  Display this help and exit"
             shift
             exit 0