Author: lahiru
Date: Sat Oct 12 15:13:10 2013
New Revision: 1531541

URL: http://svn.apache.org/r1531541
Log:
adding ssh hpc support to workflow interpreter.

Modified:
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java?rev=1531541&r1=1531540&r2=1531541&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
 Sat Oct 12 15:13:10 2013
@@ -304,8 +304,6 @@ public class EmbeddedGFacInvoker impleme
             JobExecutionContext jobExecutionContext = new 
JobExecutionContext(gFacConfiguration, serviceName);
             //Here we get only the contextheader information sent specific for 
this node
             //Add security context
-            addSecurityContext(registeredHost, configurationProperties, 
jobExecutionContext,
-                    configuration.getContextHeader());
 
             
jobExecutionContext.setContextHeader(WorkflowContextHeaderBuilder.removeOtherSchedulingConfig(nodeID,
 configuration.getContextHeader()));
 
@@ -326,6 +324,8 @@ public class EmbeddedGFacInvoker impleme
             
jobExecutionContext.setOutMessageContext(getOutParameters(serviceDescription));
             jobExecutionContext.setInMessageContext(new 
MessageContext(actualParameters));
 
+            addSecurityContext(registeredHost, configurationProperties, 
jobExecutionContext,
+                    configuration.getContextHeader());
             GFacAPI gfacAPI1 = new GFacAPI();
             gfacAPI1.submitJob(jobExecutionContext);
 
@@ -432,7 +432,7 @@ public class EmbeddedGFacInvoker impleme
                 GSIAuthenticationInfo authenticationInfo
                         = new 
MyProxyAuthenticationInfo(requestData.getMyProxyUserName(), 
requestData.getMyProxyPassword(), requestData.getMyProxyServerUrl(),
                         requestData.getMyProxyPort(), 
requestData.getMyProxyLifeTime(), 
System.getProperty(Constants.TRUSTED_CERTIFICATE_SYSTEM_PROPERTY));
-                ServerInfo serverInfo = new 
ServerInfo(configurationProperties.getProperty("gsissh.user"), 
registeredHost.getType().getHostName());
+                ServerInfo serverInfo = new 
ServerInfo(configurationProperties.getProperty("gsissh.user"), 
registeredHost.getType().getHostAddress());
 
                 Cluster pbsCluster = null;
                 try {
@@ -459,6 +459,7 @@ public class EmbeddedGFacInvoker impleme
             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();
             if (((SSHHostType) registeredHost.getType()).getHpcResource()) {
                 AuthenticationInfo authenticationInfo = null;
                 if(sshPassword != null){
@@ -466,27 +467,24 @@ public class EmbeddedGFacInvoker impleme
                 }else{
                     authenticationInfo = new 
DefaultPublicKeyFileAuthentication(sshPublicKey, 
sshPrivateKey,sshPrivateKeyPass);
                 }
-                ServerInfo serverInfo = new ServerInfo(sshUserName, 
registeredHost.getType().getHostName());
+                ServerInfo serverInfo = new ServerInfo(sshUserName, 
registeredHost.getType().getHostAddress());
 
                 Cluster pbsCluster = null;
                 try {
                     pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
-                            (((HpcApplicationDeploymentType) 
jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription()).getInstalledParentPath()));
+                            (((HpcApplicationDeploymentType) 
jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath()));
                 } catch (SSHApiException e) {
                     e.printStackTrace();  //To change body of catch statement 
use File | Settings | File Templates.
                 }
-
-
-                SSHSecurityContext sshSecurityContext = new 
SSHSecurityContext();
                 sshSecurityContext.setPbsCluster(pbsCluster);
                 sshSecurityContext.setUsername(sshUserName);
             } else {
-                SSHSecurityContext context = new SSHSecurityContext();
-                context.setUsername(sshUserName);
-                context.setPrivateKeyLoc(sshPrivateKey);
-                context.setKeyPass(sshPrivateKeyPass);
-                
jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT, 
context);
+                 sshSecurityContext = new SSHSecurityContext();
+                sshSecurityContext.setUsername(sshUserName);
+                sshSecurityContext.setPrivateKeyLoc(sshPrivateKey);
+                sshSecurityContext.setKeyPass(sshPrivateKeyPass);
             }
+            
jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT, 
sshSecurityContext);
 
         }
     }


Reply via email to