airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject git commit: updating versions and fixing merge issues with the master
Date Tue, 22 Jul 2014 21:22:37 GMT
Repository: airavata
Updated Branches:
  refs/heads/workflow-support 16cd757f2 -> 915eda2e4


updating versions and fixing merge issues with the master


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

Branch: refs/heads/workflow-support
Commit: 915eda2e4b39301ca95b76ba5785239250ec9e76
Parents: 16cd757
Author: Saminda Wijeratne <samindaw@gmail.com>
Authored: Tue Jul 22 17:22:19 2014 -0400
Committer: Saminda Wijeratne <samindaw@gmail.com>
Committed: Tue Jul 22 17:22:19 2014 -0400

----------------------------------------------------------------------
 .../tools/RegisterSampleApplications.java       | 29 ++++++++-------
 .../model/util/ExperimentModelUtil.java         |  6 ++--
 .../monitor/impl/pull/qstat/HPCPullMonitor.java |  2 --
 .../server/OrchestratorServerHandler.java       |  2 +-
 .../registry/jpa/model/WorkflowNodeDetail.java  |  2 +-
 modules/workflow-model/workflow-engine/pom.xml  |  2 +-
 .../engine/interpretor/WorkflowInterpreter.java | 38 +++++++++++++++-----
 .../workflow-model-component/pom.xml            |  2 +-
 8 files changed, 54 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/915eda2e/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
index 1f28d88..61f7697 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
@@ -20,31 +20,36 @@
 */
 package org.apache.airavata.client.tools;
 
-import java.io.*;
-import java.util.*;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
 
 import org.apache.airavata.api.Airavata;
 import org.apache.airavata.api.client.AiravataClientFactory;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
-import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule;
 import org.apache.airavata.model.appcatalog.appdeployment.ApplicationParallelismType;
-import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
 import org.apache.airavata.model.appcatalog.appinterface.DataType;
 import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
 import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
-import org.apache.airavata.model.appcatalog.computeresource.*;
+import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
+import org.apache.airavata.model.appcatalog.computeresource.JobManagerCommand;
+import org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager;
+import org.apache.airavata.model.appcatalog.computeresource.ResourceJobManagerType;
+import org.apache.airavata.model.appcatalog.computeresource.SCPDataMovement;
+import org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission;
+import org.apache.airavata.model.appcatalog.computeresource.SecurityProtocol;
 import org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
 import org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile;
 import org.apache.airavata.model.error.AiravataClientException;
