airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject [1/2] git commit: fixing the double node entry issue and some refactoring
Date Wed, 23 Apr 2014 16:29:18 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 71de72f83 -> b4e41646f


fixing the double node entry issue and some refactoring


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

Branch: refs/heads/master
Commit: dd3b3f1945ed2e0d2a65bb27f1d3214ac899b906
Parents: 49eea6f
Author: Saminda Wijeratne <samindaw@gmail.com>
Authored: Wed Apr 23 09:28:06 2014 -0700
Committer: Saminda Wijeratne <samindaw@gmail.com>
Committed: Wed Apr 23 09:28:06 2014 -0700

----------------------------------------------------------------------
 .../org/apache/airavata/gfac/cpi/GFacImpl.java  |  9 +++----
 .../gfac/provider/impl/GSISSHProvider.java      |  3 +--
 .../impl/GSISSHProviderTestWithMyProxyAuth.java | 26 ++++++++++++--------
 .../AiravataExperimentStatusUpdator.java        |  1 +
 .../job/monitor/AiravataJobStatusUpdator.java   |  3 +--
 .../job/monitor/AiravataTaskStatusUpdator.java  |  2 +-
 .../AiravataWorkflowNodeStatusUpdator.java      |  2 +-
 .../registry/jpa/impl/ExperimentRegistry.java   |  2 +-
 .../apache/airavata/job/monitor/MonitorID.java  |  8 ++----
 9 files changed, 28 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/dd3b3f19/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacImpl.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacImpl.java
index d6a61a3..4530d37 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacImpl.java
@@ -42,7 +42,6 @@ import org.apache.airavata.gfac.context.ApplicationContext;
 import org.apache.airavata.gfac.context.JobExecutionContext;
 import org.apache.airavata.gfac.context.MessageContext;
 import org.apache.airavata.gfac.context.security.GSISecurityContext;
-import org.apache.airavata.gfac.context.security.SSHSecurityContext;
 import org.apache.airavata.gfac.handler.GFacHandler;
 import org.apache.airavata.gfac.handler.GFacHandlerConfig;
 import org.apache.airavata.gfac.handler.GFacHandlerException;
@@ -457,7 +456,7 @@ public class GFacImpl implements GFac, AbstractActivityListener {
             String sshPrivateKeyPass = configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY_PASS);
             String sshPassword = configurationProperties.getProperty(Constants.SSH_PASSWORD);
             String sshPublicKey = configurationProperties.getProperty(Constants.SSH_PUBLIC_KEY);
-            SSHSecurityContext sshSecurityContext = new SSHSecurityContext();
+//            SSHSecurityContext sshSecurityContext = new SSHSecurityContext();
                 AuthenticationInfo authenticationInfo = null;
                 // we give higher preference to the password over keypair ssh authentication
                 if (sshPassword != null) {
@@ -479,9 +478,9 @@ public class GFacImpl implements GFac, AbstractActivityListener {
                 } catch (SSHApiException e) {
                     e.printStackTrace();  //To change body of catch statement use File |
Settings | File Templates.
                 }
-                sshSecurityContext.setPbsCluster(pbsCluster);
-                sshSecurityContext.setUsername(sshUserName);
-           jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT,
sshSecurityContext);
+//                sshSecurityContext.setPbsCluster(pbsCluster);
+//                sshSecurityContext.setUsername(sshUserName);
+//           jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT,
sshSecurityContext);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/dd3b3f19/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java
index 69ad519..4da1bcb 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java
@@ -25,7 +25,6 @@ import java.util.Map;
 import org.apache.airavata.gfac.GFacException;
 import org.apache.airavata.gfac.context.JobExecutionContext;
 import org.apache.airavata.gfac.context.security.GSISecurityContext;
-import org.apache.airavata.gfac.context.security.SSHSecurityContext;
 import org.apache.airavata.gfac.notification.events.StartExecutionEvent;
 import org.apache.airavata.gfac.provider.GFacProviderException;
 import org.apache.airavata.gfac.utils.GFacUtils;
