airavata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AIRAVATA-2621) SSH port provided in compute resource registration is not considered for cluster SSH communication
Date Thu, 18 Jan 2018 19:31:04 GMT

    [ https://issues.apache.org/jira/browse/AIRAVATA-2621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16331047#comment-16331047
] 

ASF GitHub Bot commented on AIRAVATA-2621:
------------------------------------------

machristie closed pull request #160: Fixing AIRAVATA-2621
URL: https://github.com/apache/airavata/pull/160
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
index 6ca29e35e7..2dad12bce0 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
@@ -43,6 +43,7 @@
 import org.apache.airavata.model.status.ProcessStatus;
 import org.apache.airavata.model.task.TaskModel;
 import org.apache.airavata.registry.cpi.AppCatalog;
+import org.apache.airavata.registry.cpi.AppCatalogException;
 import org.apache.airavata.registry.cpi.ExperimentCatalog;
 import org.apache.curator.framework.CuratorFramework;
 import org.slf4j.Logger;
@@ -620,7 +621,44 @@ private ComputationalResourceSchedulingModel getProcessCRSchedule() {
 		}
 	}
 
-	public ServerInfo getComputeResourceServerInfo(){
+	public ServerInfo getComputeResourceServerInfo() throws GFacException {
+
+		if (this.jobSubmissionProtocol  == JobSubmissionProtocol.SSH) {
+			Optional<JobSubmissionInterface> firstJobSubmissionIface = getComputeResourceDescription()
+					.getJobSubmissionInterfaces().stream()
+					.filter(iface -> iface.getJobSubmissionProtocol() == JobSubmissionProtocol.SSH)
+					.findFirst();
+
+			if (firstJobSubmissionIface.isPresent()) {
+
+				try {
+                    SSHJobSubmission sshJobSubmission = appCatalog.getComputeResource()
+                            .getSSHJobSubmission(firstJobSubmissionIface.get().getJobSubmissionInterfaceId());
+
+					String alternateHostName = sshJobSubmission.getAlternativeSSHHostName();
+					String hostName = !(alternateHostName == null || alternateHostName.length() == 0) ?
alternateHostName :
+								getComputeResourceDescription().getHostName();
+
+					if (sshJobSubmission.getSshPort() > 0) {
+                        return new ServerInfo(
+                                getComputeResourceLoginUserName(),
+                                hostName,
+                                getComputeResourceCredentialToken(),
+                                sshJobSubmission.getSshPort());
+                    } else {
+                        return new ServerInfo(
+                                getComputeResourceLoginUserName(),
+                                hostName,
+                                getComputeResourceCredentialToken());
+                    }
+
+				} catch (AppCatalogException e) {
+					throw new GFacException("Failed to fetch ssh job submission for interface " +
+                            firstJobSubmissionIface.get().getJobSubmissionInterfaceId(),
e);
+				}
+			}
+		}
+
 		return new ServerInfo(getComputeResourceLoginUserName(),
 				getComputeResourceDescription().getHostName(),
 				getComputeResourceCredentialToken());
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 37848e73ba..5ef22e1a63 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
@@ -22,12 +22,7 @@
 import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.RemovalListener;
-import com.jcraft.jsch.Channel;
-import com.jcraft.jsch.ChannelExec;
-import com.jcraft.jsch.JSch;
-import com.jcraft.jsch.JSchException;
-import com.jcraft.jsch.Session;
-import com.jcraft.jsch.UserInfo;
+import com.jcraft.jsch.*;
 import org.apache.airavata.common.exception.AiravataException;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
@@ -596,7 +591,7 @@ public static Task getArchiveTask() {
 		return new ArchiveTask();
 	}
 
-	private static class DefaultUserInfo implements UserInfo {
+	private static class DefaultUserInfo implements UserInfo, UIKeyboardInteractive {
 
 		private String userName;
 		private String password;
@@ -637,5 +632,11 @@ public boolean promptYesNo(String s) {
 		public void showMessage(String s) {
 
 		}
-	}
+
+        @Override
+        public String[] promptKeyboardInteractive(String destination, String name, String
instruction,
+                                                  String[] prompt, boolean[] echo) {
+            return new String[0];
+        }
+    }
 }
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 ac3e755452..e81f164e3e 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
@@ -848,7 +848,7 @@ private TaskContext getJobSubmissionTaskContext(ProcessContext processContext)
t
     }
 
     private TaskContext getDataStagingTaskContext(ProcessContext processContext, OutputDataObjectType
processOutput)
-            throws TException, TaskException {
+            throws TException, TaskException, GFacException {
         TaskContext taskCtx = new TaskContext();
         taskCtx.setParentProcessContext(processContext);
         // create new task model for this task


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> SSH port provided in compute resource registration is not considered for cluster SSH
communication
> --------------------------------------------------------------------------------------------------
>
>                 Key: AIRAVATA-2621
>                 URL: https://issues.apache.org/jira/browse/AIRAVATA-2621
>             Project: Airavata
>          Issue Type: Bug
>          Components: GFac
>    Affects Versions: 0.18
>         Environment: https://hpcgateway.gsu.edu/
> https://scigap.org/
>            Reporter: Eroma
>            Assignee: Dimuthu Upeksha
>            Priority: Major
>             Fix For: 0.18
>
>
> 1. Added a specific port for job submissions (15022)
> 2. But when submitting jobs, for environment creation, the gfac is using the default
22 port, not the specified one in scigap.org for hpclogin.gsu.edu.
> 3. log messages in airavata log
> 2017-12-19 11:13:18,996 [pool-7-thread-2] INFO  o.a.airavata.gfac.impl.Factory process_id=PROCESS_3b471b3b-5b4e-4b6d-a66e-554652a390d2,
token_id=35da840b-63d5-4cbf-b9ce-3005cd94d961, experiment_id=NWChem2_a38ac303-666f-4dea-9b4c-7bffe0f97dd7,
gateway_id=georgiastate - Initialize a new SSH session for :airavata_hpclogin.gsu.edu_22_35da840b-63d5-4cbf-b9ce-3005cd94d961
> 2017-12-19 11:15:26,272 [pool-7-thread-2] ERROR o.a.a.gfac.core.GFacException process_id=PROCESS_3b471b3b-5b4e-4b6d-a66e-554652a390d2,
token_id=35da840b-63d5-4cbf-b9ce-3005cd94d961, experiment_id=NWChem2_a38ac303-666f-4dea-9b4c-7bffe0f97dd7,
gateway_id=georgiastate - JSch initialization error
> com.jcraft.jsch.JSchException: java.net.ConnectException: Connection timed out (Connection
timed out)
>         at com.jcraft.jsch.Util.createSocket(Util.java:349)
>         at com.jcraft.jsch.Session.connect(Session.java:215)
>         at com.jcraft.jsch.Session.connect(Session.java:183)
>         at org.apache.airavata.gfac.impl.Factory.getSSHSession(Factory.java:542)
>         at org.apache.airavata.gfac.impl.HPCRemoteCluster.getSshSession(HPCRemoteCluster.java:138)
>         at org.apache.airavata.gfac.impl.HPCRemoteCluster.getSession(HPCRemoteCluster.java:315)
>         at org.apache.airavata.gfac.impl.HPCRemoteCluster.makeDirectory(HPCRemoteCluster.java:242)
>         at org.apache.airavata.gfac.impl.task.EnvironmentSetupTask.execute(EnvironmentSetupTask.java:51)
>         at org.apache.airavata.gfac.impl.GFacEngineImpl.executeTask(GFacEngineImpl.java:814)
>         at org.apache.airavata.gfac.impl.GFacEngineImpl.configureWorkspace(GFacEngineImpl.java:553)
>         at org.apache.airavata.gfac.impl.GFacEngineImpl.executeTaskListFrom(GFacEngineImpl.java:324)
>         at org.apache.airavata.gfac.impl.GFacEngineImpl.executeProcess(GFacEngineImpl.java:286)
>         at org.apache.airavata.gfac.impl.GFacWorker.executeProcess(GFacWorker.java:227)
>         at org.apache.airavata.gfac.impl.GFacWorker.run(GFacWorker.java:86)
>         at org.apache.airavata.common.logging.MDCUtil.lambda$wrapWithMDC$0(MDCUtil.java:40)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:748)
> Caused by: java.net.ConnectException: Connection timed out (Connection timed out)
>         at java.net.PlainSocketImpl.socketConnect(Native Method)
>         at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
>         at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
>         at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
>         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
>         at java.net.Socket.connect(Socket.java:589)
>         at java.net.Socket.connect(Socket.java:538)
>         at java.net.Socket.<init>(Socket.java:434)
>         at java.net.Socket.<init>(Socket.java:211)
>         at com.jcraft.jsch.Util.createSocket(Util.java:343)
>         ... 17 common frames omitted
> ?NWChem2_a38ac303-666f-4dea-9b4c-7bffe0f97dd7



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message