Repository: airavata
Updated Branches:
  refs/heads/master 869a62504 -> 2b1c87fd1


Fixed SSH Fork job submission issues.


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

Branch: refs/heads/master
Commit: 2b1c87fd12d3f329afe0552d22059a8994de70cd
Parents: 869a625
Author: Shameera Rathanyaka <[email protected]>
Authored: Thu Aug 27 21:16:52 2015 -0400
Committer: Shameera Rathanyaka <[email protected]>
Committed: Thu Aug 27 21:16:52 2015 -0400

----------------------------------------------------------------------
 .../server/src/main/resources/ForkTemplate.xslt | 24 ++++++++++++++++++++
 .../airavata/gfac/impl/GFacEngineImpl.java      |  9 +++++++-
 .../gfac/impl/job/ForkOutputParser.java         |  2 +-
 .../src/main/resources/ForkTemplate.xslt        |  2 +-
 4 files changed, 34 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/2b1c87fd/modules/configuration/server/src/main/resources/ForkTemplate.xslt
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/ForkTemplate.xslt 
b/modules/configuration/server/src/main/resources/ForkTemplate.xslt
new file mode 100644
index 0000000..d3cbe12
--- /dev/null
+++ b/modules/configuration/server/src/main/resources/ForkTemplate.xslt
@@ -0,0 +1,24 @@
+<!--Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements. See the NOTICE file
+       distributed with this work for additional information regarding 
copyright ownership. The ASF licenses this file to you under
+       the Apache License, Version 2.0 (theÏ "License"); you may not use this 
file except in compliance with the License. You may
+       obtain a copy of the License at 
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or 
agreed to
+       in writing, software distributed under the License is distributed on an 
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+       ANY ~ KIND, either express or implied. See the License for the specific 
language governing permissions and limitations under
+       the License. -->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:ns="http://airavata.apache.org/gfac/core/2012/12";>
+<xsl:output method="text" />
+<xsl:template match="/ns:JobDescriptor">
+#! /bin/sh
+cd <xsl:text>   </xsl:text><xsl:value-of 
select="ns:workingDirectory"/><xsl:text>&#xa;</xsl:text>
+    <xsl:choose><xsl:when test="ns:jobSubmitterCommand">
+<xsl:value-of select="ns:jobSubmitterCommand"/><xsl:text>   
</xsl:text></xsl:when></xsl:choose><xsl:value-of 
select="ns:executablePath"/><xsl:text>   </xsl:text>
+<xsl:for-each select="ns:inputs/ns:input">
+      <xsl:value-of select="."/><xsl:text>   </xsl:text>
+    </xsl:for-each>
+<xsl:for-each select="ns:postJobCommands/ns:command">
+      <xsl:value-of select="."/><xsl:text>   </xsl:text>
+</xsl:for-each>
+
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/2b1c87fd/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 d66d58d..5a2d506 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
@@ -465,7 +465,7 @@ public class GFacEngineImpl implements GFacEngine {
                });
        }
 
-       public static ResourceJobManager getResourceJobManager(ProcessContext 
processCtx) throws AppCatalogException {
+       public static ResourceJobManager getResourceJobManager(ProcessContext 
processCtx) throws AppCatalogException, GFacException {
                List<JobSubmissionInterface> jobSubmissionInterfaces = 
Factory.getDefaultAppCatalog().getComputeResource()
                                
.getComputeResource(processCtx.getComputeResourceId()).getJobSubmissionInterfaces();
 
@@ -489,8 +489,15 @@ public class GFacEngineImpl implements GFacEngine {
                        LOCALSubmission localSubmission = 
Factory.getDefaultAppCatalog().getComputeResource().getLocalJobSubmission
                                        
(jsInterface.getJobSubmissionInterfaceId());
                        resourceJobManager = 
localSubmission.getResourceJobManager();
+               } else if (jsInterface.getJobSubmissionProtocol() == 
JobSubmissionProtocol.SSH_FORK) {
+                       SSHJobSubmission sshJobSubmission = 
Factory.getDefaultAppCatalog().getComputeResource().getSSHJobSubmission
+                                       
(jsInterface.getJobSubmissionInterfaceId());
+                       
processCtx.setMonitorMode(sshJobSubmission.getMonitorMode()); // fixme - Move 
this to populate process
+                       resourceJobManager = 
sshJobSubmission.getResourceJobManager();
                } else {
                        // TODO : throw an not supported jobsubmission protocol 
exception. we only support SSH and LOCAL
+                       throw new GFacException("Unsupported 
JobSubmissionProtocol - " + jsInterface.getJobSubmissionProtocol()
+                                       .name());
                }
 
                if (resourceJobManager == null) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/2b1c87fd/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/ForkOutputParser.java
----------------------------------------------------------------------
diff --git 
a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/ForkOutputParser.java
 
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/ForkOutputParser.java
index 51b8e8a..72856e5 100644
--- 
a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/ForkOutputParser.java
+++ 
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/ForkOutputParser.java
@@ -40,7 +40,7 @@ public class ForkOutputParser implements OutputParser {
 
     @Override
     public String parseJobSubmission(String rawOutput) throws SSHApiException {
-        return null;
+           return AiravataUtils.getId("JOB_ID_");
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/airavata/blob/2b1c87fd/modules/gfac/gfac-impl/src/main/resources/ForkTemplate.xslt
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/resources/ForkTemplate.xslt 
b/modules/gfac/gfac-impl/src/main/resources/ForkTemplate.xslt
index f04c911..d3cbe12 100644
--- a/modules/gfac/gfac-impl/src/main/resources/ForkTemplate.xslt
+++ b/modules/gfac/gfac-impl/src/main/resources/ForkTemplate.xslt
@@ -5,7 +5,7 @@
        in writing, software distributed under the License is distributed on an 
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
        ANY ~ KIND, either express or implied. See the License for the specific 
language governing permissions and limitations under
        the License. -->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:ns="http://airavata.apache.org/gsi/ssh/2012/12";>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:ns="http://airavata.apache.org/gfac/core/2012/12";>
 <xsl:output method="text" />
 <xsl:template match="/ns:JobDescriptor">
 #! /bin/sh

Reply via email to