http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/airavata-apis/airavata_commons.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/airavata-apis/airavata_commons.thrift b/thrift-interface-descriptions/airavata-apis/airavata_commons.thrift new file mode 100644 index 0000000..e49fe3f --- /dev/null +++ b/thrift-interface-descriptions/airavata-apis/airavata_commons.thrift @@ -0,0 +1,54 @@ +/* + * 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. + * + */ + +namespace java org.apache.airavata.model.commons +namespace php Airavata.Model.Commons +namespace cpp apache.airavata.model.commons +namespace py apache.airavata.model.commons + +const string DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS" + +struct ErrorModel { + 1: required string errorId = DEFAULT_ID, + 2: optional i64 creationTime, + 3: optional string actualErrorMessage, + 4: optional string userFriendlyMessage, + 5: optional bool transientOrPersistent = 0, + 6: optional list<string> rootCauseErrorIdList +} + + +/** +* This data structure can be used to store the validation results +* captured during validation step and during the launchExperiment +* operation it can be easilly checked to see the errors occured +* during the experiment launch operation +**/ + +struct ValidatorResult { + 1: required bool result, + 2: optional string errorDetails +} + + +struct ValidationResults { + 1: required bool validationState, + 2: required list<ValidatorResult> validationResultList +} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/airavata-apis/airavata_errors.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/airavata-apis/airavata_errors.thrift b/thrift-interface-descriptions/airavata-apis/airavata_errors.thrift new file mode 100644 index 0000000..c8e4999 --- /dev/null +++ b/thrift-interface-descriptions/airavata-apis/airavata_errors.thrift @@ -0,0 +1,172 @@ +/* + * 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 file describes the definitions of the Error Messages that can occur +* when invoking Apache Airavata Services through the API. In addition Thrift provides +* built in funcationality to raise TApplicationException for all internal server errors. +*/ + +include "../data-models/experiment-catalog-models/experiment_model.thrift" + +namespace java org.apache.airavata.model.error +namespace php Airavata.API.Error +namespace cpp apache.airavata.api.error +namespace perl AiravataAPIError +namespace py apache.airavata.api.error +namespace js AiravataAPIError + +/** + * A list of Airavata API Error Message Types + * + * UNKNOWN: No information available about the error + * + * PERMISSION_DENIED: Not permitted to perform action + * + * INTERNAL_ERROR: Unexpected problem with the service + * + * AUTHENTICATION_FAILURE: The client failed to authenticate. + * + * INVALID_AUTHORIZATION: Security Token and/or Username and/or password is incorrect + * + * AUTHORIZATION_EXPIRED: Authentication token expired + * + * UNKNOWN_GATEWAY_ID: The gateway is not registered with Airavata. + * + * UNSUPPORTED_OPERATION: Operation denied because it is currently unsupported. + */ + +enum AiravataErrorType { + UNKNOWN, + PERMISSION_DENIED, + INTERNAL_ERROR, + AUTHENTICATION_FAILURE, + INVALID_AUTHORIZATION, + AUTHORIZATION_EXPIRED, + UNKNOWN_GATEWAY_ID, + UNSUPPORTED_OPERATION +} + +/** + * This exception is thrown when a client asks to perform an operation on an experiment that does not exist. + * + * identifier: A description of the experiment that was not found on the server. + * + * key: The value passed from the client in the identifier, which was not found. + */ +exception ExperimentNotFoundException { + 1: required string message + /** + * 1: optional string identifier, + * 2: optional string key + **/ +} + +exception ProjectNotFoundException { + 1: required string message +} + +/** +* This exception is thrown for invalid requests that occur from any reasons like required input parameters are missing, +* or a parameter is malformed. +* +* message: contains the associated error message. +*/ +exception InvalidRequestException { + 1: required string message +} + + +/** +* This exception is thrown when RPC timeout gets exceeded. +*/ +exception TimedOutException { +} + +/** +* This exception is thrown for invalid sshKeyAuthentication requests. +* +* message: contains the cause of the authorization failure. +*/ +exception AuthenticationException { + 1: required string message +} + +/** +* This exception is thrown for invalid authorization requests such user does not have acces to an aplication or resource. +* +* message: contains the authorization failure message +*/ +exception AuthorizationException { + 1: required string message +} + + +/** + * This exception is thrown by Airavata Services when a call fails as a result of + * a problem that a client may be able to resolve. For example, if the user + * attempts to execute an application on a resource gateway does not have access to. + * + * This exception would not be used for internal system errors that do not + * reflect user actions, but rather reflect a problem within the service that + * the client cannot resolve. + * + * airavataErrorType: The message type indicating the error that occurred. + * must be one of the values of AiravataErrorType. + * + * parameter: If the error applied to a particular input parameter, this will + * indicate which parameter. + */ +exception AiravataClientException { + 1: required AiravataErrorType airavataErrorType, + 2: optional string parameter +} + +struct ValidatorResult { + 1: required bool result, + 2: optional string errorDetails +} + +struct ValidationResults { + 1: required bool validationState, + 2: required list<ValidatorResult> validationResultList +} + +exception LaunchValidationException { + 1: required ValidationResults validationResult; + 2: optional string errorMessage; +} + +/** + * This exception is thrown by Airavata Services when a call fails as a result of + * a problem in the service that could not be changed through client's action. + * + * airavataErrorType: The message type indicating the error that occurred. + * must be one of the values of AiravataErrorType. + * + * message: This may contain additional information about the error + * + */ +exception AiravataSystemException { + 1: required AiravataErrorType airavataErrorType, + 2: optional string message, +} + + http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/airavata-apis/messaging_events.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/airavata-apis/messaging_events.thrift b/thrift-interface-descriptions/airavata-apis/messaging_events.thrift new file mode 100644 index 0000000..7ffc88d --- /dev/null +++ b/thrift-interface-descriptions/airavata-apis/messaging_events.thrift @@ -0,0 +1,147 @@ +/* + * 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 "../data-models/experiment-catalog-models/status_models.thrift" +include "../data-models/app-catalog-models/application_io_models.thrift" +include "airavata_commons.thrift" + +namespace java org.apache.airavata.model.messaging.event +namespace php Airavata.Model.Messaging.Event +namespace cpp apache.airavata.model.messaging.event +namespace py apache.airavata.model.messaging.event + +enum MessageLevel { + INFO, + DEBUG, + ERROR, + ACK +} + +enum MessageType { + EXPERIMENT, + TASK, + PROCESS, + JOB, + LAUNCHPROCESS, + TERMINATEPROCESS, + PROCESSOUTPUT +} + +struct ExperimentStatusChangeEvent { + 1: required status_models.ExperimentState state; + 2: required string experimentId; + 3: required string gatewayId; +} + +struct ProcessIdentifier { + 1: required string processId; + 2: required string experimentId; + 3: required string gatewayId; +} + +struct TaskIdentifier { + 1: required string taskId; + 2: required string processId; + 3: required string experimentId; + 4: required string gatewayId; +} + +struct TaskStatusChangeEvent { + 1: required status_models.TaskState state; + 2: required TaskIdentifier taskIdentity; +} + +struct TaskStatusChangeRequestEvent { + 1: required status_models.TaskState state; + 2: required TaskIdentifier taskIdentity; +} + +struct ProcessStatusChangeEvent { + 1: required status_models.ProcessState state; + 2: required ProcessIdentifier processIdentity; +} + +struct ProcessStatusChangeRequestEvent { + 1: required status_models.ProcessState state; + 2: required ProcessIdentifier processIdentity; +} + +struct TaskOutputChangeEvent { + 1: required list<application_io_models.OutputDataObjectType> output; + 2: required TaskIdentifier taskIdentity; +} + +struct JobIdentifier { + 1: required string jobId; + 2: required string taskId; + 3: required string processId; + 4: required string experimentId; + 5: required string gatewayId; +} + +//struct JobMonitor { +// 1: optional string username; +// 2: optional i64 jobStartedTime; +// 3: optional i64 lastMonitoredTime; +// 4: optional string hostId; +// 5: optional map<string, string> parameters; +// 6: optional string jobName; +// 7: optional i32 failedCount = 0; +// // FIXME - Job execution context +// //8: +// } + +struct ProcessSubmitEvent{ + 1: required string processId, + 2: required string gatewayId, + 3: required string experimentId, + 4: required string tokenId +} + +struct ProcessTerminateEvent{ + 1: required string processId, + 2: required string gatewayId, + 3: required string tokenId +} + +struct JobStatusChangeEvent { + 1: required status_models.JobState state; + 2: required JobIdentifier jobIdentity; +} + +struct JobStatusChangeRequestEvent { + 1: required status_models.JobState state; + 2: required JobIdentifier jobIdentity; +} + +struct Message { + 1: required binary event; + 2: required string messageId = airavata_commons.DEFAULT_ID, + 3: required MessageType messageType; + 4: optional i64 updatedTime; + 5: optional MessageLevel messageLevel; +} + + + + + + + http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/airavata-apis/security_model.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/airavata-apis/security_model.thrift b/thrift-interface-descriptions/airavata-apis/security_model.thrift new file mode 100644 index 0000000..bda9554 --- /dev/null +++ b/thrift-interface-descriptions/airavata-apis/security_model.thrift @@ -0,0 +1,35 @@ +/* + * 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. + * + */ + +namespace java org.apache.airavata.model.security +namespace php Airavata.Model.Security +namespace cpp apache.airavata.model.security +namespace py apache.airavata.model.security + +/* + * This file describes the definitions of the security model which encapsulates the information that needs to be passed + to the API methods in order to authenticate and authorize the users. + * +*/ + +struct AuthzToken { + 1: required string accessToken, + 2: optional map<string, string> claimsMap +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/airavata-apis/workflow_api.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/airavata-apis/workflow_api.thrift b/thrift-interface-descriptions/airavata-apis/workflow_api.thrift new file mode 100644 index 0000000..064f128 --- /dev/null +++ b/thrift-interface-descriptions/airavata-apis/workflow_api.thrift @@ -0,0 +1,82 @@ +/* + * 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. + * +*/ + +/** + * Application Programming Interface definition for Apache Airavata Services. + * this parent thrift file is contains all service interfaces. The data models are + * described in respective thrift files. +*/ + +include "airavata_errors.thrift" +include "airavata_data_models.thrift" +include "experiment_model.thrift" +include "workspace_model.thrift" +include "compute_resource_model.thrift" +include "application_deployment_model.thrift" +include "application_interface_model.thrift" +include "workflow_data_model.thrift" + +namespace java org.apache.airavata.api.workflow +namespace php Airavata.API.Workflow +namespace cpp airavata.api.workflow +namespace perl AiravataWorkflowAPI +namespace py apache.airavata.api.workflow +namespace js AiravataWorkflowAPI + +const string AIRAVATA_API_VERSION = "0.15.0" + +service Workflow { + + list<string> getAllWorkflows() + throws (1: airavata_errors.InvalidRequestException ire, + 2: airavata_errors.AiravataClientException ace, + 3: airavata_errors.AiravataSystemException ase) + + workflow_data_model.Workflow getWorkflow (1: required string workflowTemplateId) + throws (1: airavata_errors.InvalidRequestException ire, + 2: airavata_errors.AiravataClientException ace, + 3: airavata_errors.AiravataSystemException ase) + + void deleteWorkflow (1: required string workflowTemplateId) + throws (1: airavata_errors.InvalidRequestException ire, + 2: airavata_errors.AiravataClientException ace, + 3: airavata_errors.AiravataSystemException ase) + + string registerWorkflow(1: required workflow_data_model.Workflow workflow) + throws (1: airavata_errors.InvalidRequestException ire, + 2: airavata_errors.AiravataClientException ace, + 3: airavata_errors.AiravataSystemException ase) + + void updateWorkflow (1: required string workflowTemplateId, 2: required workflow_data_model.Workflow workflow) + throws (1: airavata_errors.InvalidRequestException ire, + 2: airavata_errors.AiravataClientException ace, + 3: airavata_errors.AiravataSystemException ase) + + string getWorkflowTemplateId (1: required string workflowName) + throws (1: airavata_errors.InvalidRequestException ire, + 2: airavata_errors.AiravataClientException ace, + 3: airavata_errors.AiravataSystemException ase) + + bool isWorkflowExistWithName(1: required string workflowName) + throws (1: airavata_errors.InvalidRequestException ire, + 2: airavata_errors.AiravataClientException ace, + 3: airavata_errors.AiravataSystemException ase) + } + http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/component-cpis/credential-store-cpi.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/component-cpis/credential-store-cpi.thrift b/thrift-interface-descriptions/component-cpis/credential-store-cpi.thrift new file mode 100644 index 0000000..7a55ded --- /dev/null +++ b/thrift-interface-descriptions/component-cpis/credential-store-cpi.thrift @@ -0,0 +1,66 @@ +/* + * 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. + * +*/ + +include "credential-store-data-models.thrift" +include "credential-store-errors.thrift" + +namespace java org.apache.airavata.credential.store.cpi + +const string CS_CPI_VERSION = "0.16.0" + +service CredentialStoreService { + + /** Query CS server to fetch the CPI version */ + string getCSServiceVersion(), + + /** + * This method is to add SSHCredential which will return the token Id in success + **/ + string addSSHCredential (1: required credential-store-data-models.SSHCredential sshCredential) + throws (1:credential-store-errors.CredentialStoreException csException); + + string addCertificateCredential (1: required credential-store-data-models.CertificateCredential certificateCredential) + throws (1:credential-store-errors.CredentialStoreException csException); + + string addPasswordCredential (1: required credential-store-data-models.PasswordCredential passwordCredential) + throws (1:credential-store-errors.CredentialStoreException csException); + + credential-store-data-models.SSHCredential getSSHCredential (1: required string tokenId, 2: required string gatewayId) + throws (1:credentialStoreErrors.CredentialStoreException csException); + + credential-store-data-models.CertificateCredential getCertificateCredential (1: required string tokenId, 2: required string gatewayId) + throws (1:credentialStoreErrors.CredentialStoreException csException); + + credential-store-data-models.PasswordCredential getPasswordCredential (1: required string tokenId, 2: required string gatewayId) + throws (1:credentialStoreErrors.CredentialStoreException csException); + + map<string,string> getAllSSHKeysForUser (1: required string username) throws (1:credentialStoreErrors.CredentialStoreException csException); + + map<string,string> getAllSSHKeysForGateway (1: required string gatewayId) throws (1:credentialStoreErrors.CredentialStoreException csException); + + bool deleteSSHCredential(1: required string tokenId, 2: required string gatewayId) throws (1:credentialStoreErrors.CredentialStoreException csException); + + +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/component-cpis/credential-store-data-models.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/component-cpis/credential-store-data-models.thrift b/thrift-interface-descriptions/component-cpis/credential-store-data-models.thrift new file mode 100644 index 0000000..0f52833 --- /dev/null +++ b/thrift-interface-descriptions/component-cpis/credential-store-data-models.thrift @@ -0,0 +1,61 @@ +/* + * 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. + * + */ + + +namespace java org.apache.airavata.credential.store.datamodel +namespace php Airavata.Model.Credential.Store + + +const string DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS" + + +struct SSHCredential { + 1: required string gatewayId, + 2: required string username, + 3: optional string passphrase, + 4: optional string publicKey, + 5: optional string privateKey, + 6: optional i64 persistedTime, + 7: optional string token +} + +struct CommunityUser { + 1: required string gatewayName, + 2: required string username, + 3: required string userEmail +} + +struct CertificateCredential { + 1: required CommunityUser communityUser, + 2: required string x509Cert, + 3: optional string notAfter, + 4: optional string privateKey, + 5: optional i64 lifeTime, + 6: optional string notBefore + 7: optional i64 persistedTime, + 8: optional string token +} + +struct PasswordCredential { + 1: required string username, + 2: required string password, + 3: optional i64 persistedTime, + 4: optional string token +} http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/component-cpis/credential-store-errors.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/component-cpis/credential-store-errors.thrift b/thrift-interface-descriptions/component-cpis/credential-store-errors.thrift new file mode 100644 index 0000000..148d7f2 --- /dev/null +++ b/thrift-interface-descriptions/component-cpis/credential-store-errors.thrift @@ -0,0 +1,32 @@ +/* + * 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 file describes the definitions of the Error Messages that can occur +* when invoking Apache Airavata Services through the API. In addition Thrift provides +* built in funcationality to raise TApplicationException for all internal server errors. +*/ + +namespace java org.apache.airavata.credential.store.exception +namespace php Airavata.Credential.Store.Error + +exception CredentialStoreException { + 1: required string message +} http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/component-cpis/generate-cpi-stubs.sh ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/component-cpis/generate-cpi-stubs.sh b/thrift-interface-descriptions/component-cpis/generate-cpi-stubs.sh new file mode 100755 index 0000000..0a7cf23 --- /dev/null +++ b/thrift-interface-descriptions/component-cpis/generate-cpi-stubs.sh @@ -0,0 +1,197 @@ +#! /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 generate/regenerate the thrift stubs for Airavata Components: Credential Store, Orchestrator, GFac. + +show_usage() { + echo -e "Usage: $0 [Component to generate stubs]" + echo "" + echo "options:" + echo -e "\tcs Generate/Update Credential Store Stubs" + echo -e "\torch Generate/Update Orchestrator Stubs" + echo -e "\tgfac Generate/Update GFac Stubs" + echo -e "\tall Generate/Update all stubs (Credential Store, Orchestrator, GFac)." + echo -e "\t-h[elp] Print the usage options of this script" +} + +if [ $# -lt 1 ] +then + show_usage + exit 1 +fi + +if [[ $1 == "-h" ||$1 == "--help" ]] +then + show_usage + 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.2' +if hash thrift &> /dev/null; then + THRIFT_EXEC=$(which thrift) +else + THRIFT_EXEC=/usr/local/bin/thrift +fi + +VERSION=$($THRIFT_EXEC -version 2>/dev/null | grep -F "${REQUIRED_THRIFT_VERSION}" | wc -l) +if [ "$VERSION" -ne 1 ] ; then + echo -e "ERROR:\t Apache Thrift version ${REQUIRED_THRIFT_VERSION} is required." + echo -e "It is either not installed or is not in the path" + exit 1 +fi + +# Global Constants used across the script +BASE_TARGET_DIR='target' + +CS_THRIFT_FILE='credential-store-cpi.thrift' +CS_SRC_DIR='../../modules/credential-store/credential-store-stubs/src/main/java' + +ORCHESTRATOR_THRIFT_FILE='orchestrator-cpi.thrift' +ORCHESTRATOR_SRC_DIR='../../modules/orchestrator/orchestrator-client/src/main/java' + +GFAC_THRIFT_FILE='gfac-cpi.thrift' +GFAC_SRC_DIR='../../modules/gfac/gfac-client/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}" +# Ensure the required target directories exists, if not create. +mkdir -p ${BASE_TARGET_DIR} + +# 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 each java file within the generated 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 function compares every generated java file with the one in specified existing source location. If the comparison +# 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 function 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} +} + +# The function generates the thrify stubs and copies to the specified directory. +# To Call: +# generate_thrift_stubs $component_thrift_file $component_src_dir +generate_thrift_stubs() { + + COMPONENT_THRIFT_FILE=$1 + COMPONENT_SRC_DIR=$2 + + #Java generation directory + JAVA_GEN_DIR=${BASE_TARGET_DIR}/gen-java + + # As a precaution remove and previously generated files if exists + rm -rf ${JAVA_GEN_DIR} + + # Using thrify Java generator, generate the java classes based on components CPI. + $THRIFT_EXEC ${THRIFT_ARGS} --gen java ${COMPONENT_THRIFT_FILE} || fail unable to generate java thrift classes + + # Remove generated model classes, airavata api thrift file will generate those. + echo "Remove generated model classes ${JAVA_GEN_DIR}/org/airavata/apache/model" + rm -rf ${JAVA_GEN_DIR}/org/apache/airavata/model + + # 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} ${COMPONENT_SRC_DIR} + + echo "Successfully generated new sources, compared against exiting code and replaced the changed files" + +} + +for arg in "$@" +do + case "$arg" in + all) echo "Generate all (credential store, orchestrator, gfac) Stubs" + generate_cs_stubs + generate_thrift_stubs ${CS_THRIFT_FILE} ${CS_SRC_DIR} + generate_gfac_stubs + ;; + cs) echo "Generating Credential Store Stubs" + generate_thrift_stubs ${CS_THRIFT_FILE} ${CS_SRC_DIR} + ;; + orch) echo "Generate Orchestrator Stubs" + generate_thrift_stubs ${ORCHESTRATOR_THRIFT_FILE} ${ORCHESTRATOR_SRC_DIR} + ;; + gfac) echo "Generate GFac Stubs" + generate_thrift_stubs ${GFAC_THRIFT_FILE} ${GFAC_SRC_DIR} + ;; + *) echo "Invalid or unsupported option" + show_usage + exit 1 + ;; + esac +done + +#################### +# Cleanup and Exit # +#################### +# CleanUp: Delete the base target build directory +#rm -rf ${BASE_TARGET_DIR} + +exit 0 http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/component-cpis/gfac-cpi.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/component-cpis/gfac-cpi.thrift b/thrift-interface-descriptions/component-cpis/gfac-cpi.thrift new file mode 100644 index 0000000..d051514 --- /dev/null +++ b/thrift-interface-descriptions/component-cpis/gfac-cpi.thrift @@ -0,0 +1,57 @@ +/* + * 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.16.0" + +service GfacService { + + /** Query gfac server to fetch the CPI version */ + string getGFACServiceVersion(), + + /** + * @param processId + * @param gatewayId: The GatewayId is inferred from security context and passed onto gfac. + * @param tokenId + * @return sucess/failure + * + **/ + bool submitProcess (1: required string processId, + 2: required string gatewayId, + 3: required string tokenId) + + /** + * + * @param processId + * @param gatewayId: The GatewayId is inferred from security context and passed onto gfac. + * @param tokenId + * @return sucess/failure + * + **/ + bool cancelProcess (1: required string processId, + 2: required string gatewayId, + 3: required string tokenId) +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/component-cpis/orchestrator-cpi.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/component-cpis/orchestrator-cpi.thrift b/thrift-interface-descriptions/component-cpis/orchestrator-cpi.thrift new file mode 100644 index 0000000..65b6cd7 --- /dev/null +++ b/thrift-interface-descriptions/component-cpis/orchestrator-cpi.thrift @@ -0,0 +1,80 @@ +/* + * 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-apis/airavata_errors.thrift" +include "../data-models/experiment-catalog-models/process_model.thrift" +namespace java org.apache.airavata.orchestrator.cpi + +const string ORCHESTRATOR_CPI_VERSION = "0.16.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 gatewayId), + + /** + * In order to run single applications users should create an associating + * process and hand it over for execution + * along with a credential store token for sshKeyAuthentication + * + * @param processId + * @param airavataCredStoreToken + * @return sucess/failure + * + **/ + bool launchProcess (1: required string processId, 2: required string airavataCredStoreToken, 3: required string gatewayId), + + /** + * + * 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: airavata_errors.LaunchValidationException lve) + + bool validateProcess(1: required string experimentId, 2: required list<process_model.ProcessModel> processes) throws (1: airavata_errors.LaunchValidationException lve) + /** + * + * Terminate the running experiment. + * + * @param experimentID + * @return sucess/failure + * + **/ + bool terminateExperiment (1: required string experimentId, 2: required string gatewayId) +} http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/data-models/airavata_data_models.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/airavata_data_models.thrift b/thrift-interface-descriptions/data-models/airavata_data_models.thrift new file mode 100644 index 0000000..7cb9fd4 --- /dev/null +++ b/thrift-interface-descriptions/data-models/airavata_data_models.thrift @@ -0,0 +1,47 @@ +/* + * 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 "../airavata-apis/airavata_commons.thrift" +include "experiment-catalog-models/workspace_model.thrift" +include "../airavata-apis/airavata_errors.thrift" +include "../airavata-apis/messaging_events.thrift" +include "../airavata-apis/security_model.thrift" +include "experiment-catalog-models/experiment_model.thrift" +include "experiment-catalog-models/job_model.thrift" +include "experiment-catalog-models/task_model.thrift" +include "experiment-catalog-models/process_model.thrift" +include "experiment-catalog-models/scheduling_model.thrift" +include "experiment-catalog-models/status_models.thrift" +include "resource-catalog-models/data_movement_models.thrift" +include "data-catalog-models/replica_catalog_models.thrift" + +namespace java org.apache.airavata.model +namespace php Airavata.Model +namespace cpp apache.airavata.model +namespace py apache.airavata.model + +/* + * This file describes the definitions of the Airavata Execution 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. +*/ + + + http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/data-models/app-catalog-models/app_catalog_models.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/app-catalog-models/app_catalog_models.thrift b/thrift-interface-descriptions/data-models/app-catalog-models/app_catalog_models.thrift new file mode 100644 index 0000000..077ae84 --- /dev/null +++ b/thrift-interface-descriptions/data-models/app-catalog-models/app_catalog_models.thrift @@ -0,0 +1,22 @@ +/* + * 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 "application_deployment_model.thrift" +include "application_interface_model.thrift" \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/data-models/app-catalog-models/application_deployment_model.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/app-catalog-models/application_deployment_model.thrift b/thrift-interface-descriptions/data-models/app-catalog-models/application_deployment_model.thrift new file mode 100644 index 0000000..f96fd7a --- /dev/null +++ b/thrift-interface-descriptions/data-models/app-catalog-models/application_deployment_model.thrift @@ -0,0 +1,153 @@ +/* + * 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 file describes the definitions of the Data Structures related to deployment of Application on + * computational resources. + * +*/ + +include "../../airavata-apis/airavata_commons.thrift" + +namespace java org.apache.airavata.model.appcatalog.appdeployment +namespace php Airavata.Model.AppCatalog.AppDeployment +namespace cpp apache.airavata.model.appcatalog.appdeployment +namespace py apache.airavata.model.appcatalog.appdeployment + + +/** + * Key Value pairs to be used to set environments + * + * name: + * Name of the environment variable such as PATH, LD_LIBRARY_PATH, NETCDF_HOME. + * + * value: + * Value of the environment variable to set + * + * envPathOrder: + * The order of the setting of the env variables when there are multiple env variables +*/ +struct SetEnvPaths { + 1: required string name, + 2: required string value, + 3: optional i32 envPathOrder +} + +/** + * Job commands to be used in Pre Job, Post Job and Module Load Commands + * + * command: + * The actual command in string format + * + * commandOrder: + * Order of the command in the multiple command situation +*/ +struct CommandObject { + 1: required string command, + 2: optional i32 commandOrder +} + +/** + * Application Module Information. A module has to be registered before registering a deployment. + * + * appModuleId: Airavata Internal Unique Job ID. This is set by the registry. + * + * appModuleName: + * Name of the application module. + * + * appModuleVersion: + * Version of the application. + * + * appModuleDescription: + * Descriprion of the Module + * +*/ +struct ApplicationModule { + 1: required string appModuleId = airavata_commons.DEFAULT_ID, + 2: required string appModuleName, + 3: optional string appModuleVersion, + 4: optional string appModuleDescription +} + +/** + * Enumeration of application parallelism supported by Airavata + * + * SERIAL: + * Single processor applications without any parallelization. + * + * MPI: + * Messaging Passing Interface. + * + * OPENMP: + * Shared Memory Implementtaion. + * + * OPENMP_MPI: + * Hybrid Applications. + * +*/ +enum ApplicationParallelismType { + SERIAL, + MPI, + OPENMP, + OPENMP_MPI, + CCM, + CRAY_MPI +} +/** + * Application Deployment Description + * + * appDeploymentId: Airavata Internal Unique Job ID. This is set by the registry. + * + * appModuleName: + * Application Module Name. This has to be precise describing the binary. + * + * computeHostId: + * This ID maps application deployment to a particular resource previously described within Airavata. + * Example: Stampede is first registered and refered when registering WRF. + * + * moduleLoadCmd: + * Command string to load modules. This will be placed in the job submisison + * Ex: module load amber + * + * libPrependPaths: + * prepend to a path variable the value + * + * libAppendPaths: + * append to a path variable the value + * + * setEnvironment: + * assigns to the environment variable "NAME" the value + * +*/ +struct ApplicationDeploymentDescription { +// 1: required bool isEmpty = 0, + 1: required string appDeploymentId = airavata_commons.DEFAULT_ID, + 2: required string appModuleId, + 3: required string computeHostId, + 4: required string executablePath, + 5: required ApplicationParallelismType parallelism = ApplicationParallelismType.SERIAL, + 6: optional string appDeploymentDescription, + 7: optional list<CommandObject> moduleLoadCmds, + 8: optional list<SetEnvPaths> libPrependPaths, + 9: optional list<SetEnvPaths> libAppendPaths, + 10: optional list<SetEnvPaths> setEnvironment, + 11: optional list<CommandObject> preJobCommands, + 12: optional list<CommandObject> postJobCommands, +} http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/data-models/app-catalog-models/application_interface_model.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/app-catalog-models/application_interface_model.thrift b/thrift-interface-descriptions/data-models/app-catalog-models/application_interface_model.thrift new file mode 100644 index 0000000..690e454 --- /dev/null +++ b/thrift-interface-descriptions/data-models/app-catalog-models/application_interface_model.thrift @@ -0,0 +1,56 @@ +/* + * 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 file describes the definitions of the Data Structures of Application interfaces. These interfaces are mapped + * to application mapping on various resources. + * +*/ +include "application_io_models.thrift" +include "../../airavata-apis/airavata_commons.thrift" + +namespace java org.apache.airavata.model.appcatalog.appinterface +namespace php Airavata.Model.AppCatalog.AppInterface +namespace cpp apache.airavata.model.appcatalog.appinterface +namespace py apache.airavata.model.appcatalog.appinterface + + +/** + * Application Interface Description + * + * applicationModules: + * Associate all application modules with versions which interface is applicable to. + * + * applicationInputs: + * Inputs to be passed to the application + * + * applicationOutputs: + * Outputs generated from the application + * +*/ +struct ApplicationInterfaceDescription { +// 1: required bool isEmpty = 0, + 1: required string applicationInterfaceId = airavata_commons.DEFAULT_ID, + 2: required string applicationName, + 3: optional string applicationDescription, + 4: optional list<string> applicationModules, + 5: optional list<application_io_models.InputDataObjectType> applicationInputs, + 6: optional list<application_io_models.OutputDataObjectType> applicationOutputs +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/data-models/app-catalog-models/application_io_models.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/app-catalog-models/application_io_models.thrift b/thrift-interface-descriptions/data-models/app-catalog-models/application_io_models.thrift new file mode 100644 index 0000000..667a3e7 --- /dev/null +++ b/thrift-interface-descriptions/data-models/app-catalog-models/application_io_models.thrift @@ -0,0 +1,118 @@ +/* + * 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 "../resource-catalog-models/compute_resource_model.thrift" + +namespace java org.apache.airavata.model.application.io +namespace php Airavata.Model.Application.Io +namespace cpp apache.airavata.model.application.io +namespace py apache.airavata.model.application.io + +/** + * Data Types supported in Airavata. The primitive data types + * +*/ +enum DataType{ + STRING, + INTEGER, + FLOAT, + URI, + STDOUT, + STDERR +} + +/** + * Application Inputs. The paramters describe how inputs are passed to the application. + * + * name: + * Name of the parameter. + * + * value: + * Value of the parameter. A default value could be set during registration. + * + * type: + * Data type of the parameter + * + * applicationArguement: + * The argument flag sent to the application. Such as -p pressure. + * + * standardInput: + * When this value is set, the parameter is sent as standard input rather than a parameter. + * Typically this is passed using redirection operator ">". + * + * userFriendlyDescription: + * Description to be displayed at the user interface. + * + * metaData: + * Any metadat. This is typically ignore by Airavata and is used by gateways for application configuration. + * +*/ +struct InputDataObjectType { + 1: required string name, + 2: optional string value, + 3: optional DataType type, + 4: optional string applicationArgument, + 5: optional bool standardInput, + 6: optional string userFriendlyDescription, + 7: optional string metaData, + 8: optional i32 inputOrder, + 9: optional bool isRequired, + 10: optional bool requiredToAddedToCommandLine, + 11: optional bool dataStaged +} + +/** + * Application Outputs. The paramters describe how outputs generated by the application. + * + * name: + * Name of the parameter. + * + * value: + * Value of the parameter. + * + * type: + * Data type of the parameter + * + * applicationArguement: + * The argument flag sent to the application. Such as -p pressure. + * + * standardInput: + * When this value is set, the parameter is sent as standard input rather than a parameter. + * Typically this is passed using redirection operator ">". + * + * userFriendlyDescription: + * Description to be displayed at the user interface. + * + * metaData: + * Any metadat. This is typically ignore by Airavata and is used by gateways for application configuration. + * +*/ +struct OutputDataObjectType { + 1: required string name, + 2: optional string value, + 3: optional DataType type, + 4: optional string applicationArgument, + 5: optional bool isRequired, + 6: optional bool requiredToAddedToCommandLine, + 7: optional bool dataMovement, + 8: optional string location, + 9: optional string searchQuery, + 10: optional bool outputStreaming +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/data-models/data-catalog-models/replica_catalog_models.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/data-catalog-models/replica_catalog_models.thrift b/thrift-interface-descriptions/data-models/data-catalog-models/replica_catalog_models.thrift new file mode 100644 index 0000000..0d44941 --- /dev/null +++ b/thrift-interface-descriptions/data-models/data-catalog-models/replica_catalog_models.thrift @@ -0,0 +1,62 @@ +/* + * 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. + * + */ + + namespace java org.apache.airavata.model.data.resource + namespace php Airavata.Model.Data.Resource + namespace cpp apache.airavata.model.data.resource + namespace py apache.airavata.model.data.resource + +enum ReplicaLocationCategory { + GATEWAY_DATA_STORE, + COMPUTE_RESOURCE, + LONG_TERM_STORAGE_RESOURCE, + OTHER +} + +enum ReplicaPersistentType { + TRANSIENT, + PERSISTENT +} + +struct DataResourceModel { + 1: optional string resourceId, + 2: optional string gatewayId, + 3: optional string resourceName, + 4: optional string resourceDescription, + 5: optional string ownerName, + 6: optional i32 resourceSize, + 7: optional i64 creationTime, + 8: optional i64 lastModifiedTime, + 9: optional map<string, string> resourceMetadata, + 10: optional list<DataReplicaLocationModel> dataReplicaLocations +} + +struct DataReplicaLocationModel { + 1: optional string replicaId, + 2: optional string resourceId, + 3: optional string replicaName, + 4: optional string replicaDescription, + 5: optional i64 creationTime, + 6: optional i64 lastModifiedTime, + 7: optional ReplicaLocationCategory replicaLocationCategory, + 8: optional ReplicaPersistentType replicaPersistentType, + 9: optional list<string> dataLocations, + 10: optional map<string, string> replicaMetadata +} http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/data-models/experiment-catalog-models/experiment_model.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/experiment-catalog-models/experiment_model.thrift b/thrift-interface-descriptions/data-models/experiment-catalog-models/experiment_model.thrift new file mode 100644 index 0000000..98a2523 --- /dev/null +++ b/thrift-interface-descriptions/data-models/experiment-catalog-models/experiment_model.thrift @@ -0,0 +1,127 @@ +/* + * 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 "../../airavata-apis/airavata_commons.thrift" + include "../app-catalog-models/application_io_models.thrift" + include "scheduling_model.thrift" + include "status_models.thrift" + include "process_model.thrift" + + namespace java org.apache.airavata.model.experiment + namespace php Airavata.Model.Experiment + namespace cpp apache.airavata.model.experiment + namespace py apache.airavata.model.experiment + +enum ExperimentType { + SINGLE_APPLICATION, + WORKFLOW +} + +enum ExperimentSearchFields { + EXPERIMENT_NAME, + EXPERIMENT_DESC, + APPLICATION_ID, + FROM_DATE, + TO_DATE, + STATUS, + PROJECT_ID +} +/** + * A structure holding the experiment configuration. + * + * +*/ +struct UserConfigurationDataModel { + 1: required bool airavataAutoSchedule = 0, + 2: required bool overrideManualScheduledParams = 0, + 3: optional bool shareExperimentPublicly = 0, + 4: optional scheduling_model.ComputationalResourceSchedulingModel computationalResourceScheduling, + 5: optional bool throttleResources = 0, + 6: optional string userDN, + 7: optional bool generateCert = 0, + 8: optional string storageId; +} + +/** + * A structure holding the experiment metadata and its child models. + * + * userName: + * The user name of the targeted gateway end user on whose behalf the experiment is being created. + * the associated gateway identity can only be inferred from the security hand-shake so as to avoid + * authorized Airavata Clients mimicking an unauthorized request. If a gateway is not registered with + * Airavata, an authorization exception is thrown. + * + * experimentName: + * The name of the experiment as defined by the user. The name need not be unique as uniqueness is enforced + * by the generated experiment id. + * + * experimentDescription: + * The verbose description of the experiment. This is an optional parameter. +*/ + +struct ExperimentModel { + 1: required string experimentId = airavata_commons.DEFAULT_ID, + 2: required string projectId, + 3: required string gatewayId, + 4: required ExperimentType experimentType = ExperimentType.SINGLE_APPLICATION, + 5: required string userName, + 6: required string experimentName, + 7: optional i64 creationTime, + 8: optional string description, + 9: optional string executionId, + 10: optional string gatewayExecutionId, + 11: optional bool enableEmailNotification, + 12: optional list<string> emailAddresses, + 13: optional UserConfigurationDataModel userConfigurationData, + 14: optional list<application_io_models.InputDataObjectType> experimentInputs, + 15: optional list<application_io_models.OutputDataObjectType> experimentOutputs, + 16: optional status_models.ExperimentStatus experimentStatus, + 17: optional list<airavata_commons.ErrorModel> errors, + 18: optional list<process_model.ProcessModel> processes +} + +struct ExperimentSummaryModel { + 1: required string experimentId, + 2: required string projectId, + 3: required string gatewayId, + 4: optional i64 creationTime, + 5: required string userName, + 6: required string name, + 7: optional string description, + 8: optional string executionId, + 9: optional string resourceHostId, + 10: optional string experimentStatus, + 12: optional i64 statusUpdateTime +} + +struct ExperimentStatistics { + 1: required i32 allExperimentCount, + 2: required i32 completedExperimentCount, + 3: optional i32 cancelledExperimentCount, + 4: required i32 failedExperimentCount, + 5: required i32 createdExperimentCount, + 6: required i32 runningExperimentCount, + 7: required list<ExperimentSummaryModel> allExperiments, + 8: optional list<ExperimentSummaryModel> completedExperiments, + 9: optional list<ExperimentSummaryModel> failedExperiments, + 10: optional list<ExperimentSummaryModel> cancelledExperiments, + 11: optional list<ExperimentSummaryModel> createdExperiments, + 12: optional list<ExperimentSummaryModel> runningExperiments, +} http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/data-models/experiment-catalog-models/job_model.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/experiment-catalog-models/job_model.thrift b/thrift-interface-descriptions/data-models/experiment-catalog-models/job_model.thrift new file mode 100644 index 0000000..f908c5e --- /dev/null +++ b/thrift-interface-descriptions/data-models/experiment-catalog-models/job_model.thrift @@ -0,0 +1,42 @@ +/* + * 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 "status_models.thrift" + + namespace java org.apache.airavata.model.job + namespace php Airavata.Model.Job + namespace cpp apache.airavata.model.job + namespace py apache.airavata.model.job + +struct JobModel { + 1: required string jobId, + 2: required string taskId, + 3: required string processId, + 4: required string jobDescription, + 5: optional i64 creationTime, + 6: optional status_models.JobStatus jobStatus, + 7: optional string computeResourceConsumed, + 8: optional string jobName, + 9: optional string workingDir, + 10: optional string stdOut, + 11: optional string stdErr, + 12: optional i32 exitCode +} + http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift b/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift new file mode 100644 index 0000000..66c5f93 --- /dev/null +++ b/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.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 "../../airavata-apis/airavata_commons.thrift" +include "../app-catalog-models/application_io_models.thrift" +include "status_models.thrift" +include "task_model.thrift" +include "scheduling_model.thrift" + +namespace java org.apache.airavata.model.process +namespace php Airavata.Model.Process +namespace cpp apache.airavata.model.process +namespace py apache.airavata.model.process + + +/** + * ProcessModel: A structure holding the process details. The infromation is derived based on user provided + * configuration data or system inferred information from scheduling and QoS parameters. + * + * processDetail: + * A friendly description of the process, usally used to communicate information to users. + * + * +*/ +struct ProcessModel { + 1: required string processId = airavata_commons.DEFAULT_ID, + 2: required string experimentId, + 3: optional i64 creationTime, + 4: optional i64 lastUpdateTime, + 5: optional status_models.ProcessStatus processStatus, + 6: optional string processDetail, + 7: optional string applicationInterfaceId, + 8: optional string applicationDeploymentId, + 9: optional string computeResourceId, + 10: optional list<application_io_models.InputDataObjectType> processInputs, + 11: optional list<application_io_models.OutputDataObjectType> processOutputs, + 12: optional scheduling_model.ComputationalResourceSchedulingModel resourceSchedule, + 13: optional list<task_model.TaskModel> tasks, + 14: optional string taskDag, + 15: optional airavata_commons.ErrorModel processError, + 16: optional string gatewayExecutionId, + 17: optional bool enableEmailNotification, + 18: optional list<string> emailAddresses, + 19: optional string storageResourceId, + 20: optional string userDn, + 21: optional bool generateCert = 0 +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/data-models/experiment-catalog-models/scheduling_model.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/experiment-catalog-models/scheduling_model.thrift b/thrift-interface-descriptions/data-models/experiment-catalog-models/scheduling_model.thrift new file mode 100644 index 0000000..61d33a8 --- /dev/null +++ b/thrift-interface-descriptions/data-models/experiment-catalog-models/scheduling_model.thrift @@ -0,0 +1,41 @@ +/* + * 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. + * + */ + +namespace java org.apache.airavata.model.scheduling +namespace php Airavata.Model.Scheduling +namespace cpp apache.airavata.model.scheduling +namespace py apache.airavata.model.scheduling + +/** + * ComputationalResourceSchedulingModel: + * + * +*/ +struct ComputationalResourceSchedulingModel { + 1: optional string resourceHostId, + 2: optional i32 totalCPUCount, + 3: optional i32 nodeCount, + 4: optional i32 numberOfThreads, + 5: optional string queueName, + 6: optional i32 wallTimeLimit, + 7: optional i32 totalPhysicalMemory, + 8: optional string chessisNumber, + 9: optional string staticWorkingDir +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/data-models/experiment-catalog-models/status_models.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/experiment-catalog-models/status_models.thrift b/thrift-interface-descriptions/data-models/experiment-catalog-models/status_models.thrift new file mode 100644 index 0000000..b3838ee --- /dev/null +++ b/thrift-interface-descriptions/data-models/experiment-catalog-models/status_models.thrift @@ -0,0 +1,109 @@ +/* + * 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. + * + */ + +namespace java org.apache.airavata.model.status +namespace php Airavata.Model.Status +namespace cpp apache.airavata.model.status +namespace py apache.airavata.model.status + +enum ExperimentState { + CREATED, + VALIDATED, + SCHEDULED, + LAUNCHED, + EXECUTING, + CANCELING, + CANCELED, + COMPLETED, + FAILED +} + +enum TaskState { + CREATED, + EXECUTING, + COMPLETED, + FAILED, + CANCELED +} + +enum ProcessState { + CREATED, + VALIDATED, + STARTED, + PRE_PROCESSING, + CONFIGURING_WORKSPACE, + INPUT_DATA_STAGING, + EXECUTING, + MONITORING, + OUTPUT_DATA_STAGING, + POST_PROCESSING, + COMPLETED, + FAILED, + CANCELLING, + CANCELED +} + +enum JobState { + SUBMITTED, + QUEUED, + ACTIVE, + COMPLETE, + CANCELED, + FAILED, + SUSPENDED, + UNKNOWN +} + +/** + * Status: A generic status object. + * + * state: + * State . + * + * timeOfStateChange: + * time the status was last updated. + * + * reason: + * User friendly reason on how the state is inferred. + * +*/ +struct ExperimentStatus { + 1: required ExperimentState state, + 2: optional i64 timeOfStateChange, + 3: optional string reason +} + +struct ProcessStatus { + 1: required ProcessState state, + 2: optional i64 timeOfStateChange, + 3: optional string reason +} + +struct TaskStatus { + 1: required TaskState state, + 2: optional i64 timeOfStateChange, + 3: optional string reason +} + +struct JobStatus { + 1: required JobState jobState, + 2: optional i64 timeOfStateChange, + 3: optional string reason +} http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/data-models/experiment-catalog-models/task_model.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/experiment-catalog-models/task_model.thrift b/thrift-interface-descriptions/data-models/experiment-catalog-models/task_model.thrift new file mode 100644 index 0000000..53a7fb5 --- /dev/null +++ b/thrift-interface-descriptions/data-models/experiment-catalog-models/task_model.thrift @@ -0,0 +1,109 @@ +/* + * 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 "../../airavata-apis/airavata_commons.thrift" +include "../resource-catalog-models/compute_resource_model.thrift" +include "../resource-catalog-models/data_movement_models.thrift" +include "../app-catalog-models/application_io_models.thrift" +include "status_models.thrift" +include "job_model.thrift" + +namespace java org.apache.airavata.model.task +namespace php Airavata.Model.Task +namespace cpp apache.airavata.model.task +namespace py apache.airavata.model.task + +/** + * TaskTypes: An enumerated list of TaskTypes. Task being generic, the task type will provide the concrete interpretation. + * +*/ +enum TaskTypes { + ENV_SETUP, + DATA_STAGING, + JOB_SUBMISSION, + ENV_CLEANUP, + MONITORING, + OUTPUT_FETCHING +} + +/** + * TaskModel: A structure holding the generic task details. + * + * taskDetail: + * A friendly description of the task, usally used to communicate information to users. + * + * subTaskModel: + * A generic byte object for the Task developer to store internal serialized data into registry catalogs. +*/ +struct TaskModel { + 1: required string taskId = airavata_commons.DEFAULT_ID, + 2: required TaskTypes taskType, + 3: required string parentProcessId, + 4: required i64 creationTime, + 5: required i64 lastUpdateTime, + 6: required status_models.TaskStatus taskStatus, + 7: optional string taskDetail, + 8: optional binary subTaskModel, + 9: optional airavata_commons.ErrorModel taskError, + 10: optional list<job_model.JobModel> jobs +} + +/** + * DataStagingTaskModel: A structure holding the data staging task details. + * + * Source and Destination locations includes standard representation of protocol, host, port and path + * A friendly description of the task, usally used to communicate information to users. + * +*/ + +enum DataStageType { + INPUT, + OUPUT + +} +struct DataStagingTaskModel { + 1: required string source, + 2: required string destination, + 3: required DataStageType type, + 4: optional i64 transferStartTime, + 5: optional i64 transferEndTime, + 6: optional string transferRate, + 7: optional application_io_models.InputDataObjectType processInput, + 8: optional application_io_models.OutputDataObjectType processOutput +} + +/** +* EnvironmentSetupTaskModel: A structure holding the environment creation task details +**/ +struct EnvironmentSetupTaskModel { + 1: required string location, + 2: required data_movement_models.SecurityProtocol protocol +} + + +struct JobSubmissionTaskModel { + 1: required compute_resource_model.JobSubmissionProtocol jobSubmissionProtocol, + 2: required compute_resource_model.MonitorMode monitorMode, + 3: optional i32 wallTime +} + +struct MonitorTaskModel { + 1: required compute_resource_model.MonitorMode monitorMode +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/6c5e9954/thrift-interface-descriptions/data-models/experiment-catalog-models/workspace_model.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/experiment-catalog-models/workspace_model.thrift b/thrift-interface-descriptions/data-models/experiment-catalog-models/workspace_model.thrift new file mode 100644 index 0000000..98622ff --- /dev/null +++ b/thrift-interface-descriptions/data-models/experiment-catalog-models/workspace_model.thrift @@ -0,0 +1,63 @@ +/* + * 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 "../../airavata-apis/airavata_commons.thrift" + +namespace java org.apache.airavata.model.workspace +namespace php Airavata.Model.Workspace +namespace cpp apache.airavata.model.workspace +namespace py apache.airavata.model.workspace + +/* + * This file describes the definitions of the Airavata Workspace. The workspace is a container for all user data + * organized as Projects and Experiment within them. + * + * The Experiment data model is divided into 6 categories: experiment metadata, experiment configuration + * data, experiment generated data, experiment monitoring data, provenance data and error handling data. + * + * +*/ + +struct Group { + 1: required string groupName, + 2: optional string description +} + +struct Project { + 1: required string projectID = airavata_commons.DEFAULT_ID, + 2: required string owner, + 3: required string name, + 4: optional string description + 5: optional i64 creationTime + 6: optional list<string> sharedUsers, + 7: optional list<string> sharedGroups +} + +struct User { + 1: required string userName, + 2: optional list<Group> groupList +} + +struct Gateway { + 1: required string gatewayId, + 2: optional string gatewayName, + 3: optional string domain, + 4: optional string emailAddress +} \ No newline at end of file