-import org.apache.airavata.model.error.AiravataSystemException;
-import org.apache.airavata.model.error.InvalidRequestException;
-
+import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.thrift.TException;
-
 public class RegisterSampleApplications {
 
     public static final String THRIFT_SERVER_HOST = "gw127.iu.xsede.org";

http://git-wip-us.apache.org/repos/asf/airavata/blob/915eda2e/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
index 7b08bcd..43fb241 100644
--- a/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
+++ b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
@@ -155,9 +155,9 @@ public class ExperimentModelUtil {
     public static TaskDetails cloneTaskFromWorkflowNodeDetails(Experiment experiment, WorkflowNodeDetails
nodeDetails){
         TaskDetails taskDetails = new TaskDetails();
         taskDetails.setCreationTime(nodeDetails.getCreationTime());
-        String[] split = nodeDetails.getExecutionUnitData().split("/");
-        taskDetails.setApplicationId(split[0]);
-        taskDetails.setApplicationVersion(split[1]);
+//        String[] split = ;
+        taskDetails.setApplicationId(nodeDetails.getExecutionUnitData());
+//        taskDetails.setApplicationVersion(split[1]);
         List<DataObjectType> experimentInputs = nodeDetails.getNodeInputs();
         if (experimentInputs != null){
             taskDetails.setApplicationInputs(experimentInputs);

http://git-wip-us.apache.org/repos/asf/airavata/blob/915eda2e/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
index 5150b49..731f88b 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
@@ -195,8 +195,6 @@ public class HPCPullMonitor extends PullMonitor {
                             } catch (GFacException e) {
                                 publisher.publish(new TaskStatusChangeRequest(new TaskIdentity(iMonitorID.getExperimentID(),
iMonitorID.getWorkflowNodeID(),
                                         iMonitorID.getTaskID()), TaskState.FAILED));
-                                publisher.publish(new ExperimentStatusChangeRequest(new ExperimentIdentity(iMonitorID.getExperimentID()),
-                                        ExperimentState.FAILED));
                                 logger.info(e.getLocalizedMessage(), e);
                             }
                         } else {

http://git-wip-us.apache.org/repos/asf/airavata/blob/915eda2e/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
index ac8e9f3..3bffe23 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
+++ b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
@@ -484,7 +484,7 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface,
 			IllegalAccessException {
 		Map<String, String> moduleIdFilter = new HashMap<String, String>();
 		moduleIdFilter.put(AbstractResource.ApplicationDeploymentConstants.APP_MODULE_ID, selectedModuleId);
-		if (taskData.getTaskScheduling().getResourceHostId() != null) {
+		if (taskData.getTaskScheduling()!=null && taskData.getTaskScheduling().getResourceHostId()
!= null) {
 		    moduleIdFilter.put(AbstractResource.ApplicationDeploymentConstants.COMPUTE_HOST_ID,
taskData.getTaskScheduling().getResourceHostId());
 		}
 		List<ApplicationDeploymentDescription> applicationDeployements = appCatalog.getApplicationDeployment().getApplicationDeployements(moduleIdFilter);

http://git-wip-us.apache.org/repos/asf/airavata/blob/915eda2e/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/WorkflowNodeDetail.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/WorkflowNodeDetail.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/WorkflowNodeDetail.java
index 46b7d6e..b4ae29e 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/WorkflowNodeDetail.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/WorkflowNodeDetail.java
@@ -38,7 +38,7 @@ public class WorkflowNodeDetail implements Serializable {
     private String nodeId;
     @Column(name = "EXECUTION_UNIT")
     private String executionUnit;
-    @Column(name = "EXECUTION_UNIT")
+    @Column(name = "EXECUTION_UNIT_DATA")
     private String executionUnitData;
     @Column(name = "CREATION_TIME")
     private Timestamp creationTime;

http://git-wip-us.apache.org/repos/asf/airavata/blob/915eda2e/modules/workflow-model/workflow-engine/pom.xml
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/pom.xml b/modules/workflow-model/workflow-engine/pom.xml
index fcdfd87..ef6681b 100644
--- a/modules/workflow-model/workflow-engine/pom.xml
+++ b/modules/workflow-model/workflow-engine/pom.xml
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.apache.airavata</groupId>
         <artifactId>airavata-workflow-model-parent</artifactId>
-        <version>0.13-SNAPSHOT</version>
+        <version>0.14-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/915eda2e/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java
b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java
index 98fc560..fadde07 100644
--- a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java
+++ b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java
@@ -57,7 +57,6 @@ import org.apache.airavata.model.workspace.experiment.WorkflowNodeStatus;
 import org.apache.airavata.orchestrator.cpi.OrchestratorService;
 import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
 import org.apache.airavata.registry.cpi.ChildDataType;
-import org.apache.airavata.registry.cpi.ParentDataType;
 import org.apache.airavata.registry.cpi.Registry;
 import org.apache.airavata.registry.cpi.RegistryException;
 import org.apache.airavata.registry.cpi.RegistryModelType;
@@ -229,7 +228,7 @@ public class WorkflowInterpreter implements AbstractActivityListener{
 				elem.setKey(portName);
 				elem.setValue(portValue==null?null:portValue.toString());
 				workflowNode.addToNodeInputs(elem);
-				workflowNode.setNodeInstanceId((String) getRegistry().add(ChildDataType.WORKFLOW_NODE_DETAIL,
workflowNode, getExperiment().getExperimentID()));
+				getRegistry().update(RegistryModelType.WORKFLOW_NODE_DETAIL, workflowNode, workflowNode.getNodeInstanceId());
 				updateWorkflowNodeStatus(workflowNode, WorkflowNodeState.COMPLETED);
 			}
 			
@@ -372,18 +371,23 @@ public class WorkflowInterpreter implements AbstractActivityListener{
 	    }
     }
 
-	private WorkflowNodeDetails createWorkflowNodeDetails(Node node) {
+	private WorkflowNodeDetails createWorkflowNodeDetails(Node node) throws RegistryException
{
 		WorkflowNodeDetails workflowNode = ExperimentModelUtil.createWorkflowNode(node.getName(),
null);
 		ExecutionUnit executionUnit = ExecutionUnit.APPLICATION;
+		String executionData = null;
 		if (node instanceof InputNode){
 			executionUnit = ExecutionUnit.INPUT;
 		} else if (node instanceof OutputNode){
 			executionUnit = ExecutionUnit.OUTPUT;
 		} if (node instanceof WSNode){
 			executionUnit = ExecutionUnit.APPLICATION;
+			executionData = ((WSNode)node).getComponent().getApplication().getApplicationId();
 		}  
 		workflowNode.setExecutionUnit(executionUnit);
+		workflowNode.setExecutionUnitData(executionData);
+		workflowNode.setNodeInstanceId((String) getRegistry().add(ChildDataType.WORKFLOW_NODE_DETAIL,
workflowNode, getExperiment().getExperimentID()));
 		nodeInstanceList.put(node, workflowNode);
+		setupNodeDetailsInput(node, workflowNode);
 		return workflowNode;
 	}
 
@@ -422,7 +426,7 @@ public class WorkflowInterpreter implements AbstractActivityListener{
 				// next run
 				// even if the next run runs before the notification arrives
 				WorkflowNodeDetails workflowNodeDetails = createWorkflowNodeDetails(node);
-				workflowNodeDetails.setNodeInstanceId((String)getRegistry().add(ChildDataType.WORKFLOW_NODE_DETAIL,
workflowNodeDetails, getExperiment().getExperimentID()));
+//				workflowNodeDetails.setNodeInstanceId((String)getRegistry().add(ChildDataType.WORKFLOW_NODE_DETAIL,
workflowNodeDetails, getExperiment().getExperimentID()));
 				node.setState(NodeExecutionState.EXECUTING);
 				updateWorkflowNodeStatus(workflowNodeDetails, WorkflowNodeState.EXECUTING);
 				// OutputNode node = (OutputNode) outputNode;
@@ -987,8 +991,14 @@ public class WorkflowInterpreter implements AbstractActivityListener{
 	private void setupNodeDetailsInput(Node node, WorkflowNodeDetails nodeDetails){
 		List<DataPort> inputPorts = node.getInputPorts();
 		for (DataPort dataPort : inputPorts) {
-			Map<String, String> outputData = nodeOutputData.get(dataPort.getFromNode());
-			String portInputValue = outputData.get(dataPort.getName());
+			Node fromNode = dataPort.getFromNode();
+			String portInputValue = null;
+			if (fromNode instanceof InputNode){
+				portInputValue = (String) ((InputNode) fromNode).getDefaultValue();			
+			} else if (fromNode instanceof WSNode){
+				Map<String, String> outputData = nodeOutputData.get(fromNode);
+				portInputValue = outputData.get(dataPort.getName());				
+			}
 			DataObjectType elem = new DataObjectType();
 			elem.setKey(dataPort.getName());
 			elem.setValue(portInputValue);
@@ -1392,16 +1402,17 @@ public class WorkflowInterpreter implements AbstractActivityListener{
     	String taskId = taskStatus.getIdentity().getTaskId();
 		if (isTaskAwaiting(taskId)){
         	WorkflowNodeState state=WorkflowNodeState.UNKNOWN;
+			Node node = getAwaitingNodeForTask(taskId);
         	switch(taskStatus.getState()){
         	case CANCELED:
         		; break;
         	case COMPLETED:
         		//task is completed
+        		state = WorkflowNodeState.COMPLETED;
         		try {
 					TaskDetails task = (TaskDetails)getRegistry().get(RegistryModelType.TASK_DETAIL, taskId);
 					List<DataObjectType> applicationOutputs = task.getApplicationOutputs();
 					Map<String, String> outputData = new HashMap<String, String>();
-					Node node = getAwaitingNodeForTask(taskId);
 					for (DataObjectType outputObj : applicationOutputs) {
 						List<DataPort> outputPorts = node.getOutputPorts();
 						for (DataPort dataPort : outputPorts) {
@@ -1412,6 +1423,7 @@ public class WorkflowInterpreter implements AbstractActivityListener{
 					}
 					nodeOutputData.put(node, outputData);
 					setupNodeDetailsOutput(node);
+					node.setState(NodeExecutionState.FINISHED);
 				} catch (RegistryException e) {
 					e.printStackTrace();
 				}
@@ -1419,16 +1431,26 @@ public class WorkflowInterpreter implements AbstractActivityListener{
         	case CONFIGURING_WORKSPACE:
         		break;
         	case FAILED:
+        		state = WorkflowNodeState.FAILED;
+        		node.setState(NodeExecutionState.FAILED);
         		break;
         	case EXECUTING: case WAITING: case PRE_PROCESSING: case POST_PROCESSING: case OUTPUT_DATA_STAGING:
case INPUT_DATA_STAGING:
+        		state = WorkflowNodeState.EXECUTING;
+        		node.setState(NodeExecutionState.EXECUTING);
         		break;
         	case STARTED:
         		break;
         	case CANCELING:
+        		state = WorkflowNodeState.CANCELING;
         		break;
     		default:
     			break;
-        	}    		
+        	}
+        	try {
+				updateWorkflowNodeStatus(nodeInstanceList.get(node), state);
+			} catch (RegistryException e) {
+				e.printStackTrace();
+			}
     	}
 
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/915eda2e/modules/workflow-model/workflow-model-component/pom.xml
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-model-component/pom.xml b/modules/workflow-model/workflow-model-component/pom.xml
index d7cbee3..bd2a0ae 100644
--- a/modules/workflow-model/workflow-model-component/pom.xml
+++ b/modules/workflow-model/workflow-model-component/pom.xml
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.apache.airavata</groupId>
         <artifactId>airavata-workflow-model-parent</artifactId>
-        <version>0.13-SNAPSHOT</version>
+        <version>0.14-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 


Mime
View raw message