@@ -66,7 +65,7 @@ public class GSISSHProvider extends AbstractProvider{
             if (jobExecutionContext.getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT)
!= null) {
                 cluster = ((GSISecurityContext) jobExecutionContext.getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT)).getPbsCluster();
             } else {
-                cluster = ((SSHSecurityContext) jobExecutionContext.getSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT)).getPbsCluster();
+//                cluster = ((SSHSecurityContext) jobExecutionContext.getSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT)).getPbsCluster();
             }
             if (cluster == null) {
                 throw new GFacProviderException("Security context is not set properly");

http://git-wip-us.apache.org/repos/asf/airavata/blob/dd3b3f19/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTestWithMyProxyAuth.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTestWithMyProxyAuth.java
b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTestWithMyProxyAuth.java
index 221f6e1..be78570 100644
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTestWithMyProxyAuth.java
+++ b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTestWithMyProxyAuth.java
@@ -20,6 +20,13 @@
 */
 package org.apache.airavata.core.gfac.services.impl;
 
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
 import org.apache.airavata.commons.gfac.type.ActualParameter;
 import org.apache.airavata.commons.gfac.type.ApplicationDescription;
 import org.apache.airavata.commons.gfac.type.HostDescription;
@@ -31,7 +38,6 @@ import org.apache.airavata.gfac.context.ApplicationContext;
 import org.apache.airavata.gfac.context.JobExecutionContext;
 import org.apache.airavata.gfac.context.MessageContext;
 import org.apache.airavata.gfac.context.security.GSISecurityContext;
-import org.apache.airavata.gfac.context.security.SSHSecurityContext;
 import org.apache.airavata.gfac.cpi.GFacImpl;
 import org.apache.airavata.gsi.ssh.api.Cluster;
 import org.apache.airavata.gsi.ssh.api.SSHApiException;
@@ -42,18 +48,18 @@ import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo
 import org.apache.airavata.gsi.ssh.util.CommonUtils;
 import org.apache.airavata.model.workspace.experiment.TaskDetails;
 import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
-import org.apache.airavata.schemas.gfac.*;
-import org.testng.annotations.AfterClass;
+import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
+import org.apache.airavata.schemas.gfac.GsisshHostType;
+import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
+import org.apache.airavata.schemas.gfac.InputParameterType;
+import org.apache.airavata.schemas.gfac.JobTypeType;
+import org.apache.airavata.schemas.gfac.OutputParameterType;
+import org.apache.airavata.schemas.gfac.ProjectAccountType;
+import org.apache.airavata.schemas.gfac.QueueType;
+import org.apache.airavata.schemas.gfac.StringParameterType;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
-
 public class GSISSHProviderTestWithMyProxyAuth {
     private JobExecutionContext jobExecutionContext;
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/dd3b3f19/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataExperimentStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataExperimentStatusUpdator.java
b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataExperimentStatusUpdator.java
index f172e6c..7cb0489 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataExperimentStatusUpdator.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataExperimentStatusUpdator.java
@@ -52,6 +52,7 @@ public class AiravataExperimentStatusUpdator implements AbstractActivityListener
             try {
                 String experimentID = experimentStatus.getIdentity().getExperimentID();
                 updateExperimentStatus(experimentID, state);
+                logger.debug("Experiment " + experimentStatus.getIdentity().getExperimentID()
+ " status updated to "+state.toString());
             } catch (Exception e) {
                 logger.error("Error persisting data" + e.getLocalizedMessage(), e);
             }

http://git-wip-us.apache.org/repos/asf/airavata/blob/dd3b3f19/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataJobStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataJobStatusUpdator.java
b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataJobStatusUpdator.java
index 0a56543..29ba766 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataJobStatusUpdator.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataJobStatusUpdator.java
@@ -76,7 +76,7 @@ public class AiravataJobStatusUpdator implements AbstractActivityListener{
             } catch (Exception e) {
                 logger.error("Error persisting data" + e.getLocalizedMessage(), e);
             }
-            logger.info("Job ID:" + jobStatus.getIdentity().getJobId() + " is "+state.toString());
+            logger.debug("Job " + jobStatus.getIdentity().getJobId() + " status updated to
"+state.toString());
             switch (state) {
                 case COMPLETE: case UNKNOWN: case CANCELED:case FAILED:case SUSPENDED:
                     jobsToMonitor.remove(jobStatus.getMonitorID());
@@ -112,7 +112,6 @@ public class AiravataJobStatusUpdator implements AbstractActivityListener{
 		default:
 			break;
     	}
-    	logger.debug("Publishing Task Status "+state.toString());
     	monitorPublisher.publish(new TaskStatusChangeRequest(jobStatus.getIdentity(),state));
     }
     

http://git-wip-us.apache.org/repos/asf/airavata/blob/dd3b3f19/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataTaskStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataTaskStatusUpdator.java
b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataTaskStatusUpdator.java
index 86ae26a..5eea71a 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataTaskStatusUpdator.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataTaskStatusUpdator.java
@@ -57,6 +57,7 @@ public class AiravataTaskStatusUpdator implements AbstractActivityListener{
             try {
                 String taskID = taskStatus.getIdentity().getTaskId();
                 updateTaskStatus(taskID, state);
+                logger.debug("Task " + taskStatus.getIdentity().getTaskId() + " status updated
to "+state.toString());
             } catch (Exception e) {
                 logger.error("Error persisting data" + e.getLocalizedMessage(), e);
             }
@@ -84,7 +85,6 @@ public class AiravataTaskStatusUpdator implements AbstractActivityListener{
 		default:
 			break;
     	}
-    	logger.debug("Publishing Experiment Status "+state.toString());
     	monitorPublisher.publish(new WorkflowNodeStatusChangeRequest(taskStatus.getIdentity(),state));
     }
     

http://git-wip-us.apache.org/repos/asf/airavata/blob/dd3b3f19/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataWorkflowNodeStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataWorkflowNodeStatusUpdator.java
b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataWorkflowNodeStatusUpdator.java
index cd07a1d..ce4012c 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataWorkflowNodeStatusUpdator.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/job/monitor/AiravataWorkflowNodeStatusUpdator.java
@@ -58,6 +58,7 @@ public class AiravataWorkflowNodeStatusUpdator implements AbstractActivityListen
             try {
                 String workflowNodeID = workflowNodeStatus.getIdentity().getWorkflowNodeID();
                 updateWorkflowNodeStatus(workflowNodeID, state);
+                logger.debug("Workflow node " + workflowNodeStatus.getIdentity().getWorkflowNodeID()
+ " status updated to "+state.toString());
             } catch (Exception e) {
                 logger.error("Error persisting data" + e.getLocalizedMessage(), e);
             }
@@ -83,7 +84,6 @@ public class AiravataWorkflowNodeStatusUpdator implements AbstractActivityListen
 		default:
 			break;
     	}
-    	logger.debug("Publishing Experiment Status "+state.toString());
     	monitorPublisher.publish(new ExperimentStatusChangeRequest(nodeStatus.getIdentity(),state));
     }
     

http://git-wip-us.apache.org/repos/asf/airavata/blob/dd3b3f19/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index 3fa7b5f..ad2b9bc 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@ -703,7 +703,7 @@ public class ExperimentRegistry {
             WorkflowNodeDetailResource workflowNode = experiment.getWorkflowNode(nodeId);
             workflowNode.setNodeName(nodeDetails.getNodeName());
             workflowNode.setCreationTime(AiravataUtils.getTime(nodeDetails.getCreationTime()));
-            workflowNode.setNodeInstanceId(getNodeInstanceID(nodeDetails.getNodeName()));
+            workflowNode.setNodeInstanceId(nodeId);
             workflowNode.save();
             String expID = workflowNode.getExperimentResource().getExpID();
             List<DataObjectType> nodeInputs = nodeDetails.getNodeInputs();

http://git-wip-us.apache.org/repos/asf/airavata/blob/dd3b3f19/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorID.java
----------------------------------------------------------------------
diff --git a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorID.java
b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorID.java
index 241e3b0..ef03fbc 100644
--- a/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorID.java
+++ b/tools/job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorID.java
@@ -63,12 +63,7 @@ public class MonitorID {
     private JobState state;
 
     public MonitorID(HostDescription host, String jobID,String taskID, String workflowNodeID,
String experimentID, String userName) {
-        this.host = host;
-        this.jobStartedTime = new Timestamp((new Date()).getTime());
-        this.userName = userName;
-        this.jobID = jobID;
-        this.taskID = taskID;
-        this.experimentID = experimentID;
+        this(host, jobID, taskID, workflowNodeID, experimentID, userName, null);
     }
 
     public MonitorID(HostDescription host, String jobID,String taskID, String workflowNodeID,
String experimentID, String userName,AuthenticationInfo authenticationInfo) {
@@ -84,6 +79,7 @@ public class MonitorID {
         }
         this.jobID = jobID;
         this.taskID = taskID;
+        this.workflowNodeID=workflowNodeID;
         this.experimentID = experimentID;
     }
     public HostDescription getHost() {


Mime
View raw message