airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject [1/2] git commit: completing a test case for monitoring amqp - AIRAVATA-1022
Date Fri, 21 Feb 2014 21:43:45 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 9b858526d -> 16d6d176a


completing a test case for monitoring amqp - AIRAVATA-1022


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

Branch: refs/heads/master
Commit: eeddc5b92120c5f0449eadf5c21297a5e3752643
Parents: 0c58b97
Author: lahiru <lahiru@apache.org>
Authored: Fri Feb 21 16:43:25 2014 -0500
Committer: lahiru <lahiru@apache.org>
Committed: Fri Feb 21 16:43:25 2014 -0500

----------------------------------------------------------------------
 modules/airavata-job-monitor/pom.xml            | 144 +++----------------
 .../airavata/job/monitor/MonitorManager.java    |  39 +++--
 .../job/monitor/impl/push/amqp/AMQPMonitor.java |  28 ++--
 .../impl/push/amqp/JSONMessageParser.java       |   3 -
 .../airavata/job/monitor/util/CommonUtils.java  |   4 +-
 .../src/main/resources/PBSTemplate.xslt         |  77 ++++++++++
 .../src/main/resources/gsissh.properties        |  26 ++++
 .../airavata/job/monitor/SimpleMonitorTest.java |  48 ++++---
 8 files changed, 184 insertions(+), 185 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/eeddc5b9/modules/airavata-job-monitor/pom.xml
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/pom.xml b/modules/airavata-job-monitor/pom.xml
index f277a24..4476a5d 100644
--- a/modules/airavata-job-monitor/pom.xml
+++ b/modules/airavata-job-monitor/pom.xml
@@ -14,7 +14,7 @@
         <groupId>org.apache.airavata</groupId>
         <artifactId>airavata</artifactId>
         <version>0.12-SNAPSHOT</version>
-	<relativePath>../../pom.xml</relativePath>
+        <relativePath>../../pom.xml</relativePath>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
@@ -24,15 +24,20 @@
     <url>http://airavata.apache.org/</url>
 
     <dependencies>
