airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [1/2] airavata git commit: using login username inside gfac
Date Wed, 11 Mar 2015 22:07:23 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 13b480d84 -> f31637e8c


using login username inside gfac


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

Branch: refs/heads/master
Commit: 674db3c3e7e5adb252102ea18581d4d0523d5d62
Parents: 4000b82
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Wed Mar 11 17:22:49 2015 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Wed Mar 11 17:22:49 2015 -0400

----------------------------------------------------------------------
 .../airavata/gfac/core/context/JobExecutionContext.java |  9 +++++++++
 .../apache/airavata/gfac/core/cpi/BetterGfacImpl.java   |  4 ++++
 .../org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java | 12 +++++++++---
 3 files changed, 22 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/674db3c3/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java
index c8c48ef..6a8dd5f 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/JobExecutionContext.java
@@ -78,6 +78,7 @@ public class JobExecutionContext extends AbstractContext implements Serializable
      * User defined scratch/temp directory
      */
     private String scratchLocation;
+    private String loginUserName;
     /**
      * User defined working directory.
      */
@@ -500,4 +501,12 @@ public class JobExecutionContext extends AbstractContext implements Serializable
             return applicationContext.getApplicationDeploymentDescription().getExecutablePath();
         }
     }
+
+    public String getLoginUserName() {
+        return loginUserName;
+    }
+
+    public void setLoginUserName(String loginUserName) {
+        this.loginUserName = loginUserName;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/674db3c3/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
index 00d313c..420df6d 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
@@ -353,6 +353,10 @@ public class BetterGfacImpl implements GFac,Watcher {
                 }
             }
 
+            if(gatewayResourcePreferences.getLoginUserName() != null){
+                jobExecutionContext.setLoginUserName(gatewayResourcePreferences.getLoginUserName());
+            }
+
             // set gatewayUserPreferred data movement protocol and interface
             jobExecutionContext.setPreferredDataMovementProtocol(gatewayResourcePreferences.getPreferredDataMovementProtocol());
             if (gatewayResourcePreferences.getPreferredJobSubmissionProtocol() == null) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/674db3c3/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java
b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java
index 890768a..f477f62 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/util/GFACSSHUtils.java
@@ -110,12 +110,18 @@ public class GFACSSHUtils {
                             Properties configurationProperties = ServerSettings.getProperties();
                             tokenizedSSHAuthInfo = new DefaultPasswordAuthenticationInfo(configurationProperties.getProperty(Constants.SSH_PASSWORD));
                         }
-                        serverInfo.setUserName(credentials.getPortalUserName());
-                        jobExecutionContext.getExperiment().setUserName(credentials.getPortalUserName());
+                        // This should be the login user name from compute resource preference
+                        String loginUser = jobExecutionContext.getLoginUserName();
+                        if (loginUser == null) {
+                            loginUser = credentials.getPortalUserName();
+                        }
+                        serverInfo.setUserName(loginUser);
+                        jobExecutionContext.getExperiment().setUserName(loginUser);
+
 
                         // inside the pbsCluser object
 
-                        String key = credentials.getPortalUserName() + jobExecutionContext.getHostName()
+ serverInfo.getPort();
+                        String key = loginUser + jobExecutionContext.getHostName() + serverInfo.getPort();
                         boolean recreate = false;
                         synchronized (clusters) {
                             if (clusters.containsKey(key) && clusters.get(key).size()
< maxClusterCount) {


Mime
View raw message