http://git-wip-us.apache.org/repos/asf/airavata/blob/7463558e/component-interface-descriptions/thrift-interface-descriptions/airavataDataModel.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/thrift-interface-descriptions/airavataDataModel.thrift b/component-interface-descriptions/thrift-interface-descriptions/airavataDataModel.thrift new file mode 100644 index 0000000..74de1da --- /dev/null +++ b/component-interface-descriptions/thrift-interface-descriptions/airavataDataModel.thrift @@ -0,0 +1,38 @@ +/* + * 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 "workspaceModel.thrift" +include "airavataErrors.thrift" +include "messagingEvents.thrift" +include "securityModel.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/7463558e/component-interface-descriptions/thrift-interface-descriptions/airavataErrors.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/thrift-interface-descriptions/airavataErrors.thrift b/component-interface-descriptions/thrift-interface-descriptions/airavataErrors.thrift new file mode 100644 index 0000000..6ffd5d5 --- /dev/null +++ b/component-interface-descriptions/thrift-interface-descriptions/airavataErrors.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 "experimentModel.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 authentication 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/7463558e/component-interface-descriptions/thrift-interface-descriptions/appCatalogModels.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/thrift-interface-descriptions/appCatalogModels.thrift b/component-interface-descriptions/thrift-interface-descriptions/appCatalogModels.thrift new file mode 100644 index 0000000..9140e01 --- /dev/null +++ b/component-interface-descriptions/thrift-interface-descriptions/appCatalogModels.thrift @@ -0,0 +1,24 @@ +/* + * 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 "computeResourceModel.thrift" +include "applicationDeploymentModel.thrift" +include "applicationInterfaceModel.thrift" +include "gatewayResourceProfileModel.thrift" \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/7463558e/component-interface-descriptions/thrift-interface-descriptions/applicationDeploymentModel.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/thrift-interface-descriptions/applicationDeploymentModel.thrift b/component-interface-descriptions/thrift-interface-descriptions/applicationDeploymentModel.thrift new file mode 100644 index 0000000..a965e23 --- /dev/null +++ b/component-interface-descriptions/thrift-interface-descriptions/applicationDeploymentModel.thrift @@ -0,0 +1,132 @@ +/* + * 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. + * +*/ + +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 + +const string DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS" + +/** + * 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 +*/ +struct SetEnvPaths { + 1: required string name, + 2: required string value +} + +/** + * 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 = 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 +} +/** + * 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 = 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<string> moduleLoadCmds, + 8: optional list<SetEnvPaths> libPrependPaths, + 9: optional list<SetEnvPaths> libAppendPaths, + 10: optional list<SetEnvPaths> setEnvironment, + 11: optional list<string> preJobCommands, + 12: optional list<string> postJobCommands, +} http://git-wip-us.apache.org/repos/asf/airavata/blob/7463558e/component-interface-descriptions/thrift-interface-descriptions/applicationInterfaceModel.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/thrift-interface-descriptions/applicationInterfaceModel.thrift b/component-interface-descriptions/thrift-interface-descriptions/applicationInterfaceModel.thrift new file mode 100644 index 0000000..4c57009 --- /dev/null +++ b/component-interface-descriptions/thrift-interface-descriptions/applicationInterfaceModel.thrift @@ -0,0 +1,146 @@ +/* + * 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. + * +*/ + +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 + +const string DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS" + +/** + * 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 = 0, + 6: optional string userFriendlyDescription, + 7: optional string metaData, + 8: optional i32 inputOrder, + 9: optional bool isRequired, + 10: optional bool requiredToAddedToCommandLine, + 11: optional bool dataStaged = 0 +} + +/** + * 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 +} + +/** + * 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 = DEFAULT_ID, + 2: required string applicationName, + 3: optional string applicationDescription, + 4: optional list<string> applicationModules, + 5: optional list<InputDataObjectType> applicationInputs, + 6: optional list<OutputDataObjectType> applicationOutputs +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/7463558e/component-interface-descriptions/thrift-interface-descriptions/computeResourceModel.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/thrift-interface-descriptions/computeResourceModel.thrift b/component-interface-descriptions/thrift-interface-descriptions/computeResourceModel.thrift new file mode 100644 index 0000000..6e8361c --- /dev/null +++ b/component-interface-descriptions/thrift-interface-descriptions/computeResourceModel.thrift @@ -0,0 +1,445 @@ +/* + * 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.appcatalog.computeresource +namespace php Airavata.Model.AppCatalog.ComputeResource +namespace cpp apache.airavata.model.appcatalog.computeresource +namespace py apache.airavata.model.appcatalog.computeresource + +const string DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS" + +/** + * Enumeration of local resource job manager types supported by Airavata + * + * FORK: + * Forking of commands without any job manager + * + * PBS: + * Job manager supporting the Portal Batch System (PBS) protocol. Some examples include TORQUE, PBSPro, Grid Engine. + * + * SLURM: + * The Simple Linux Utility for Resource Management is a open source workload manager. + * + * UGE: + * Univa Grid Engine, a variation of PBS implementation. + * + * LSF: + * IBM Platform Load Sharing Facility is dominantly installed on IBM clusters. + * +*/ +enum ResourceJobManagerType { + FORK, + PBS, + SLURM, + LSF, + UGE +} + +/** + * Enumeration of resource job manager commands + * + * SUBMISSION: + * Ex: qsub, sbatch + * + * JOBMONITORING: + * Ex: qstat, squeue + * + * DELETION: + * Ex: qdel, scancel + * + * CHECK_JOB: + * Detailed Status about the Job. Ex: checkjob + * + * SHOW_QUEUE: + * List of Queued Job by the schedular. Ex: showq + * + * SHOW_RESERVATION: + * List all reservations. Ex:showres, show_res + * + * SHOW_START: + * Display the start time of the specified job. Ex: showstart + * +*/ +enum JobManagerCommand { + SUBMISSION, + JOB_MONITORING, + DELETION, + CHECK_JOB, + SHOW_QUEUE, + SHOW_RESERVATION, + SHOW_START +} + + +/** + * Resource Job Manager Information + * + * resourceJobManagerType: + * A typical HPC cluster has a single Job Manager to manage the resources. + * + * pushMonitoringEndpoint: + * If the job manager pushes out state changes to a database or bus, specify the service endpoint. + * Ex: Moab Web Service, Moab MongoDB URL, AMQP (GLUE2) Broker + * + * jobManagerBinPath: + * Path to the Job Manager Installation Binary directory. + * + * jobManagerCommands: + * An enumeration of commonly used manager commands. + * +*/ +struct ResourceJobManager { + 1: required string resourceJobManagerId = DEFAULT_ID, + 2: required ResourceJobManagerType resourceJobManagerType, + 3: optional string pushMonitoringEndpoint, + 4: optional string jobManagerBinPath, + 5: optional map<JobManagerCommand, string> jobManagerCommands +} + +/** + * Enumeration of File Systems on the resource + * + * FORK: + * Forking of commands without any job manager + * + * PBS: + * Job manager supporting the Portal Batch System (PBS) protocol. Some examples include TORQUE, PBSPro, Grid Engine. + * + * UGE: + * Univa Grid Engine, a variation of PBS implementation. + * + * SLURM: + * The Simple Linux Utility for Resource Management is a open source workload manager. + * +*/ +enum FileSystems { + HOME, + WORK, + LOCALTMP, + SCRATCH, + ARCHIVE +} + +/** + * Batch Queue Information on SuperComputers + * + * maxRunTime: + * Maximum allowed run time in hours. +*/ +struct BatchQueue { + 1: required string queueName, + 2: optional string queueDescription, + 3: optional i32 maxRunTime, + 4: optional i32 maxNodes, + 5: optional i32 maxProcessors, + 6: optional i32 maxJobsInQueue, + 7: optional i32 maxMemory +} + +/** + * Enumeration of security authentication and authorization mechanisms supported by Airavata. This enumeration just + * describes the supported mechanism. The corresponding security credentials are registered with Airavata Credential + * store. + * + * USERNAME_PASSWORD: + * A User Name. + * + * SSH_KEYS: + * SSH Keys + * + * FIXME: Change GSI to a more precise generic security protocol - X509 + * +*/ +enum SecurityProtocol { + USERNAME_PASSWORD, + SSH_KEYS, + GSI, + KERBEROS, + OAUTH +} + +/** + * Enumeration of Airavata supported Job Submission Mechanisms for High Performance Computing Clusters. + * + * SSH: + * Execute remote job submission commands using via secure shell protocol. + * + * GRAM: + * Execute remote jobs via Globus GRAM service. + * + * UNICORE: + * Execute remote jobs via Unicore services + * +*/ +enum JobSubmissionProtocol { + LOCAL, + SSH, + GLOBUS, + UNICORE, + CLOUD +} + +/** +* Monitoring modes +* +* POLL_JOB_MANAGER: +* GFac need to pull job status changes. +* +* XSEDE_AMQP_SUBSCRIBE: +* Server will publish job status changes to amqp servert. +* +**/ +enum MonitorMode { + POLL_JOB_MANAGER, + JOB_EMAIL_NOTIFICATION_MONITOR, + XSEDE_AMQP_SUBSCRIBE +} + +/** + * Enumeration of data movement supported by Airavata + * + * SCP: + * Job manager supporting the Portal Batch System (PBS) protocol. Some examples include TORQUE, PBSPro, Grid Engine. + * + * SFTP: + * The Simple Linux Utility for Resource Management is a open source workload manager. + * + * GridFTP: + * Globus File Transfer Protocol + * + * UNICORE_STORAGE_SERVICE: + * Storage Service Provided by Unicore + * +*/ +enum DataMovementProtocol { + LOCAL, + SCP, + SFTP, + GridFTP, + UNICORE_STORAGE_SERVICE +} + +/** + * Data Movement through Secured Copy + * + * alternativeSCPHostName: + * If the login to scp is different than the hostname itself, specify it here + * + * sshPort: + * If a non-default port needs to used, specify it. +*/ +struct SCPDataMovement { + 1: required string dataMovementInterfaceId = DEFAULT_ID, + 2: required SecurityProtocol securityProtocol, + 3: optional string alternativeSCPHostName, + 4: optional i32 sshPort = 22 +} + +/** + * Data Movement through GridFTP + * + * alternativeSCPHostName: + * If the login to scp is different than the hostname itself, specify it here + * + * sshPort: + * If a non-default port needs to used, specify it. +*/ +struct GridFTPDataMovement { + 1: required string dataMovementInterfaceId = DEFAULT_ID, + 2: required SecurityProtocol securityProtocol, + 3: required list<string> gridFTPEndPoints +} + +/** + * Data Movement through UnicoreStorage + * + * unicoreEndPointURL: + * unicoreGateway End Point. The provider will query this service to fetch required service end points. +*/ +struct UnicoreDataMovement { + 1: required string dataMovementInterfaceId = DEFAULT_ID, + 2: required SecurityProtocol securityProtocol, + 3: required string unicoreEndPointURL +} + +/** + * Locally Fork Jobs as OS processes + * + * alternativeSSHHostName: + * If the login to ssh is different than the hostname itself, specify it here + * + * sshPort: + * If a non-default port needs to used, specify it. +*/ +struct LOCALSubmission { + 1: required string jobSubmissionInterfaceId = DEFAULT_ID, + 2: required ResourceJobManager resourceJobManager +} + +/** + * LOCAL + * + * alternativeSCPHostName: + * If the login to scp is different than the hostname itself, specify it here + * + * sshPort: + * If a non-defualt port needs to used, specify it. +*/ +struct LOCALDataMovement { + 1: required string dataMovementInterfaceId = DEFAULT_ID, +} + +/** + * Authenticate using Secured Shell + * + * alternativeSSHHostName: + * If the login to ssh is different than the hostname itself, specify it here + * + * sshPort: + * If a non-default port needs to used, specify it. +*/ +struct SSHJobSubmission { + 1: required string jobSubmissionInterfaceId = DEFAULT_ID, + 2: required SecurityProtocol securityProtocol, + 3: required ResourceJobManager resourceJobManager, + 4: optional string alternativeSSHHostName, + 5: optional i32 sshPort = 22, + 6: optional MonitorMode monitorMode, +} + +struct GlobusJobSubmission { + 1: required string jobSubmissionInterfaceId = DEFAULT_ID, + 2: required SecurityProtocol securityProtocol, + 3: optional list<string> globusGateKeeperEndPoint +} + +/** + * Unicore Job Submission + * + * unicoreEndPointURL: + * unicoreGateway End Point. The provider will query this service to fetch required service end points. + * authenticationMode + * The authenticationMode defines the way certificate is fetched. +*/ +struct UnicoreJobSubmission { + 1: required string jobSubmissionInterfaceId = DEFAULT_ID, + 2: required SecurityProtocol securityProtocol, + 3: required string unicoreEndPointURL, +} + + + +/** +* Provider name +**/ +enum ProviderName { + EC2, + AWSEC2, + RACKSPACE +} + +/** + * Cloud Job Submission + * + * +*/ +struct CloudJobSubmission { + 1: required string jobSubmissionInterfaceId = DEFAULT_ID, + 2: required SecurityProtocol securityProtocol, + 3: required string nodeId, + 4: required string executableType, + 5: required ProviderName providerName, + 6: required string userAccountName +} + +/** + * Job Submission Interfaces + * + * jobSubmissionInterfaceId: The Job Submission Interface has to be previously registered and referenced here. + * + * priorityOrder: + * For resources with multiple interfaces, the priority order should be selected. + * Lower the numerical number, higher the priority + * +*/ +struct JobSubmissionInterface { + 1: required string jobSubmissionInterfaceId, + 2: required JobSubmissionProtocol jobSubmissionProtocol + 3: required i32 priorityOrder = 0, +} + +/** + * Data Movement Interfaces + * + * dataMovementInterfaceId: The Data Movement Interface has to be previously registered and referenced here. + * + * priorityOrder: + * For resources with multiple interfaces, the priority order should be selected. + * Lower the numerical number, higher the priority + * +*/ +struct DataMovementInterface { + 1: required string dataMovementInterfaceId, + 2: required DataMovementProtocol dataMovementProtocol, + 3: required i32 priorityOrder = 0, +} + +/** + * Computational Resource Description + * + * computeResourceId: Airavata Internal Unique Identifier to distinguish Compute Resource. + * + * hostName: + * Fully Qualified Host Name. + * + * hostAliases: + * Aliases if any. + * + * ipAddress: + * IP Addresses of the Resource. + * + * resourceDescription: + * A user friendly description of the resource. + * + * JobSubmissionProtocols: + * A computational resources may have one or more ways of submitting Jobs. This structure + * will hold all available mechanisms to interact with the resource. + * The key is the priority + * + * DataMovementProtocol: + * Option to specify a prefered data movement mechanism of the available options. + * + * fileSystems: + * Map of file systems type and the path. + * +*/ +struct ComputeResourceDescription { +// 1: required bool isEmpty = 0, + 1: required string computeResourceId = DEFAULT_ID, + 2: required string hostName, + 3: optional list<string> hostAliases, + 4: optional list<string> ipAddresses, + 5: optional string resourceDescription, + 6: optional list<BatchQueue> batchQueues, + 7: optional map<FileSystems, string> fileSystems, + 8: optional list<JobSubmissionInterface> jobSubmissionInterfaces, + 9: optional list<DataMovementInterface> dataMovementInterfaces, + 10: optional i32 maxMemoryPerNode +} http://git-wip-us.apache.org/repos/asf/airavata/blob/7463558e/component-interface-descriptions/thrift-interface-descriptions/experimentModel.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/thrift-interface-descriptions/experimentModel.thrift b/component-interface-descriptions/thrift-interface-descriptions/experimentModel.thrift new file mode 100644 index 0000000..d0d50f9 --- /dev/null +++ b/component-interface-descriptions/thrift-interface-descriptions/experimentModel.thrift @@ -0,0 +1,411 @@ +/* + * 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 "computeResourceModel.thrift" +include "applicationInterfaceModel.thrift" + +namespace java org.apache.airavata.model.workspace.experiment +namespace php Airavata.Model.Workspace.Experiment +namespace cpp apache.airavata.model.workspace.experiment +namespace py apache.airavata.model.workspace.experiment + +/* + * This file describes the definitions of the Airavata 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. + * + * 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. + * + * Experiment Metadata: + * this structure holds the owner of the experiment, name, description, creation and last update times, + * last known status, and if is private to the user or shared publicly. + * FIXME: To start with, we will not define this but populate it inferring data from other structures. This + * structure needs revisiting once the API gets used. + * + * Experiment Configuration Data: + * this structure will contain all user provided configuration data. + * + * Experiment Generated Data: + * this structure describes all intermediate and output data generated by executing the experiment. + * + * Experiment Monitoring Data: + * this structure contains fine grained experiment status information. + * + * Experiment Summary Data: + * this is derived information from all experiment objects to provide a quick summary. + * +*/ + +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 ExperimentState { + CREATED, + VALIDATED, + SCHEDULED, + LAUNCHED, + EXECUTING, + CANCELING, + CANCELED, + SUSPENDED, + COMPLETED, + FAILED, + UNKNOWN +} + +enum ExperimentSearchFields { + EXPERIMENT_NAME, + EXPERIMENT_DESC, + APPLICATION_ID, + FROM_DATE, + TO_DATE, + STATUS +} + +struct ExperimentStatus { + 1: required ExperimentState experimentState, + 2: optional i64 timeOfStateChange +} + +enum WorkflowNodeState { + INVOKED, + EXECUTING, + CANCELING, + CANCELED, + SUSPENDED, + COMPLETED, + FAILED, + UNKNOWN +} + +struct WorkflowNodeStatus { + 1: required WorkflowNodeState workflowNodeState, + 2: optional i64 timeOfStateChange +} + +enum TaskState { + WAITING, + STARTED, + PRE_PROCESSING, + CONFIGURING_WORKSPACE, + INPUT_DATA_STAGING, + OUTPUT_DATA_STAGING, + POST_PROCESSING, + EXECUTING, + CANCELING, + CANCELED, + COMPLETED, + FAILED, + UNKNOWN +} + +struct TaskStatus { + 1: required TaskState executionState, + 2: optional i64 timeOfStateChange +} + +enum JobState { + SUBMITTED, + UN_SUBMITTED, + SETUP, + QUEUED, + ACTIVE, + COMPLETE, + CANCELING, + CANCELED, + FAILED, + HELD, + SUSPENDED, + UNKNOWN +} + +struct JobStatus { + 1: required JobState jobState, + 2: optional i64 timeOfStateChange +} + +enum TransferState { + DIRECTORY_SETUP, + UPLOAD, + DOWNLOAD, + ACTIVE, + COMPLETE, + STDOUT_DOWNLOAD, + STDERROR_DOWNLOAD, + CANCELING, + CANCELED, + FAILED, + HELD, + SUSPENDED, + UNKNOWN +} + +struct TransferStatus { + 1: required TransferState transferState, + 2: optional i64 timeOfStateChange +} + +struct ApplicationStatus { + 1: required string applicationState, + 2: optional i64 timeOfStateChange +} + +enum ActionableGroup { + RESOURCE_ADMINS, + AIRAVATA_ADMINS, + GATEWAYS_ADMINS, + USER, + CANNOT_BE_DETERMINED +} + +enum ErrorCategory { + FILE_SYSTEM_FAILURE, + APPLICATION_FAILURE, + RESOURCE_NODE_FAILURE, + DISK_FULL, + INSUFFICIENT_ALLOCATION, + SYSTEM_MAINTENANCE, + AIRAVATA_INTERNAL_ERROR, + CANNOT_BE_DETERMINED +} + +enum CorrectiveAction { + RETRY_SUBMISSION, + CONTACT_SUPPORT, + CANNOT_BE_DETERMINED +} + +/** + * A structure holding the Computational Resource Scheduling. + * +*/ +struct ComputationalResourceScheduling { + 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 jobStartTime, + 8: optional i32 totalPhysicalMemory, + 9: optional string computationalProjectAccount, + 10: optional string chassisName +} + +/** + * A structure holding specified input data handling. + * +*/ +struct AdvancedInputDataHandling { + 1: optional bool stageInputFilesToWorkingDir = 0, + 2: optional string parentWorkingDirectory, + 3: optional string uniqueWorkingDirectory, + 4: optional bool cleanUpWorkingDirAfterJob = 0 +} + +/** + * A structure holding specified output data handling. + * +*/ +struct AdvancedOutputDataHandling { + 2: optional string outputDataDir, + 3: optional string dataRegistryURL, + 4: optional bool persistOutputData = 1 +} + +/** + * A structure holding Quality of Service Parameters. + * +*/ +struct QualityOfServiceParams { + 1: optional string startExecutionAt, + 2: optional string executeBefore, + 3: optional i32 numberofRetries +} + +/** + * A structure holding the experiment configuration. + * + * +*/ +struct UserConfigurationData { + 1: required bool airavataAutoSchedule = 0, + 2: required bool overrideManualScheduledParams = 0, + 3: optional bool shareExperimentPublicly = 0, + 4: optional ComputationalResourceScheduling computationalResourceScheduling, + 5: optional AdvancedInputDataHandling advanceInputDataHandling, + 6: optional AdvancedOutputDataHandling advanceOutputDataHandling, + 7: optional QualityOfServiceParams qosParams, + 8: optional bool throttleResources = 0, + 9: optional string userDN, + 10: optional bool generateCert = 0 +} + +struct ErrorDetails { + 1: required string errorID = DEFAULT_ID, + 2: optional i64 creationTime, + 3: optional string actualErrorMessage, + 4: optional string userFriendlyMessage, + 5: optional ErrorCategory errorCategory, + 6: optional bool transientOrPersistent = 0, + 7: optional CorrectiveAction correctiveAction, + 8: optional ActionableGroup actionableGroup, + 9: optional list<string> rootCauseErrorIdList +} + +struct JobDetails { + 1: required string jobID = DEFAULT_ID, + 2: required string jobDescription, + 3: optional i64 creationTime, + 4: optional JobStatus jobStatus, + 5: optional ApplicationStatus applicationStatus, + 6: optional list<ErrorDetails> errors, + 7: optional string computeResourceConsumed, + 8: optional string jobName, + 9: optional string workingDir +} + +struct DataTransferDetails { + 1: required string transferID = DEFAULT_ID, + 2: optional i64 creationTime, + 3: required string transferDescription, + 4: optional TransferStatus transferStatus, +} + +/** + * A structure holding the actual execution context decided based on user provided configuration data or system inferred + * information from scheduling and QoS parameters. One experiment can have multiple tasks. Each tasks results in + * data transfers and jobs + * +*/ +struct TaskDetails { + 1: required string taskID = DEFAULT_ID, + 2: optional i64 creationTime, + 3: optional string applicationId, + 4: optional string applicationVersion, + 5: optional string applicationDeploymentId, + 6: optional list<applicationInterfaceModel.InputDataObjectType> applicationInputs, + 7: optional list<applicationInterfaceModel.OutputDataObjectType> applicationOutputs, + 8: optional ComputationalResourceScheduling taskScheduling, + 9: optional AdvancedInputDataHandling advancedInputDataHandling, + 10: optional AdvancedOutputDataHandling advancedOutputDataHandling, + 11: optional TaskStatus taskStatus, + 12: optional list<JobDetails> jobDetailsList, + 13: optional list<DataTransferDetails> dataTransferDetailsList, + 14: optional list<ErrorDetails> errors, + 15: optional bool enableEmailNotification, + 16: optional list<string> emailAddresses, +} + +enum ExecutionUnit { + INPUT, + APPLICATION, + OUTPUT, + OTHER +} + + +/** +* A structure holding the node data. +* nodeInstanceId - unique node identifier for each run +*/ +struct WorkflowNodeDetails { + 1: required string nodeInstanceId = DEFAULT_ID, + 2: optional i64 creationTime, + 3: required string nodeName = SINGLE_APP_NODE_NAME, + 4: required ExecutionUnit executionUnit = ExecutionUnit.APPLICATION, + 5: optional string executionUnitData, + 6: optional list<applicationInterfaceModel.InputDataObjectType> nodeInputs, + 7: optional list<applicationInterfaceModel.OutputDataObjectType> nodeOutputs, + 8: optional WorkflowNodeStatus workflowNodeStatus, + 9: optional list<TaskDetails> taskDetailsList, + 10: optional list<ErrorDetails> errors +} + +/** +* 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 +} +/** + * 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 Experiment { + 1: required string experimentID = DEFAULT_ID, + 2: required string projectID = DEFAULT_PROJECT_NAME, + 3: optional i64 creationTime, + 4: required string userName, + 5: required string name, + 6: optional string description, + 7: optional string applicationId, + 8: optional string applicationVersion, + 9: optional string workflowTemplateId, + 10: optional string workflowTemplateVersion, + 11: optional string gatewayExecutionId, + 12: optional bool enableEmailNotification, + 13: optional list<string> emailAddresses, + 14: optional UserConfigurationData userConfigurationData, + 15: optional string workflowExecutionInstanceId, + 16: optional list<applicationInterfaceModel.InputDataObjectType> experimentInputs, + 17: optional list<applicationInterfaceModel.OutputDataObjectType> experimentOutputs, + 18: optional ExperimentStatus experimentStatus, + 19: optional list<WorkflowNodeStatus> stateChangeList, + 20: optional list<WorkflowNodeDetails> workflowNodeDetailsList, + 21: optional list<ErrorDetails> errors +} + +struct ExperimentSummary { + 1: required string experimentID, + 2: required string projectID, + 3: optional i64 creationTime, + 4: required string userName, + 5: required string name, + 6: optional string description, + 7: optional string applicationId, + 8: optional ExperimentStatus experimentStatus, +} http://git-wip-us.apache.org/repos/asf/airavata/blob/7463558e/component-interface-descriptions/thrift-interface-descriptions/gatewayResourceProfileModel.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/thrift-interface-descriptions/gatewayResourceProfileModel.thrift b/component-interface-descriptions/thrift-interface-descriptions/gatewayResourceProfileModel.thrift new file mode 100644 index 0000000..11a6586 --- /dev/null +++ b/component-interface-descriptions/thrift-interface-descriptions/gatewayResourceProfileModel.thrift @@ -0,0 +1,83 @@ +/* + * 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.appcatalog.gatewayprofile +namespace php Airavata.Model.AppCatalog.GatewayProfile +namespace cpp apache.airavata.model.appcatalog.gatewayprofile +namespace py apache.airavata.model.appcatalog.gatewayprofile + +include "computeResourceModel.thrift" + +/** + * Gateway specific preferences for a Computer Resource + * + * computeResourceId: + * Corelate the preference to a compute resource. + * + * overridebyAiravata: + * If turned true, Airavata will override the preferences of better alternatives exist. + * + * loginUserName: + * If turned true, Airavata will override the preferences of better alternatives exist. + * + * preferredJobSubmissionProtocol: + * For resources with multiple job submission protocols, the gateway can pick a preferred option. + * + * preferredDataMovementProtocol: + * For resources with multiple data movement protocols, the gateway can pick a preferred option. + * + * preferredBatchQueue: + * Gateways can choose a defualt batch queue based on average job dimention, reservations or other metrics. + * + * scratchLocation: + * Path to the local scratch space on a HPC cluster. Typically used to create working directory for job execution. + * + * allocationProjectNumber: + * Typically used on HPC machines to charge computing usage to a account number. For instance, on XSEDE once an + * allocation is approved, an allocation number is assigned. Before passing this number with job submittions, the + * account to be used has to be added to the allocation. + * +*/ +struct ComputeResourcePreference { + 1: required string computeResourceId, + 2: required bool overridebyAiravata = 1, + 3: optional string loginUserName, + 4: optional computeResourceModel.JobSubmissionProtocol preferredJobSubmissionProtocol, + 5: optional computeResourceModel.DataMovementProtocol preferredDataMovementProtocol, + 6: optional string preferredBatchQueue, + 7: optional string scratchLocation, + 8: optional string allocationProjectNumber +} + +/** + * Gateway Resource Profile + * + * gatewayID: + * Unique identifier for the gateway assigned by Airavata. Corelate this to Airavata Admin API Gateway Registration. + * + * computeResourcePreferences: + * List of resource preferences for each of the registered compute resources. + * + * +*/ +struct GatewayResourceProfile { + 1: required string gatewayID, + 2: optional list<ComputeResourcePreference> computeResourcePreferences +} http://git-wip-us.apache.org/repos/asf/airavata/blob/7463558e/component-interface-descriptions/thrift-interface-descriptions/generate-thrift-files.sh ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/thrift-interface-descriptions/generate-thrift-files.sh b/component-interface-descriptions/thrift-interface-descriptions/generate-thrift-files.sh new file mode 100755 index 0000000..bf4d4e9 --- /dev/null +++ b/component-interface-descriptions/thrift-interface-descriptions/generate-thrift-files.sh @@ -0,0 +1,305 @@ +#! /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 code for Airavata Server Skeletons, Client Stubs +# and Data Model java beans in java, C++, PHP and Python. + +show_usage() { + echo -e "Usage: $0 [Languague to generate stubs]" + echo "" + echo "options:" + echo -e "\tjava Generate/Update Java Stubs" + echo -e "\tphp Generate/Update PHP Stubs" + echo -e "\tcpp Generate/Update C++ Stubs" + echo -e "\tpython Generate/Update Python Stubs." + echo -e "\tall Generate/Update all stubs (Java, PHP, C++, Python)." + 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.1' +THRIFT_EXEC=/usr/local/bin/thrift + +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 +THRIFT_IDL_DIR='thrift-interface-descriptions' +BASE_TARGET_DIR='target' +DATAMODEL_SRC_DIR='airavata-data-models/src/main/java' +JAVA_API_SDK_DIR='airavata-api-stubs/src/main/java' +PHP_SDK_DIR='airavata-client-sdks/airavata-php-sdk/src/main/resources/lib' +CPP_SDK_DIR='airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/' +PYTHON_SDK_DIR='airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/' + +# 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 Function fail prints error messages on failure and quits the script. +fail() { + echo $@ + exit 1 +} + +# The function add_license_header adds the ASF V2 license header to all java files within the specified generated +# directory. The function 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 original 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 source file within the generated directory, add the ASF V2 LICENSE header + FILE_SUFFIXES=(.php .java .h .cpp) + for file in "${FILE_SUFFIXES[@]}"; do + for f in $(find ${GENERATED_CODE_DIR} -name "*$file"); 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 + 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 targeted 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} +} + +####################################### +# Generate/Update Airavata Data Model # +####################################### + +generate_java_stubs() { + + #Java Beans generation directory + JAVA_BEAN_GEN_DIR=${BASE_TARGET_DIR}/gen-javabean + + # As a precaution remove and previously generated files if exists + rm -rf ${JAVA_BEAN_GEN_DIR} + + # Generate the Airavata Data Model using thrift Java Beans generator. This will take generate the classes in bean style + # with members being private and setters returning voids. + # The airavataDataModel.thrift includes rest of data models. + $THRIFT_EXEC ${THRIFT_ARGS} --gen java:beans ${THRIFT_IDL_DIR}/airavataDataModel.thrift || fail unable to generate java bean thrift classes on base data model + + $THRIFT_EXEC ${THRIFT_ARGS} --gen java:beans ${THRIFT_IDL_DIR}/appCatalogModels.thrift || fail unable to generate java bean thrift classes on app catalog data models + + $THRIFT_EXEC ${THRIFT_ARGS} --gen java:beans ${THRIFT_IDL_DIR}/workflowDataModel.thrift || fail unable to generate java bean thrift classes on app workflow data models + + # For the generated java beans add the ASF V2 License header + add_license_header $JAVA_BEAN_GEN_DIR + + # Compare the newly generated beans with existing sources and replace the changed ones. + copy_changed_files ${JAVA_BEAN_GEN_DIR} ${DATAMODEL_SRC_DIR} + + ############################################################################### + # Generate/Update source used by Airavata Server Skeletons & Java Client Stubs # + # JAVA server and client both use generated api-boilerplate-code # + ############################################################################### + + #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 thrift Java generator, generate the java classes based on Airavata API. This + # The airavataAPI.thrift includes rest of data models. + $THRIFT_EXEC ${THRIFT_ARGS} --gen java ${THRIFT_IDL_DIR}/airavataAPI.thrift || fail unable to generate java thrift classes on AiravataAPI + + #$THRIFT_EXEC ${THRIFT_ARGS} --gen java ${THRIFT_IDL_DIR}/workflowAPI.thrift || fail unable to generate java thrift classes on WorkflowAPI + + # 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 skeleton/stub sources and replace the changed ones. + # Only copying the API related classes and avoiding copy of any data models which already exist in the data-models. + copy_changed_files ${JAVA_GEN_DIR}/org/apache/airavata/api ${JAVA_API_SDK_DIR}/org/apache/airavata/api + + echo "Successfully generated new java sources, compared against exiting code and replaced the changed files" +} + +#################################### +# Generate/Update PHP Stubs # +#################################### + +generate_php_stubs() { + + #PHP generation directory + PHP_GEN_DIR=${BASE_TARGET_DIR}/gen-php + + # As a precaution remove and previously generated files if exists + rm -rf ${PHP_GEN_DIR} + + # Using thrift Java generator, generate the java classes based on Airavata API. This + # The airavataAPI.thrift includes rest of data models. + $THRIFT_EXEC ${THRIFT_ARGS} --gen php:autoload ${THRIFT_IDL_DIR}/airavataAPI.thrift || fail unable to generate PHP thrift classes + + #$THRIFT_EXEC ${THRIFT_ARGS} --gen php:autoload ${THRIFT_IDL_DIR}/workflowAPI.thrift || fail unable to generate PHP thrift classes for WorkflowAPI + # For the generated java classes add the ASF V2 License header + ## TODO Write PHP license parser + + # Compare the newly generated classes with existing java generated skeleton/stub sources and replace the changed ones. + # Only copying the API related classes and avoiding copy of any data models which already exist in the data-models. + copy_changed_files ${PHP_GEN_DIR} ${PHP_SDK_DIR} + +} + +#################################### +# Generate/Update C++ Client Stubs # +#################################### + +generate_cpp_stubs() { + + #CPP generation directory + CPP_GEN_DIR=${BASE_TARGET_DIR}/gen-cpp + + # As a precaution remove and previously generated files if exists + rm -rf ${CPP_GEN_DIR} + + # Using thrift Java generator, generate the java classes based on Airavata API. This + # The airavataAPI.thrift includes rest of data models. + $THRIFT_EXEC ${THRIFT_ARGS} --gen cpp ${THRIFT_IDL_DIR}/airavataAPI.thrift || fail unable to generate C++ thrift classes + + #$THRIFT_EXEC ${THRIFT_ARGS} --gen cpp ${THRIFT_IDL_DIR}/workflowAPI.thrift || fail unable to generate C++ thrift classes for WorkflowAPI + # For the generated CPP classes add the ASF V2 License header + add_license_header $CPP_GEN_DIR + + # Compare the newly generated classes with existing java generated skeleton/stub sources and replace the changed ones. + # Only copying the API related classes and avoiding copy of any data models which already exist in the data-models. + copy_changed_files ${CPP_GEN_DIR} ${CPP_SDK_DIR} + +} + +#################################### +# Generate/Update C++ Client Stubs # +#################################### + +generate_python_stubs() { + + #Python generation directory + PYTHON_GEN_DIR=${BASE_TARGET_DIR}/gen-py + + # As a precaution remove and previously generated files if exists + rm -rf ${PYTHON_GEN_DIR} + + # Using thrift Python generator, generate the python classes based on Airavata API. This + # The airavataAPI.thrift includes rest of data models. + $THRIFT_EXEC ${THRIFT_ARGS} --gen py ${THRIFT_IDL_DIR}/airavataAPI.thrift || fail unable to generate Python thrift classes + + # For the generated CPP classes add the ASF V2 License header + #add_license_header #PYTHON_GEN_DIR + + # Compare the newly generated classes with existing java generated skeleton/stub sources and replace the changed ones. + # Only copying the API related classes and avoiding copy of any data models which already exist in the data-models. + copy_changed_files ${PYTHON_GEN_DIR} ${PYTHON_SDK_DIR} + +} + +for arg in "$@" +do + case "$arg" in + all) echo "Generate all stubs (Java, PHP, C++, Python) Stubs" + generate_java_stubs + generate_php_stubs + generate_cpp_stubs + generate_python_stubs + ;; + java) echo "Generating Java Stubs" + generate_java_stubs + ;; + php) echo "Generate PHP Stubs" + generate_php_stubs + ;; + cpp) echo "Generate C++ Stubs" + generate_cpp_stubs + ;; + python) echo "Generate Python Stubs" + generate_python_stubs + ;; + *) 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/7463558e/component-interface-descriptions/thrift-interface-descriptions/messagingEvents.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/thrift-interface-descriptions/messagingEvents.thrift b/component-interface-descriptions/thrift-interface-descriptions/messagingEvents.thrift new file mode 100644 index 0000000..29cdd2e --- /dev/null +++ b/component-interface-descriptions/thrift-interface-descriptions/messagingEvents.thrift @@ -0,0 +1,149 @@ +/* + * 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 "experimentModel.thrift" +include "applicationInterfaceModel.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 + +const string DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS" + +enum MessageLevel { + INFO, + DEBUG, + ERROR, + ACK +} + +enum MessageType { + EXPERIMENT, + TASK, + WORKFLOWNODE, + JOB, + LAUNCHTASK, + TERMINATETASK, + TASKOUTPUT +} + +struct ExperimentStatusChangeEvent { + 1: required experimentModel.ExperimentState state; + 2: required string experimentId; + 3: required string gatewayId; +} + +struct WorkflowIdentifier { + 1: required string workflowNodeId; + 2: required string experimentId; + 3: required string gatewayId; +} + +struct WorkflowNodeStatusChangeEvent { + 1: required experimentModel.WorkflowNodeState state; + 2: required WorkflowIdentifier workflowNodeIdentity; +} + +struct TaskIdentifier { + 1: required string taskId; + 2: required string workflowNodeId; + 3: required string experimentId; + 4: required string gatewayId; +} + +struct TaskStatusChangeEvent { + 1: required experimentModel.TaskState state; + 2: required TaskIdentifier taskIdentity; +} + +struct TaskStatusChangeRequestEvent { + 1: required experimentModel.TaskState state; + 2: required TaskIdentifier taskIdentity; +} + +struct TaskOutputChangeEvent { + 1: required list<applicationInterfaceModel.OutputDataObjectType> output; + 2: required TaskIdentifier taskIdentity; +} + +struct JobIdentifier { + 1: required string jobId; + 2: required string taskId; + 3: required string workflowNodeId; + 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 taskId; + 2: required string credentialToken; +} + +struct TaskSubmitEvent{ + 1: required string experimentId, + 2: required string taskId, + 3: required string gatewayId, + 4: required string tokenId +} + +struct TaskTerminateEvent{ + 1: required string experimentId, + 2: required string taskId, + 3: required string gatewayId, + 4: required string tokenId +} + +struct JobStatusChangeEvent { + 1: required experimentModel.JobState state; + 2: required JobIdentifier jobIdentity; +} + +struct JobStatusChangeRequestEvent { + 1: required experimentModel.JobState state; + 2: required JobIdentifier jobIdentity; +} + +struct Message { + 1: required binary event; + 2: required string messageId = DEFAULT_ID; + 3: required MessageType messageType; + 4: optional i64 updatedTime; + 5: optional MessageLevel messageLevel; +} + + + + + + + http://git-wip-us.apache.org/repos/asf/airavata/blob/7463558e/component-interface-descriptions/thrift-interface-descriptions/securityModel.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/thrift-interface-descriptions/securityModel.thrift b/component-interface-descriptions/thrift-interface-descriptions/securityModel.thrift new file mode 100644 index 0000000..bda9554 --- /dev/null +++ b/component-interface-descriptions/thrift-interface-descriptions/securityModel.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/7463558e/component-interface-descriptions/thrift-interface-descriptions/workflowAPI.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/thrift-interface-descriptions/workflowAPI.thrift b/component-interface-descriptions/thrift-interface-descriptions/workflowAPI.thrift new file mode 100644 index 0000000..9aa4a88 --- /dev/null +++ b/component-interface-descriptions/thrift-interface-descriptions/workflowAPI.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 "airavataErrors.thrift" +include "airavataDataModel.thrift" +include "experimentModel.thrift" +include "workspaceModel.thrift" +include "computeResourceModel.thrift" +include "applicationDeploymentModel.thrift" +include "applicationInterfaceModel.thrift" +include "workflowDataModel.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: airavataErrors.InvalidRequestException ire, + 2: airavataErrors.AiravataClientException ace, + 3: airavataErrors.AiravataSystemException ase) + + workflowDataModel.Workflow getWorkflow (1: required string workflowTemplateId) + throws (1: airavataErrors.InvalidRequestException ire, + 2: airavataErrors.AiravataClientException ace, + 3: airavataErrors.AiravataSystemException ase) + + void deleteWorkflow (1: required string workflowTemplateId) + throws (1: airavataErrors.InvalidRequestException ire, + 2: airavataErrors.AiravataClientException ace, + 3: airavataErrors.AiravataSystemException ase) + + string registerWorkflow(1: required workflowDataModel.Workflow workflow) + throws (1: airavataErrors.InvalidRequestException ire, + 2: airavataErrors.AiravataClientException ace, + 3: airavataErrors.AiravataSystemException ase) + + void updateWorkflow (1: required string workflowTemplateId, 2: required workflowDataModel.Workflow workflow) + throws (1: airavataErrors.InvalidRequestException ire, + 2: airavataErrors.AiravataClientException ace, + 3: airavataErrors.AiravataSystemException ase) + + string getWorkflowTemplateId (1: required string workflowName) + throws (1: airavataErrors.InvalidRequestException ire, + 2: airavataErrors.AiravataClientException ace, + 3: airavataErrors.AiravataSystemException ase) + + bool isWorkflowExistWithName(1: required string workflowName) + throws (1: airavataErrors.InvalidRequestException ire, + 2: airavataErrors.AiravataClientException ace, + 3: airavataErrors.AiravataSystemException ase) + } + http://git-wip-us.apache.org/repos/asf/airavata/blob/7463558e/component-interface-descriptions/thrift-interface-descriptions/workflowDataModel.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/thrift-interface-descriptions/workflowDataModel.thrift b/component-interface-descriptions/thrift-interface-descriptions/workflowDataModel.thrift new file mode 100644 index 0000000..68d60cd --- /dev/null +++ b/component-interface-descriptions/thrift-interface-descriptions/workflowDataModel.thrift @@ -0,0 +1,43 @@ +/* + * 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 +namespace php Airavata.Model +namespace py apache.airavata.model.workflow + +include "applicationInterfaceModel.thrift" + +/* + * 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. +*/ + +const string DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS" + +struct Workflow { + 1: required string templateId = DEFAULT_ID, + 2: required string name, + 3: optional string graph, + 4: optional binary image, + 5: optional list<applicationInterfaceModel.InputDataObjectType> workflowInputs, + 6: optional list<applicationInterfaceModel.OutputDataObjectType> workflowOutputs +} http://git-wip-us.apache.org/repos/asf/airavata/blob/7463558e/component-interface-descriptions/thrift-interface-descriptions/workspaceModel.thrift ---------------------------------------------------------------------- diff --git a/component-interface-descriptions/thrift-interface-descriptions/workspaceModel.thrift b/component-interface-descriptions/thrift-interface-descriptions/workspaceModel.thrift new file mode 100644 index 0000000..803cea8 --- /dev/null +++ b/component-interface-descriptions/thrift-interface-descriptions/workspaceModel.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 "experimentModel.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 = experimentModel.DEFAULT_PROJECT_NAME, + 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 http://git-wip-us.apache.org/repos/asf/airavata/blob/7463558e/modules/gfac/gfac-thrift-descriptions/generate-gfac-stubs.sh ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-thrift-descriptions/generate-gfac-stubs.sh b/modules/gfac/gfac-thrift-descriptions/generate-gfac-stubs.sh deleted file mode 100755 index 303cf0a..0000000 --- a/modules/gfac/gfac-thrift-descriptions/generate-gfac-stubs.sh +++ /dev/null @@ -1,134 +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 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='../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/7463558e/modules/gfac/gfac-thrift-descriptions/gfac.cpi.service.thrift ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-thrift-descriptions/gfac.cpi.service.thrift b/modules/gfac/gfac-thrift-descriptions/gfac.cpi.service.thrift deleted file mode 100644 index 93d62c7..0000000 --- a/modules/gfac/gfac-thrift-descriptions/gfac.cpi.service.thrift +++ /dev/null @@ -1,68 +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 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