-
         <dependency>
             <groupId>org.jglobus</groupId>
             <artifactId>gss</artifactId>
             <version>${jglobus.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.bouncycastle</groupId>
+                    <artifactId>bcprov-jdk16</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.jglobus</groupId>
-            <artifactId>gram</artifactId>
+            <artifactId>myproxy</artifactId>
             <version>${jglobus.version}</version>
             <exclusions>
                 <exclusion>
@@ -43,41 +48,20 @@
         </dependency>
         <dependency>
             <groupId>org.bouncycastle</groupId>
-            <artifactId>bcprov-jdk16</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.jglobus</groupId>
-            <artifactId>myproxy</artifactId>
-            <version>${jglobus.version}</version>
+            <artifactId>bcprov-jdk15on</artifactId>
+            <version>1.48</version>
         </dependency>
         <dependency>
-            <groupId>org.jglobus</groupId>
-            <artifactId>gridftp</artifactId>
-            <version>${jglobus.version}</version>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcpkix-jdk15on</artifactId>
+            <version>1.48</version>
         </dependency>
-
         <!-- Logging -->
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>
 
-        <!-- GFAC schemas -->
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-client-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-workflow-execution-context</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-registry-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         <dependency>
             <groupId>org.apache.airavata</groupId>
             <artifactId>airavata-registry-cpi</artifactId>
@@ -88,14 +72,18 @@
             <groupId>org.apache.airavata</groupId>
             <artifactId>airavata-jpa-registry</artifactId>
             <version>${project.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.bouncycastle</groupId>
+                    <artifactId>bcprov-jdk16</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
-        <!-- Workflow Tracking -->
         <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-workflow-tracking</artifactId>
-            <version>${project.version}</version>
+            <groupId>com.rabbitmq</groupId>
+            <artifactId>amqp-client</artifactId>
+            <version>3.2.3</version>
         </dependency>
-
         <!-- SSH -->
         <dependency>
             <groupId>net.schmizz</groupId>
@@ -103,13 +91,6 @@
             <version>0.8.0</version>
         </dependency>
 
-        <!-- Credential Store -->
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-credential-store</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
         <!-- Amazon EC2 Provider -->
         <dependency>
             <groupId>com.amazonaws</groupId>
@@ -161,65 +142,8 @@
             <artifactId>slf4j-log4j12</artifactId>
             <scope>test</scope>
         </dependency>
-        <!-- Unicore dependencies -->
-        <dependency>
-            <groupId>eu.unicore</groupId>
-            <artifactId>ogsabes-client</artifactId>
-            <version>1.7.0-rc</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.santuario</groupId>
-                    <artifactId>xmlsec</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.bouncycastle</groupId>
-                    <artifactId>bcprov-jdk16</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
 
 
-        <!-- Hadoop provider related dependencies -->
-        <dependency>
-            <groupId>org.apache.hadoop</groupId>
-            <artifactId>hadoop-core</artifactId>
-            <version>1.0.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.hadoop</groupId>
-            <artifactId>hadoop-client</artifactId>
-            <version>1.0.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.whirr</groupId>
-            <artifactId>whirr-core</artifactId>
-            <version>0.7.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.whirr</groupId>
-            <artifactId>whirr-hadoop</artifactId>
-            <version>0.7.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hamcrest</groupId>
-            <artifactId>hamcrest-all</artifactId>
-            <version>1.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-all</artifactId>
-            <version>1.8.5</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-configuration</groupId>
-            <artifactId>commons-configuration</artifactId>
-            <version>1.7</version>
-        </dependency>
-        <dependency>
-            <groupId>net.sf.jopt-simple</groupId>
-            <artifactId>jopt-simple</artifactId>
-            <version>3.2</version>
-        </dependency>
         <!-- Guava -->
         <dependency>
             <groupId>com.google.guava</groupId>
@@ -262,33 +186,11 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <!--skip>true</skip -->
-                    <excludes>
-                        <exclude>**/services/**</exclude>
-                        <exclude>**/gfac/**</exclude>
-                    </excludes>
+                    <skip>false</skip>
                     <forkMode>always</forkMode>
                     <failIfNoTests>false</failIfNoTests>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>copy-dependencies</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>copy-dependencies</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>target/lib</outputDirectory>
-                            <overWriteReleases>false</overWriteReleases>
-                            <overWriteSnapshots>true</overWriteSnapshots>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/eeddc5b9/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorManager.java
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorManager.java
b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorManager.java
index 15639ee..90cde3d 100644
--- a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorManager.java
+++ b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorManager.java
@@ -79,9 +79,13 @@ public class MonitorManager {
      * This is going to be useful during the startup of the launching process
      * @param monitorID
      */
-    public void addAJobToMonitor(MonitorID monitorID) {
-        runningQueue.add(monitorID);
-        runningQueue.notify();
+    public void addAJobToMonitor(MonitorID monitorID) throws AiravataMonitorException {
+        try {
+            runningQueue.put(monitorID);
+        } catch (InterruptedException e) {
+            String error = "Error while putting the job: " + monitorID.getJobID() + " the
monitor queue";
+            throw new AiravataMonitorException(error, e);
+        }
     }
 
     /**
@@ -95,37 +99,26 @@ public class MonitorManager {
      */
     public void launchMonitor() throws AiravataMonitorException {
         new Thread(){
-            public void run() {
-                try {
-                    runningQueue.wait();
-                } catch (InterruptedException e) {
-                    String error = "Error occured during launching the monitor";
-                    logger.error(error);
-                    try {
-                        throw e;
-                    } catch (InterruptedException e1) {
-                        e1.printStackTrace();
-                    }
-                }
+            public synchronized void run() {
                 if (pushMonitors.isEmpty()) {
                     if (pullMonitors.isEmpty()) {
                         logger.error("Before launching MonitorManager should have atleast
one Monitor");
                         return;
                     } else {
                         //no push monitor is configured so we launch pull monitor
-                        PushMonitor pushMonitor = pushMonitors.get(0);
-                        if(pushMonitor instanceof AMQPMonitor){
-                            ((AMQPMonitor) pushMonitor).run();
+                        PullMonitor pullMonitor = pullMonitors.get(0);
+                        try {
+                            pullMonitor.startPulling();
+                        } catch (AiravataMonitorException e) {
+                            e.printStackTrace();
                         }
                     }
                 } else {
                     // there is a push monitor configured, so we schedule the push monitor
                     // We currently support dealing with one type of monitor
-                    PullMonitor pullMonitor = pullMonitors.get(0);
-                    try {
-                        pullMonitor.startPulling();
-                    } catch (AiravataMonitorException e) {
-                        e.printStackTrace();
+                    PushMonitor pushMonitor = pushMonitors.get(0);
+                    if(pushMonitor instanceof AMQPMonitor){
+                        ((AMQPMonitor) pushMonitor).run();
                     }
 
                 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/eeddc5b9/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/AMQPMonitor.java
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/AMQPMonitor.java
b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/AMQPMonitor.java
index 2c6350c..96642bf 100644
--- a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/AMQPMonitor.java
+++ b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/AMQPMonitor.java
@@ -68,14 +68,13 @@ public class AMQPMonitor extends PushMonitor implements Runnable {
 
     }
 
-    public void run() {
+    public synchronized void run() {
         try {
             // before going to the while true mode we start unregister thread
-            UnRegisterThread unRegisterThread = new UnRegisterThread(this);
-            unRegisterThread.run();
+//            UnRegisterThread unRegisterThread = new UnRegisterThread(this);
+//            unRegisterThread.run();
 
             while (true) {
-                runningQueue.wait();
                 // we got a new job to do the monitoring
                 MonitorID take = runningQueue.take();
                 this.registerListener(take);
@@ -96,7 +95,8 @@ public class AMQPMonitor extends PushMonitor implements Runnable {
         // the Monitoring implementation (what data is required)
         checkMonitorID(monitorID);
         String channelID = CommonUtils.getChannelID(monitorID);
-
+        System.out.println("Going to start monitoring job with ID: " + monitorID.getJobID());
+        logger.info("Going to start monitoring job with ID: " + monitorID.getJobID());
         // if we already have a channel we do not create one
         if (availableChannels.get(channelID) == null) {
             //todo need to fix this rather getting it from a file
@@ -111,6 +111,7 @@ public class AMQPMonitor extends PushMonitor implements Runnable {
                 String filterString = CommonUtils.getRoutingKey(monitorID);
                 // here we queuebind to a particular user in a particular machine
                 channel.queueBind(queueName, "glue2.computing_activity", filterString);
+                System.out.println(filterString);
             } catch (IOException e) {
                 logger.error("Error creating the connection to monitor the job:" + monitorID.getJobID());
             }
@@ -198,21 +199,12 @@ public class AMQPMonitor extends PushMonitor implements Runnable {
         public synchronized void run() {
             while(true){
                 try {
-                    this.monitor.getFinishQueue().wait();
-                    if(this.monitor.getFinishQueue().isEmpty()){
-                        logger.error("Error signal came to the UnRegistering thread, so skipping");
-                    }else{
-                        Iterator<MonitorID> iterator = this.monitor.getFinishQueue().iterator();
-                        /* takes all the finished jobs at a time and unregister them */
-                        while(iterator.hasNext()){
-                            MonitorID next = iterator.next();
-                            monitor.unRegisterListener(next);
-                        }
-                    }
+                    MonitorID monitorID = this.monitor.getFinishQueue().take();
+                    monitor.unRegisterListener(monitorID);
 
-                } catch (InterruptedException e) {
+                }  catch (AiravataMonitorException e) {
                     e.printStackTrace();  //To change body of catch statement use File |
Settings | File Templates.
-                } catch (AiravataMonitorException e) {
+                } catch (InterruptedException e) {
                     e.printStackTrace();  //To change body of catch statement use File |
Settings | File Templates.
                 }
             }

http://git-wip-us.apache.org/repos/asf/airavata/blob/eeddc5b9/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/JSONMessageParser.java
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/JSONMessageParser.java
b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/JSONMessageParser.java
index 42ea2d0..0dfac7e 100644
--- a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/JSONMessageParser.java
+++ b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/JSONMessageParser.java
@@ -23,9 +23,6 @@ package org.apache.airavata.job.monitor.impl.push.amqp;
 import org.apache.airavata.job.monitor.MonitorID;
 import org.apache.airavata.job.monitor.core.MessageParser;
 import org.apache.airavata.job.monitor.state.JobStatus;
-import org.apache.hadoop.mapred.jobcontrol.Job;
-
-import javax.mail.search.MessageIDTerm;
 
 public class JSONMessageParser implements MessageParser {
     public JobStatus parseMessage(String message,MonitorID monitorID) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/eeddc5b9/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/util/CommonUtils.java
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/util/CommonUtils.java
b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/util/CommonUtils.java
index 2248ec3..a2254df 100644
--- a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/util/CommonUtils.java
+++ b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/util/CommonUtils.java
@@ -24,9 +24,9 @@ import org.apache.airavata.job.monitor.MonitorID;
 
 public class CommonUtils {
     public static String getChannelID(MonitorID monitorID) {
-        return monitorID.getUserName() + monitorID.getHost().getType().getHostName();
+        return monitorID.getUserName() + "-" + monitorID.getHost().getType().getHostName();
     }
     public static String getRoutingKey(MonitorID monitorID) {
-        return "*." + monitorID.getUserName() + monitorID.getHost().getType().getHostAddress();
+        return "*." + monitorID.getUserName() + "." + monitorID.getHost().getType().getHostAddress();
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/eeddc5b9/modules/airavata-job-monitor/src/main/resources/PBSTemplate.xslt
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/src/main/resources/PBSTemplate.xslt b/modules/airavata-job-monitor/src/main/resources/PBSTemplate.xslt
new file mode 100644
index 0000000..e4398e0
--- /dev/null
+++ b/modules/airavata-job-monitor/src/main/resources/PBSTemplate.xslt
@@ -0,0 +1,77 @@
+<!--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
+#   <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:jobName">
+#PBS -N <xsl:value-of select="ns:jobName"/>
+    </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>&#xa;</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>&#xa;</xsl:text>
+export<xsl:text>   </xsl:text><xsl:value-of select="."/>
+<xsl:text>&#xa;</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>&#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/eeddc5b9/modules/airavata-job-monitor/src/main/resources/gsissh.properties
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/src/main/resources/gsissh.properties b/modules/airavata-job-monitor/src/main/resources/gsissh.properties
new file mode 100644
index 0000000..3fdf76d
--- /dev/null
+++ b/modules/airavata-job-monitor/src/main/resources/gsissh.properties
@@ -0,0 +1,26 @@
+#
+#
+# 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.
+#
+
+###########################################################################
+# Specifies system level configurations as a key/value pairs.
+###########################################################################
+
+StrictHostKeyChecking=no
+ssh.session.timeout=360000

http://git-wip-us.apache.org/repos/asf/airavata/blob/eeddc5b9/modules/airavata-job-monitor/src/test/java/org/apache/airavata/job/monitor/SimpleMonitorTest.java
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/src/test/java/org/apache/airavata/job/monitor/SimpleMonitorTest.java
b/modules/airavata-job-monitor/src/test/java/org/apache/airavata/job/monitor/SimpleMonitorTest.java
index 4c413c6..5257cbe 100644
--- a/modules/airavata-job-monitor/src/test/java/org/apache/airavata/job/monitor/SimpleMonitorTest.java
+++ b/modules/airavata-job-monitor/src/test/java/org/apache/airavata/job/monitor/SimpleMonitorTest.java
@@ -47,17 +47,18 @@ public class SimpleMonitorTest {
     private String pbsFilePath;
     private String workingDirectory;
     private HostDescription hostDescription;
+
     @Before
     public void setUp() throws Exception {
         System.setProperty("myproxy.user", "ogce");
         System.setProperty("myproxy.password", "");
         System.setProperty("basedir", "/Users/lahirugunathilake/work/airavata/sandbox/gsissh");
-        System.setProperty("gsi.working.directory","/home/ogce");
+        System.setProperty("gsi.working.directory", "/home/ogce");
         myProxyUserName = System.getProperty("myproxy.user");
         myProxyPassword = System.getProperty("myproxy.password");
         workingDirectory = System.getProperty("gsi.working.directory");
         String pomDirectory = System.getProperty("basedir");
-
+        certificateLocation = "/Users/lahirugunathilake/Downloads/certificates";
         if (myProxyUserName == null || myProxyPassword == null || workingDirectory == null)
{
             System.out.println(">>>>>> Please run tests with my proxy user
name and password. " +
                     "E.g :- mvn clean install -Dmyproxy.user=xxx -Dmyproxy.password=xxx -Dgsi.working.directory=/path<<<<<<<");
@@ -67,7 +68,7 @@ public class SimpleMonitorTest {
         monitorManager = new MonitorManager();
         AMQPMonitor amqpMonitor = new
                 AMQPMonitor(monitorManager.getMonitorPublisher(),
-                monitorManager.getRunningQueue(),monitorManager.getFinishQueue());
+                monitorManager.getRunningQueue(), monitorManager.getFinishQueue());
         try {
             monitorManager.addPushMonitor(amqpMonitor);
             monitorManager.launchMonitor();
@@ -76,28 +77,28 @@ public class SimpleMonitorTest {
         }
 
         hostDescription = new HostDescription(GsisshHostType.type);
-        hostDescription.getType().setHostAddress("trestles.sdsc.edu");
-        hostDescription.getType().setHostName("gsissh-trestles");
+        hostDescription.getType().setHostAddress("gordon.sdsc.xsede.org");
+        hostDescription.getType().setHostName("gsissh-gordon");
     }
 
     @Test
     public void testAMQPMonitor() throws SSHApiException {
         /* now have to submit a job to some machine and add that job to the queue */
-// Create authentication
-        GSIAuthenticationInfo authenticationInfo
+//Create authentication
+      /*  GSIAuthenticationInfo authenticationInfo
                 = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "myproxy.teragrid.org",
                 7512, 17280000, certificateLocation);
-
-        // Server info
+//
+//        // Server info
         ServerInfo serverInfo = new ServerInfo("ogce", "trestles.sdsc.edu");
-
-
+//
+//
         Cluster pbsCluster = new PBSCluster(serverInfo, authenticationInfo, "/opt/torque/bin/");
-
-
-        // Execute command
+//
+//
+//        // Execute command
         System.out.println("Target PBS file path: " + workingDirectory);
-        // constructing the job object
+//        // constructing the job object
         JobDescriptor jobDescriptor = new JobDescriptor();
         jobDescriptor.setWorkingDirectory(workingDirectory);
         jobDescriptor.setShellName("/bin/bash");
@@ -113,11 +114,22 @@ public class SimpleMonitorTest {
         jobDescriptor.setMaxWallTime("60");
         jobDescriptor.setAcountString("sds128");
         List<String> inputs = new ArrayList<String>();
+        jobDescriptor.setOwner("ogce");
         inputs.add("Hello World");
         jobDescriptor.setInputValues(inputs);
-        //finished construction of job object
+//        //finished construction of job object
         System.out.println(jobDescriptor.toXML());
-        String jobID = pbsCluster.submitBatchJob(jobDescriptor);
-        monitorManager.addAJobToMonitor(new MonitorID(hostDescription, jobID, "ogce"));
+//        String jobID = pbsCluster.submitBatchJob(jobDescriptor);   */
+
+        try {
+            monitorManager.addAJobToMonitor(new MonitorID(hostDescription, "gordon.sdsc.xsede.org",
"ogce"));
+        } catch (AiravataMonitorException e) {
+            e.printStackTrace();
+        }
+        try {
+            Thread.sleep(100000000);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
     }
 }


Mime
View raw message