airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: updating to get the login user name
Date Mon, 31 Aug 2015 19:58:34 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 114fa7392 -> 1be29cb1f


updating to get the login user name


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

Branch: refs/heads/master
Commit: 1be29cb1f46025101fd4c1e2c2f3e384561116e8
Parents: 114fa73
Author: Chathuri Wimalasena <chathuri@apache.org>
Authored: Mon Aug 31 15:58:26 2015 -0400
Committer: Chathuri Wimalasena <chathuri@apache.org>
Committed: Mon Aug 31 15:58:26 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/airavata/gfac/impl/Factory.java | 16 +++++++---------
 .../apache/airavata/gfac/impl/GFacEngineImpl.java   |  3 +--
 2 files changed, 8 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/1be29cb1/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 9665d90..bb53802 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
@@ -40,6 +40,7 @@ import org.apache.airavata.gfac.core.config.GFacYamlConfigruation;
 import org.apache.airavata.gfac.core.config.JobSubmitterTaskConfig;
 import org.apache.airavata.gfac.core.config.ResourceConfig;
 import org.apache.airavata.gfac.core.context.GFacContext;
+import org.apache.airavata.gfac.core.context.ProcessContext;
 import org.apache.airavata.gfac.core.monitor.JobMonitor;
 import org.apache.airavata.gfac.core.scheduler.HostScheduler;
 import org.apache.airavata.gfac.core.task.JobSubmissionTask;
@@ -194,25 +195,22 @@ public abstract class Factory {
 	/**
 	 * Factory class manage reomete cluster map, this will solve too many connections/ sessions
issues with cluster
 	 * communications.
-	 * @param jobSubmissionProtocol
-	 * @param computeResourceId
-	 * @param resourceJobManager
+	 * @param processContext
 	 * @return
 	 * @throws GFacException
 	 * @throws AppCatalogException
 	 * @throws AiravataException
 	 */
-	public static RemoteCluster getRemoteCluster(JobSubmissionProtocol jobSubmissionProtocol,
String computeResourceId,
-	                                             ResourceJobManager resourceJobManager) throws
GFacException,
+	public static RemoteCluster getRemoteCluster(ProcessContext processContext) throws GFacException,
 			AppCatalogException, AiravataException {
 
-		String key = jobSubmissionProtocol.toString() + ":" + computeResourceId;
+        String computeResourceId = processContext.getComputeResourceId();
+        String key = processContext.getJobSubmissionProtocol().toString() + ":" + computeResourceId;
 		RemoteCluster remoteCluster = remoteClusterMap.get(key);
 		if (remoteCluster == null) {
 			String hostName = Factory.getDefaultAppCatalog().getComputeResource().getComputeResource(computeResourceId).getHostName();
-			// fixme - read login user name from computeResourcePreference
-			ServerInfo serverInfo = new ServerInfo(ServerSettings.getSetting("ssh.username"), hostName);
-			JobManagerConfiguration jobManagerConfiguration = getJobManagerConfiguration(resourceJobManager);
+			ServerInfo serverInfo = new ServerInfo(processContext.getComputeResourcePreference().getLoginUserName(),
hostName);
+			JobManagerConfiguration jobManagerConfiguration = getJobManagerConfiguration(processContext.getResourceJobManager());
 			AuthenticationInfo authenticationInfo = getSSHKeyAuthentication();
 			remoteCluster = new HPCRemoteCluster(serverInfo, jobManagerConfiguration, authenticationInfo);
 			remoteClusterMap.put(key, remoteCluster);

http://git-wip-us.apache.org/repos/asf/airavata/blob/1be29cb1/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
index 5a2d506..5a63871 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
@@ -100,8 +100,7 @@ public class GFacEngineImpl implements GFacEngine {
 			processContext.setApplicationInterfaceDescription(appCatalog.getApplicationInterface()
 					.getApplicationInterface(processModel.getApplicationInterfaceId()));
 			processContext.setResourceJobManager(getResourceJobManager(processContext));
-			processContext.setRemoteCluster(Factory.getRemoteCluster(processContext.getJobSubmissionProtocol(),
-					processContext.getComputeResourceId(), processContext.getResourceJobManager()));
+			processContext.setRemoteCluster(Factory.getRemoteCluster(processContext));
 
 			String inputPath = ServerSettings.getLocalDataLocation();
 			if (inputPath != null) {


Mime
View raw message