You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2017/06/07 18:55:00 UTC

[6/6] airavata git commit: AIRAVATA-2432 Using Docker to run Thrift

AIRAVATA-2432 Using Docker to run Thrift


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/8341d497
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/8341d497
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/8341d497

Branch: refs/heads/thrift-docker
Commit: 8341d4976e4673ed2df38cfb1d997e5a2798c63c
Parents: ff3fc16
Author: Marcus Christie <ma...@apache.org>
Authored: Wed Jun 7 14:49:39 2017 -0400
Committer: Marcus Christie <ma...@apache.org>
Committed: Wed Jun 7 14:54:40 2017 -0400

----------------------------------------------------------------------
 .../generate-thrift-stubs.sh                    | 24 ++++++++------------
 .../service-cpis/generate-service-cpi-stubs.sh  | 14 ++++--------
 2 files changed, 13 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/8341d497/thrift-interface-descriptions/generate-thrift-stubs.sh
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/generate-thrift-stubs.sh b/thrift-interface-descriptions/generate-thrift-stubs.sh
index d78d9d5..3723059 100755
--- a/thrift-interface-descriptions/generate-thrift-stubs.sh
+++ b/thrift-interface-descriptions/generate-thrift-stubs.sh
@@ -46,15 +46,9 @@ then
 	exit 0
 fi
 
-# Generation of thrift files will require installing Apache Thrift. Please add thrift to your path.
-#  Verify is thrift is installed, is in the path is at a specified version.
-
 REQUIRED_THRIFT_VERSION='0.9.3'
-if hash thrift &> /dev/null; then
-  THRIFT_EXEC=$(which thrift)
-else
-  THRIFT_EXEC=/usr/local/bin/thrift
-fi
+THRIFT_DOCKER_IMAGE='thrift'
+THRIFT_EXEC="docker run --rm -v $PWD:/data $THRIFT_DOCKER_IMAGE:$REQUIRED_THRIFT_VERSION thrift"
 
 VERSION=$($THRIFT_EXEC -version 2>/dev/null | grep -F "${REQUIRED_THRIFT_VERSION}" |  wc -l)
 if [ "$VERSION" -ne 1 ] ; then
@@ -68,12 +62,12 @@ AIRAVATA_API_IDL_DIR='airavata-apis'
 BASE_TARGET_DIR='target'
 
 # Thrift files
-AIRAVATA_API_THRIFT_FILE='airavata-apis/airavata_api.thrift'
-DATAMODEL_THRIFT_FILE='data-models/airavata_data_models.thrift'
-APP_CATALOG_THRIFT_FILE='data-models/app-catalog-models/app_catalog_models.thrift'
-RESOURCE_CATALOG_THRIFT_FILE='data-models/resource-catalog-models/resource_catalog_models.thrift'
-WORKFLOW_THRIFT_FILE='data-models/workflow-models/workflow_data_model.thrift'
-PROFILE_SERVICE_THRIFT_FILE='service-cpis/profile-service/profile-service-cpi.thrift'
+AIRAVATA_API_THRIFT_FILE='/data/airavata-apis/airavata_api.thrift'
+DATAMODEL_THRIFT_FILE='/data/data-models/airavata_data_models.thrift'
+APP_CATALOG_THRIFT_FILE='/data/data-models/app-catalog-models/app_catalog_models.thrift'
+RESOURCE_CATALOG_THRIFT_FILE='/data/data-models/resource-catalog-models/resource_catalog_models.thrift'
+WORKFLOW_THRIFT_FILE='/data/data-models/workflow-models/workflow_data_model.thrift'
+PROFILE_SERVICE_THRIFT_FILE='/data/service-cpis/profile-service/profile-service-cpi.thrift'
 
 DATAMODEL_SRC_DIR='../airavata-api/airavata-data-models/src/main/java'
 JAVA_API_SDK_DIR='../airavata-api/airavata-api-stubs/src/main/java'
@@ -84,7 +78,7 @@ PYTHON_SDK_DIR='../airavata-api/airavata-client-sdks/airavata-python-sdk/src/mai
 # Initialize the thrift arguments.
 #  Since most of the Airavata API and Data Models have includes, use recursive option by default.
 #  Generate all the files in target directory
-THRIFT_ARGS="-r -o ${BASE_TARGET_DIR}"
+THRIFT_ARGS="-r -o /data/${BASE_TARGET_DIR}"
 # Ensure the required target directories exists, if not create.
 mkdir -p ${BASE_TARGET_DIR}
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/8341d497/thrift-interface-descriptions/service-cpis/generate-service-cpi-stubs.sh
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/service-cpis/generate-service-cpi-stubs.sh b/thrift-interface-descriptions/service-cpis/generate-service-cpi-stubs.sh
index 82409e0..574bddd 100755
--- a/thrift-interface-descriptions/service-cpis/generate-service-cpi-stubs.sh
+++ b/thrift-interface-descriptions/service-cpis/generate-service-cpi-stubs.sh
@@ -38,15 +38,9 @@ then
 	exit 0
 fi
 
-# Generation of thrift files will require installing Apache Thrift. Please add thrift to your path.
-#  Verify is thrift is installed, is in the path is at a specified version.
-
 REQUIRED_THRIFT_VERSION='0.9.3'
-if hash thrift &> /dev/null; then
-  THRIFT_EXEC=$(which thrift)
-else
-  THRIFT_EXEC=/usr/local/bin/thrift
-fi
+THRIFT_DOCKER_IMAGE='thrift'
+THRIFT_EXEC="docker run --rm -v $PWD/..:/data $THRIFT_DOCKER_IMAGE:$REQUIRED_THRIFT_VERSION thrift"
 
 VERSION=$($THRIFT_EXEC -version 2>/dev/null | grep -F "${REQUIRED_THRIFT_VERSION}" |  wc -l)
 if [ "$VERSION" -ne 1 ] ; then
@@ -58,13 +52,13 @@ fi
 # Global Constants used across the script
 BASE_TARGET_DIR='target'
 
-PROFILE_SERVICE_THRIFT_FILE='profile-service/profile-service-cpi.thrift'
+PROFILE_SERVICE_THRIFT_FILE='/data/service-cpis/profile-service/profile-service-cpi.thrift'
 PROFILE_SERVICE_SRC_DIR='../../airavata-services/profile-service/profile-service-stubs/src/main/java'
 
 # Initialize the thrift arguments.
 #  Since most of the Airavata API and Data Models have includes, use recursive option by default.
 #  Generate all the files in target directory
-THRIFT_ARGS="-r -o ${BASE_TARGET_DIR}"
+THRIFT_ARGS="-r -o /data/service-cpis/${BASE_TARGET_DIR}"
 # Ensure the required target directories exists, if not create.
 mkdir -p ${BASE_TARGET_DIR}