Repository: airavata Updated Branches: refs/heads/master aed31d3eb -> f2b5df444
http://git-wip-us.apache.org/repos/asf/airavata/blob/5381d599/modules/gfac/gfac-ssh/src/test/resources/PBSTemplate.xslt ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-ssh/src/test/resources/PBSTemplate.xslt b/modules/gfac/gfac-ssh/src/test/resources/PBSTemplate.xslt new file mode 100644 index 0000000..e749e9c --- /dev/null +++ b/modules/gfac/gfac-ssh/src/test/resources/PBSTemplate.xslt @@ -0,0 +1,73 @@ +<!--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/gsi/ssh/2012/12"> +<xsl:output method="text" /> +<xsl:template match="/ns:JobDescriptor"> +#! /bin/sh +# PBS batch job script built by Globus job manager +# <xsl:choose> + <xsl:when test="ns:shellName"> +##PBS -S <xsl:value-of select="ns:shellName"/> + </xsl:when></xsl:choose> + <xsl:choose> + <xsl:when test="ns:queueName"> +#PBS -q <xsl:value-of select="ns:queueName"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:mailOptions"> +#PBS -m <xsl:value-of select="ns:mailOptions"/> + </xsl:when> + </xsl:choose> + <xsl:choose> +<xsl:when test="ns:acountString"> +#PBS -A <xsl:value-of select="ns:acountString"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:maxWallTime"> +#PBS -l walltime=<xsl:value-of select="ns:maxWallTime"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:standardOutFile"> +#PBS -o <xsl:value-of select="ns:standardOutFile"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="ns:standardOutFile"> +#PBS -e <xsl:value-of select="ns:standardErrorFile"/> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="(ns:nodes) and (ns:processesPerNode)"> +#PBS -l nodes=<xsl:value-of select="ns:nodes"/>:ppn=<xsl:value-of select="ns:processesPerNode"/> +<xsl:text>
</xsl:text> + </xsl:when> + </xsl:choose> +<xsl:for-each select="ns:exports/ns:name"> +<xsl:value-of select="."/>=<xsl:value-of select="./@value"/><xsl:text>
</xsl:text> +export<xsl:text> </xsl:text><xsl:value-of select="."/> +<xsl:text>
</xsl:text> +</xsl:for-each> +<xsl:for-each select="ns:preJobCommands/ns:command"> + <xsl:value-of select="."/><xsl:text> </xsl:text> + </xsl:for-each> +cd <xsl:text> </xsl:text><xsl:value-of select="ns:workingDirectory"/><xsl:text>
</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/5381d599/modules/gfac/gfac-ssh/src/test/resources/gfac-config.xml ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-ssh/src/test/resources/gfac-config.xml b/modules/gfac/gfac-ssh/src/test/resources/gfac-config.xml new file mode 100644 index 0000000..f21288d --- /dev/null +++ b/modules/gfac/gfac-ssh/src/test/resources/gfac-config.xml @@ -0,0 +1,33 @@ +<!-- ~ 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. --> + +<GFac> + <GlobalHandlers> + <InHandlers> + <Handler class="org.apache.airavata.gfac.handler.AppDescriptorCheckHandler"> + <property name="name" value="value"/> + </Handler> + </InHandlers> + <OutHandlers></OutHandlers> + </GlobalHandlers> + + + <Provider class="org.apache.airavata.gfac.provider.impl.SSHProvider" host="org.apache.airavata.schemas.gfac.impl.SSHHostTypeImpl"> + <InHandlers> + <Handler class="org.apache.airavata.gfac.handler.SCPDirectorySetupHandler"/> + <Handler class="org.apache.airavata.gfac.handler.SCPInputHandler"/> + </InHandlers> + <OutHandlers> + <Handler class="org.apache.airavata.gfac.handler.SCPOutputHandler"/> + </OutHandlers> + </Provider> +</GFac> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/5381d599/modules/gfac/gfac-ssh/src/test/resources/logging.properties ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-ssh/src/test/resources/logging.properties b/modules/gfac/gfac-ssh/src/test/resources/logging.properties new file mode 100644 index 0000000..0584d38 --- /dev/null +++ b/modules/gfac/gfac-ssh/src/test/resources/logging.properties @@ -0,0 +1,42 @@ +# +# 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. +# +# +#default/fallback log4j configuration +# + +# Set root logger level to WARN and its only appender to A1. +log4j.rootLogger=INFO, A1, A2 + +# A1 is set to be a rolling file appender with default params +log4j.appender.A1=org.apache.log4j.RollingFileAppender +log4j.appender.A1.File=target/seclogs.txt + +# A1 uses PatternLayout. +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n + +# A2 is a console appender +log4j.appender.A2=org.apache.log4j.ConsoleAppender + +# A2 uses PatternLayout. +log4j.appender.A2.layout=org.apache.log4j.PatternLayout +log4j.appender.A2.layout.ConversionPattern=%d [%t] %-5p %c{1} %x - %m%n + +log4j.logger.unicore.security=INFO + http://git-wip-us.apache.org/repos/asf/airavata/blob/5381d599/modules/gfac/pom.xml ---------------------------------------------------------------------- diff --git a/modules/gfac/pom.xml b/modules/gfac/pom.xml index 2b57a11..2d2293b 100644 --- a/modules/gfac/pom.xml +++ b/modules/gfac/pom.xml @@ -32,6 +32,7 @@ <modules> <module>gfac-core</module> <module>gfac-ec2</module> + <module>gfac-ssh</module> <module>gfac-monitor</module> </modules> </profile> http://git-wip-us.apache.org/repos/asf/airavata/blob/5381d599/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/config/ConfigReader.java ---------------------------------------------------------------------- diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/config/ConfigReader.java b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/config/ConfigReader.java index 152ae36..088ab38 100644 --- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/config/ConfigReader.java +++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/config/ConfigReader.java @@ -21,6 +21,11 @@ package org.apache.airavata.gsi.ssh.config; +import com.sun.security.auth.login.ConfigFile; +import sun.security.jgss.LoginConfigImpl; + +import javax.security.auth.login.Configuration; +import javax.security.auth.login.LoginContext; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; @@ -63,6 +68,7 @@ public class ConfigReader { return this.properties.getProperty(key); } + /** * Gets all the SSH related properties used by JSch. * @return All properties. http://git-wip-us.apache.org/repos/asf/airavata/blob/5381d599/tools/job-monitor/src/test/java/org/apache/airavata/job/AMQPMonitorTest.java ---------------------------------------------------------------------- diff --git a/tools/job-monitor/src/test/java/org/apache/airavata/job/AMQPMonitorTest.java b/tools/job-monitor/src/test/java/org/apache/airavata/job/AMQPMonitorTest.java index aa42a9d..447e6e5 100644 --- a/tools/job-monitor/src/test/java/org/apache/airavata/job/AMQPMonitorTest.java +++ b/tools/job-monitor/src/test/java/org/apache/airavata/job/AMQPMonitorTest.java @@ -65,12 +65,12 @@ public class AMQPMonitorTest { private String proxyFilePath; @Before public void setUp() throws Exception { -// System.setProperty("myproxy.username", "ogce"); -// System.setProperty("myproxy.password", ""); -// System.setProperty("basedir", "/Users/lahirugunathilake/work/airavata/sandbox/gsissh"); -// System.setProperty("gsi.working.directory", "/home/ogce"); -// System.setProperty("trusted.cert.location", "/Users/lahirugunathilake/Downloads/certificates"); -// System.setProperty("proxy.file.path", "/Users/lahirugunathilake/Downloads/x509up_u503876"); + System.setProperty("myproxy.username", "ogce"); + System.setProperty("myproxy.password", "OpenGwy14"); + System.setProperty("basedir", "/Users/lahirugunathilake/work/airavata/sandbox/gsissh"); + System.setProperty("gsi.working.directory", "/home1/01437/ogce"); + System.setProperty("trusted.cert.location", "/Users/lahirugunathilake/Downloads/certificates"); + System.setProperty("proxy.file.path", "/Users/lahirugunathilake/Downloads/x509up_u503876"); myProxyUserName = System.getProperty("myproxy.username"); myProxyPassword = System.getProperty("myproxy.password"); workingDirectory = System.getProperty("gsi.working.directory"); @@ -100,7 +100,7 @@ public class AMQPMonitorTest { } hostDescription = new HostDescription(GsisshHostType.type); - hostDescription.getType().setHostAddress("stampede.tacc.xsede.org"); + hostDescription.getType().setHostAddress("login1.stampede.tacc.utexas.edu"); hostDescription.getType().setHostName("stampede-host"); ((GsisshHostType) hostDescription.getType()).setJobManager("slurm"); ((GsisshHostType) hostDescription.getType()).setInstalledPath("/usr/bin/"); @@ -117,11 +117,11 @@ public class AMQPMonitorTest { 7512, 17280000, certificateLocation); // Server info - ServerInfo serverInfo = new ServerInfo("ogce", "trestles.sdsc.edu"); + ServerInfo serverInfo = new ServerInfo("ogce", "login1.stampede.tacc.utexas.edu",2222); Cluster pbsCluster = new - PBSCluster(serverInfo, authenticationInfo, org.apache.airavata.gsi.ssh.util.CommonUtils.getPBSJobManager("/opt/torque/bin/")); + PBSCluster(serverInfo, authenticationInfo, org.apache.airavata.gsi.ssh.util.CommonUtils.getPBSJobManager("/usr/bin/")); // Execute command @@ -140,7 +140,7 @@ public class AMQPMonitorTest { jobDescriptor.setProcessesPerNode(1); jobDescriptor.setQueueName("normal"); jobDescriptor.setMaxWallTime("60"); - jobDescriptor.setAcountString("sds128"); + jobDescriptor.setAcountString("TG-STA110014S"); List<String> inputs = new ArrayList<String>(); jobDescriptor.setOwner("ogce"); inputs.add("Hello World"); @@ -152,7 +152,7 @@ public class AMQPMonitorTest { try { pushQueue.add(new MonitorID(hostDescription, jobID,null,null, "ogce")); } catch (Exception e) { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + e.printStackTrace(); } try { pushThread.join(); http://git-wip-us.apache.org/repos/asf/airavata/blob/5381d599/tools/job-monitor/src/test/java/org/apache/airavata/job/QstatMonitorTestWithMyProxyAuth.java ---------------------------------------------------------------------- diff --git a/tools/job-monitor/src/test/java/org/apache/airavata/job/QstatMonitorTestWithMyProxyAuth.java b/tools/job-monitor/src/test/java/org/apache/airavata/job/QstatMonitorTestWithMyProxyAuth.java index c086c65..f94dfa6 100644 --- a/tools/job-monitor/src/test/java/org/apache/airavata/job/QstatMonitorTestWithMyProxyAuth.java +++ b/tools/job-monitor/src/test/java/org/apache/airavata/job/QstatMonitorTestWithMyProxyAuth.java @@ -60,11 +60,11 @@ public class QstatMonitorTestWithMyProxyAuth { @org.testng.annotations.BeforeClass public void setUp() throws Exception { -// System.setProperty("myproxy.username", "ogce"); -// System.setProperty("myproxy.password", ""); -// System.setProperty("basedir", "/Users/lahirugunathilake/work/airavata/sandbox/gsissh"); -// System.setProperty("gsi.working.directory", "/home/ogce"); -// System.setProperty("trusted.cert.location", "/Users/lahirugunathilake/Downloads/certificates"); + System.setProperty("myproxy.username", "ogce"); + System.setProperty("myproxy.password", "OpenGwy14"); + System.setProperty("basedir", "/Users/lahirugunathilake/work/airavata/sandbox/gsissh"); + System.setProperty("gsi.working.directory", "/home/ogce"); + System.setProperty("trusted.cert.location", "/Users/lahirugunathilake/Downloads/certificates"); myProxyUserName = System.getProperty("myproxy.username"); myProxyPassword = System.getProperty("myproxy.password"); workingDirectory = System.getProperty("gsi.working.directory");
