You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2016/02/09 17:06:14 UTC
[3/4] airavata git commit: remote cluster when changing login username
remote cluster when changing login username
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/b96cb162
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/b96cb162
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/b96cb162
Branch: refs/heads/master
Commit: b96cb162e474dd7e068e1dc9b00e8371d5f7a18b
Parents: 11ea501
Author: Chathuri Wimalasena <ch...@apache.org>
Authored: Tue Feb 9 10:58:04 2016 -0500
Committer: Chathuri Wimalasena <ch...@apache.org>
Committed: Tue Feb 9 10:58:04 2016 -0500
----------------------------------------------------------------------
.../airavata/gfac/core/cluster/RemoteCluster.java | 3 +++
.../apache/airavata/gfac/impl/BESRemoteCluster.java | 6 ++++++
.../java/org/apache/airavata/gfac/impl/Factory.java | 14 +++++++++++++-
.../apache/airavata/gfac/impl/HPCRemoteCluster.java | 8 +++++++-
.../apache/airavata/gfac/impl/LocalRemoteCluster.java | 6 ++++++
5 files changed, 35 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/b96cb162/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/RemoteCluster.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/RemoteCluster.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/RemoteCluster.java
index f50d660..e254cd9 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/RemoteCluster.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/RemoteCluster.java
@@ -22,6 +22,8 @@ package org.apache.airavata.gfac.core.cluster;
import com.jcraft.jsch.Session;
import org.apache.airavata.gfac.core.SSHApiException;
+import org.apache.airavata.gfac.core.authentication.AuthenticationInfo;
+import org.apache.airavata.gfac.core.authentication.SSHKeyAuthentication;
import org.apache.airavata.model.status.JobStatus;
import java.util.List;
@@ -151,6 +153,7 @@ public interface RemoteCluster { // FIXME: replace SSHApiException with suitable
*/
public ServerInfo getServerInfo();
+ public AuthenticationInfo getAuthentication();
enum DIRECTION {
TO,
FROM
http://git-wip-us.apache.org/repos/asf/airavata/blob/b96cb162/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/BESRemoteCluster.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/BESRemoteCluster.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/BESRemoteCluster.java
index 0dd69fe..3586ee8 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/BESRemoteCluster.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/BESRemoteCluster.java
@@ -25,6 +25,7 @@ import com.jcraft.jsch.Session;
import org.apache.airavata.gfac.core.JobManagerConfiguration;
import org.apache.airavata.gfac.core.SSHApiException;
import org.apache.airavata.gfac.core.authentication.AuthenticationInfo;
+import org.apache.airavata.gfac.core.authentication.SSHKeyAuthentication;
import org.apache.airavata.gfac.core.cluster.*;
import org.apache.airavata.model.status.JobStatus;
@@ -105,4 +106,9 @@ public class BESRemoteCluster extends AbstractRemoteCluster{
public ServerInfo getServerInfo() {
return null;
}
+
+ @Override
+ public AuthenticationInfo getAuthentication() {
+ return null;
+ }
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b96cb162/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
index 0ab85ca..4ab9c6a 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
@@ -230,7 +230,13 @@ public abstract class Factory {
processContext.getSshKeyAuthentication());
}
remoteClusterMap.put(key, remoteCluster);
- }
+ }else {
+ AuthenticationInfo authentication = remoteCluster.getAuthentication();
+ if (authentication instanceof SSHKeyAuthentication){
+ SSHKeyAuthentication sshKeyAuthentication = (SSHKeyAuthentication)authentication;
+ sshKeyAuthentication.setUserName(processContext.getComputeResourcePreference().getLoginUserName());
+ }
+ }
return remoteCluster;
}
@@ -251,6 +257,12 @@ public abstract class Factory {
}
remoteClusterMap.put(key, remoteCluster);
+ }else {
+ AuthenticationInfo authentication = remoteCluster.getAuthentication();
+ if (authentication instanceof SSHKeyAuthentication){
+ SSHKeyAuthentication sshKeyAuthentication = (SSHKeyAuthentication)authentication;
+ sshKeyAuthentication.setUserName(processContext.getComputeResourcePreference().getLoginUserName());
+ }
}
return remoteCluster;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b96cb162/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
index d4988b5..7d8fe02 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
@@ -312,7 +312,13 @@ public class HPCRemoteCluster extends AbstractRemoteCluster{
return this.serverInfo;
}
- private class DefaultUserInfo implements UserInfo {
+ @Override
+ public AuthenticationInfo getAuthentication() {
+ return this.authentication;
+ }
+
+
+ private class DefaultUserInfo implements UserInfo {
private String userName;
private String password;
http://git-wip-us.apache.org/repos/asf/airavata/blob/b96cb162/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/LocalRemoteCluster.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/LocalRemoteCluster.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/LocalRemoteCluster.java
index 1bab250..88c624a 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/LocalRemoteCluster.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/LocalRemoteCluster.java
@@ -4,6 +4,7 @@ import com.jcraft.jsch.Session;
import org.apache.airavata.gfac.core.JobManagerConfiguration;
import org.apache.airavata.gfac.core.SSHApiException;
import org.apache.airavata.gfac.core.authentication.AuthenticationInfo;
+import org.apache.airavata.gfac.core.authentication.SSHKeyAuthentication;
import org.apache.airavata.gfac.core.cluster.*;
import org.apache.airavata.model.status.JobStatus;
@@ -179,4 +180,9 @@ public class LocalRemoteCluster extends AbstractRemoteCluster {
public ServerInfo getServerInfo() {
return null;
}
+
+ @Override
+ public AuthenticationInfo getAuthentication() {
+ return null;
+ }
}