http://git-wip-us.apache.org/repos/asf/airavata/blob/8d160a7a/component-interface-descriptions/gfac/generate-gfac-stubs.sh ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/gfac/generate-gfac-stubs.sh b/component-interface-descriptions/gfac/generate-gfac-stubs.sh new file mode 100755 index 0000000..d34eaef --- /dev/null +++ b/component-interface-descriptions/gfac/generate-gfac-stubs.sh @@ -0,0 +1,134 @@ +#! /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. + +# This script will regenerate the thrift code for Airavata GFAC Server Skeltons and Client Stubs. + + +# Global Constants used across the script +REQUIRED_THRIFT_VERSION='0.9.1' +BASE_TARGET_DIR='target' +GFAC_SERVICE_DIR='../../modules/gfac/airavata-gfac-service/src/main/java/' + +# The Funcation fail prints error messages on failure and quits the script. +fail() { + echo $@ + exit 1 +} + +# The funcation add_license_header adds the ASF V2 license header to all java files within the specified generated +# directory. The funcation also adds suppress all warnings annotation to all public classes and enum's +# To Call: +# add_license_header $generated_code_directory +add_license_header() { + + # Fetch the generated code directory passed as the argument + GENERATED_CODE_DIR=$1 + + # For all generated thrift code, add the suppress all warnings annotation + # NOTE: In order to save the orginal file as a backup, use sed -i.orig in place of sed -i '' + find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public class /@SuppressWarnings("all") public class /' + find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public enum /@SuppressWarnings("all") public enum /' + + # For each java file within the genrated directory, add the ASF V2 LICENSE header + for f in $(find ${GENERATED_CODE_DIR} -name '*.java'); do + cat - ${f} >${f}-with-license <<EOF + /* + * 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. + */ +EOF + mv ${f}-with-license ${f} + done +} + +# The funcation compares every generated java file with the one in specified existing source location. If the comparision +# shows a difference, then it replaces with the newly generated file (with added license header). +# To Call: +# copy_changed_files $generated_code_directory $existing_source_directory +copy_changed_files() { + + # Read all the funcation arguments + GENERATED_CODE_DIR=$1 + WORKSPACE_SRC_DIR=$2 + + echo "Generated sources are in ${GENERATED_CODE_DIR}" + echo "Destination workspace is in ${WORKSPACE_SRC_DIR}" + + # Check if the newly generated files exist in the targetted workspace, if not copy. Only changed files will be synced. + # the extra slash to GENERATED_CODE_DIR is needed to ensure the parent directory itself is not copied. + rsync -auv ${GENERATED_CODE_DIR}/ ${WORKSPACE_SRC_DIR} +} + +# 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. +VERSION=$(thrift -version 2>/dev/null | grep -F "${REQUIRED_THRIFT_VERSION}" | wc -l) +if [ "$VERSION" -ne 1 ] ; then + echo "****************************************************" + echo "*** thrift is not installed or is not in the path" + echo "*** expecting 'thrift -version' to return ${REQUIRED_THRIFT_VERSION}" + echo "*** generated code will not be updated" + fail "****************************************************" +fi + +# Initialize the thrift arguements. +# Since most of the Airavata API and Data Models have includes, use recursive option by defualt. +# Generate all the files in target directory +THRIFT_ARGS="-r -o ${BASE_TARGET_DIR}" +# Ensure the required target directories exists, if not create. +mkdir -p ${BASE_TARGET_DIR} + +####################################################################### +# Generate/Update the GFAC CPI service stubs +# To start with both the servicer and client are in same package, but +# needs to be split using a common generated api-boilerplate-code +####################################################################### + +#Java generation directory +JAVA_GEN_DIR=${BASE_TARGET_DIR}/gen-java + +# As a precausion remove and previously generated files if exists +rm -rf ${JAVA_GEN_DIR} + +# Using thrify Java generator, generate the java classes based on Airavata API. This +# The airavataAPI.thrift includes rest of data models. +thrift ${THRIFT_ARGS} --gen java gfac.cpi.service.thrift || fail unable to generate java thrift classes +thrift ${THRIFT_ARGS} --gen java gfacDataModel.thrift || fail unable to generate java thrift classes + + +# For the generated java classes add the ASF V2 License header +add_license_header $JAVA_GEN_DIR + +# Compare the newly generated classes with existing java generated skelton/stub sources and replace the changed ones. +copy_changed_files ${JAVA_GEN_DIR} ${GFAC_SERVICE_DIR} + +# CleanUp: Delete the base target build directory +#rm -rf ${BASE_TARGET_DIR} + +echo "Successfully generated new sources, compared against exiting code and replaced the changed files" +exit 0
http://git-wip-us.apache.org/repos/asf/airavata/blob/8d160a7a/component-interface-descriptions/gfac/gfac.cpi.service.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/gfac/gfac.cpi.service.thrift b/component-interface-descriptions/gfac/gfac.cpi.service.thrift new file mode 100644 index 0000000..93d62c7 --- /dev/null +++ b/component-interface-descriptions/gfac/gfac.cpi.service.thrift @@ -0,0 +1,68 @@ +/* + * 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. + * + */ + +/* + * Component Programming Interface definition for Apache Airavata GFac Service. + * +*/ + +namespace java org.apache.airavata.gfac.cpi + +const string GFAC_CPI_VERSION = "0.13.0" + +service GfacService { + + /** Query gfac server to fetch the CPI version */ + string getGFACServiceVersion(), + + /** + * After creating the experiment Data and Task Data in the orchestrator + * Orchestrator has to invoke this operation for each Task per experiment to run + * the actual Job related actions. + * + * @param experimentID + * @param taskID + * @param gatewayId: + * The GatewayId is inferred from security context and passed onto gfac. + * @return sucess/failure + * + **/ + bool submitJob (1: required string experimentId, + 2: required string taskId + 3: required string gatewayId, + 4: required string tokenId) + + /** + * + * Terminate the running job.At this point user + * does not have to know the job ID so in the argument + * we do not make it to required jobID to provide. + * + * + * @param experimentID + * @param taskID + * @return sucess/failure + * + **/ + bool cancelJob (1: required string experimentId, + 2: required string taskId, + 3: required string gatewayId, + 4: required string tokenId) +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/8d160a7a/component-interface-descriptions/gfac/gfacDataModel.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/gfac/gfacDataModel.thrift b/component-interface-descriptions/gfac/gfacDataModel.thrift new file mode 100644 index 0000000..883528e --- /dev/null +++ b/component-interface-descriptions/gfac/gfacDataModel.thrift @@ -0,0 +1,64 @@ +/* + * 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. + * + */ + +include "applicationCatalogDataModel.thrift" + +namespace java org.apache.airavata.gfac.states + +/* + * This file describes the definitions of the Gfac Framework level Experiment Data Structures. Each of the + * language specific Airavata Client SDK's will translate this neutral data model into an + * appropriate form for passing to the Airavata Server Execution API Calls. + * + * This data-model will not be visible to the outside users but it will be used inside GFAc to recover + * the failed jobs or hanged jobs. + * +*/ + +const string DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS" +const string DEFAULT_PROJECT_NAME = "DEFAULT" +const string SINGLE_APP_NODE_NAME = "SINGLE_APP_NODE" + +enum GfacExperimentState { + LAUNCHED, + ACCEPTED, + INHANDLERSINVOKING, + INHANDLERSINVOKED, + PROVIDERINVOKING, + JOBSUBMITTED, + PROVIDERINVOKED, + OUTHANDLERSINVOKING, + OUTHANDLERSINVOKED, + COMPLETED, + FAILED, + UNKNOWN +} + +enum GfacHandlerState { + INVOKING, + INVOKED, + COMPLETED, + UNKNOWN +} + +struct GfacExperimentStatus { + 1: required GfacExperimentState gfacExperimentState, + 2: optional i64 timeOfStateChange +} http://git-wip-us.apache.org/repos/asf/airavata/blob/8d160a7a/component-interface-descriptions/orchestrator-thrift-descriptions/generate-orchestrator-stubs.sh ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/orchestrator-thrift-descriptions/generate-orchestrator-stubs.sh b/component-interface-descriptions/orchestrator-thrift-descriptions/generate-orchestrator-stubs.sh deleted file mode 100755 index a7f2659..0000000 --- a/component-interface-descriptions/orchestrator-thrift-descriptions/generate-orchestrator-stubs.sh +++ /dev/null @@ -1,132 +0,0 @@ -#! /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. - -# This script will regenerate the thrift code for Airavata Orchestrator Server Skeltons and Client Stubs. - - -# Global Constants used across the script -REQUIRED_THRIFT_VERSION='0.9.1' -BASE_TARGET_DIR='target' -ORCHESTRATOR_SERVICE_DIR='../airavata-orchestrator-stubs/src/main/java' - -# The Funcation fail prints error messages on failure and quits the script. -fail() { - echo $@ - exit 1 -} - -# The funcation add_license_header adds the ASF V2 license header to all java files within the specified generated -# directory. The funcation also adds suppress all warnings annotation to all public classes and enum's -# To Call: -# add_license_header $generated_code_directory -add_license_header() { - - # Fetch the generated code directory passed as the argument - GENERATED_CODE_DIR=$1 - - # For all generated thrift code, add the suppress all warnings annotation - # NOTE: In order to save the orginal file as a backup, use sed -i.orig in place of sed -i '' - find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public class /@SuppressWarnings("all") public class /' - find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public enum /@SuppressWarnings("all") public enum /' - - # For each java file within the genrated directory, add the ASF V2 LICENSE header - for f in $(find ${GENERATED_CODE_DIR} -name '*.java'); do - cat - ${f} >${f}-with-license <<EOF - /* - * 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. - */ -EOF - mv ${f}-with-license ${f} - done -} - -# The funcation compares every generated java file with the one in specified existing source location. If the comparision -# shows a difference, then it replaces with the newly generated file (with added license header). -# To Call: -# copy_changed_files $generated_code_directory $existing_source_directory -copy_changed_files() { - - # Read all the funcation arguments - GENERATED_CODE_DIR=$1 - WORKSPACE_SRC_DIR=$2 - - echo "Generated sources are in ${GENERATED_CODE_DIR}" - echo "Destination workspace is in ${WORKSPACE_SRC_DIR}" - - # Check if the newly generated files exist in the targetted workspace, if not copy. Only changed files will be synced. - # the extra slash to GENERATED_CODE_DIR is needed to ensure the parent directory itself is not copied. - rsync -auv ${GENERATED_CODE_DIR}/ ${WORKSPACE_SRC_DIR} -} - -# 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. -VERSION=$(thrift -version 2>/dev/null | grep -F "${REQUIRED_THRIFT_VERSION}" | wc -l) -if [ "$VERSION" -ne 1 ] ; then - echo "****************************************************" - echo "*** thrift is not installed or is not in the path" - echo "*** expecting 'thrift -version' to return ${REQUIRED_THRIFT_VERSION}" - echo "*** generated code will not be updated" - fail "****************************************************" -fi - -# Initialize the thrift arguements. -# Since most of the Airavata API and Data Models have includes, use recursive option by defualt. -# Generate all the files in target directory -THRIFT_ARGS="-r -o ${BASE_TARGET_DIR}" -# Ensure the required target directories exists, if not create. -mkdir -p ${BASE_TARGET_DIR} - -####################################################################### -# Generate/Update the orchestrator CPI service stubs -# To start with both the servicer and client are in same package, but -# needs to be split using a common generated api-boilerplate-code -####################################################################### - -#Java generation directory -JAVA_GEN_DIR=${BASE_TARGET_DIR}/gen-java - -# As a precausion remove and previously generated files if exists -rm -rf ${JAVA_GEN_DIR} - -# Using thrify Java generator, generate the java classes based on Airavata API. This -# The airavataAPI.thrift includes rest of data models. -thrift ${THRIFT_ARGS} --gen java orchestrator.cpi.service.thrift || fail unable to generate java thrift classes - -# For the generated java classes add the ASF V2 License header -add_license_header $JAVA_GEN_DIR - -# Compare the newly generated classes with existing java generated skelton/stub sources and replace the changed ones. -copy_changed_files ${JAVA_GEN_DIR} ${ORCHESTRATOR_SERVICE_DIR} - -# CleanUp: Delete the base target build directory -#rm -rf ${BASE_TARGET_DIR} - -echo "Successfully generated new sources, compared against exiting code and replaced the changed files" -exit 0 http://git-wip-us.apache.org/repos/asf/airavata/blob/8d160a7a/component-interface-descriptions/orchestrator-thrift-descriptions/orchestrator.cpi.service.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/orchestrator-thrift-descriptions/orchestrator.cpi.service.thrift b/component-interface-descriptions/orchestrator-thrift-descriptions/orchestrator.cpi.service.thrift deleted file mode 100644 index 07c0834..0000000 --- a/component-interface-descriptions/orchestrator-thrift-descriptions/orchestrator.cpi.service.thrift +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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. - * - */ - -/* - * Component Programming Interface definition for Apache Airavata Orchestration Service. - * -*/ - -include "../../../airavata-api/thrift-interface-descriptions/airavataErrors.thrift" -namespace java org.apache.airavata.orchestrator.cpi - -const string ORCHESTRATOR_CPI_VERSION = "0.13.0" - -service OrchestratorService { - - /** Query orchestrator server to fetch the CPI version */ - string getOrchestratorCPIVersion(), - - /** - * After creating the experiment Data user have the - * experimentID as the handler to the experiment, during the launchExperiment - * We just have to give the experimentID - * - * @param experimentID - * @return sucess/failure - * - **/ - bool launchExperiment (1: required string experimentId, 2: required string airavataCredStoreToken), - - /** - * In order to run single applications users should create an associating - * WorkflowNodeDetails and a TaskDetails for it and hand it over for execution - * along with a credential store token for authentication - * - * @param taskId - * @param airavataCredStoreToken - * @return sucess/failure - * - **/ - bool launchTask (1: required string taskId, 2: required string airavataCredStoreToken), - - /** - * - * Validate funcations which can verify if the experiment is ready to be launced. - * - * @param experimentID - * @return sucess/failure - * - **/ - bool validateExperiment(1: required string experimentId) - throws (1: airavataErrors.LaunchValidationException lve) - /** - * - * Terminate the running experiment. - * - * @param experimentID - * @return sucess/failure - * - **/ - bool terminateExperiment (1: required string experimentId, 2: required string tokenId) -} http://git-wip-us.apache.org/repos/asf/airavata/blob/8d160a7a/component-interface-descriptions/orchestrator/generate-orchestrator-stubs.sh ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/orchestrator/generate-orchestrator-stubs.sh b/component-interface-descriptions/orchestrator/generate-orchestrator-stubs.sh new file mode 100755 index 0000000..b122f02 --- /dev/null +++ b/component-interface-descriptions/orchestrator/generate-orchestrator-stubs.sh @@ -0,0 +1,132 @@ +#! /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. + +# This script will regenerate the thrift code for Airavata Orchestrator Server Skeltons and Client Stubs. + + +# Global Constants used across the script +REQUIRED_THRIFT_VERSION='0.9.1' +BASE_TARGET_DIR='target' +ORCHESTRATOR_SERVICE_DIR='../../modules/orchestrator/airavata-orchestrator-stubs/src/main/java' + +# The Funcation fail prints error messages on failure and quits the script. +fail() { + echo $@ + exit 1 +} + +# The funcation add_license_header adds the ASF V2 license header to all java files within the specified generated +# directory. The funcation also adds suppress all warnings annotation to all public classes and enum's +# To Call: +# add_license_header $generated_code_directory +add_license_header() { + + # Fetch the generated code directory passed as the argument + GENERATED_CODE_DIR=$1 + + # For all generated thrift code, add the suppress all warnings annotation + # NOTE: In order to save the orginal file as a backup, use sed -i.orig in place of sed -i '' + find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public class /@SuppressWarnings("all") public class /' + find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public enum /@SuppressWarnings("all") public enum /' + + # For each java file within the genrated directory, add the ASF V2 LICENSE header + for f in $(find ${GENERATED_CODE_DIR} -name '*.java'); do + cat - ${f} >${f}-with-license <<EOF + /* + * 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. + */ +EOF + mv ${f}-with-license ${f} + done +} + +# The funcation compares every generated java file with the one in specified existing source location. If the comparision +# shows a difference, then it replaces with the newly generated file (with added license header). +# To Call: +# copy_changed_files $generated_code_directory $existing_source_directory +copy_changed_files() { + + # Read all the funcation arguments + GENERATED_CODE_DIR=$1 + WORKSPACE_SRC_DIR=$2 + + echo "Generated sources are in ${GENERATED_CODE_DIR}" + echo "Destination workspace is in ${WORKSPACE_SRC_DIR}" + + # Check if the newly generated files exist in the targetted workspace, if not copy. Only changed files will be synced. + # the extra slash to GENERATED_CODE_DIR is needed to ensure the parent directory itself is not copied. + rsync -auv ${GENERATED_CODE_DIR}/ ${WORKSPACE_SRC_DIR} +} + +# 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. +VERSION=$(thrift -version 2>/dev/null | grep -F "${REQUIRED_THRIFT_VERSION}" | wc -l) +if [ "$VERSION" -ne 1 ] ; then + echo "****************************************************" + echo "*** thrift is not installed or is not in the path" + echo "*** expecting 'thrift -version' to return ${REQUIRED_THRIFT_VERSION}" + echo "*** generated code will not be updated" + fail "****************************************************" +fi + +# Initialize the thrift arguements. +# Since most of the Airavata API and Data Models have includes, use recursive option by defualt. +# Generate all the files in target directory +THRIFT_ARGS="-r -o ${BASE_TARGET_DIR}" +# Ensure the required target directories exists, if not create. +mkdir -p ${BASE_TARGET_DIR} + +####################################################################### +# Generate/Update the orchestrator CPI service stubs +# To start with both the servicer and client are in same package, but +# needs to be split using a common generated api-boilerplate-code +####################################################################### + +#Java generation directory +JAVA_GEN_DIR=${BASE_TARGET_DIR}/gen-java + +# As a precausion remove and previously generated files if exists +rm -rf ${JAVA_GEN_DIR} + +# Using thrify Java generator, generate the java classes based on Airavata API. This +# The airavataAPI.thrift includes rest of data models. +thrift ${THRIFT_ARGS} --gen java orchestrator.cpi.service.thrift || fail unable to generate java thrift classes + +# For the generated java classes add the ASF V2 License header +add_license_header $JAVA_GEN_DIR + +# Compare the newly generated classes with existing java generated skelton/stub sources and replace the changed ones. +copy_changed_files ${JAVA_GEN_DIR} ${ORCHESTRATOR_SERVICE_DIR} + +# CleanUp: Delete the base target build directory +#rm -rf ${BASE_TARGET_DIR} + +echo "Successfully generated new sources, compared against exiting code and replaced the changed files" +exit 0 http://git-wip-us.apache.org/repos/asf/airavata/blob/8d160a7a/component-interface-descriptions/orchestrator/orchestrator.cpi.service.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/orchestrator/orchestrator.cpi.service.thrift b/component-interface-descriptions/orchestrator/orchestrator.cpi.service.thrift new file mode 100644 index 0000000..fa8818f --- /dev/null +++ b/component-interface-descriptions/orchestrator/orchestrator.cpi.service.thrift @@ -0,0 +1,78 @@ +/* + * 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. + * + */ + +/* + * Component Programming Interface definition for Apache Airavata Orchestration Service. + * +*/ + +include "../airavata-api/airavataErrors.thrift" +namespace java org.apache.airavata.orchestrator.cpi + +const string ORCHESTRATOR_CPI_VERSION = "0.13.0" + +service OrchestratorService { + + /** Query orchestrator server to fetch the CPI version */ + string getOrchestratorCPIVersion(), + + /** + * After creating the experiment Data user have the + * experimentID as the handler to the experiment, during the launchExperiment + * We just have to give the experimentID + * + * @param experimentID + * @return sucess/failure + * + **/ + bool launchExperiment (1: required string experimentId, 2: required string airavataCredStoreToken), + + /** + * In order to run single applications users should create an associating + * WorkflowNodeDetails and a TaskDetails for it and hand it over for execution + * along with a credential store token for authentication + * + * @param taskId + * @param airavataCredStoreToken + * @return sucess/failure + * + **/ + bool launchTask (1: required string taskId, 2: required string airavataCredStoreToken), + + /** + * + * Validate funcations which can verify if the experiment is ready to be launced. + * + * @param experimentID + * @return sucess/failure + * + **/ + bool validateExperiment(1: required string experimentId) + throws (1: airavataErrors.LaunchValidationException lve) + /** + * + * Terminate the running experiment. + * + * @param experimentID + * @return sucess/failure + * + **/ + bool terminateExperiment (1: required string experimentId, 2: required string tokenId) +}
