gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r23216 - in gnunet-planetlab/gplmt: . contrib contrib/taskl


From: gnunet
Subject: [GNUnet-SVN] r23216 - in gnunet-planetlab/gplmt: . contrib contrib/tasklists contrib/tasklists/tests gplmt
Date: Tue, 14 Aug 2012 09:58:08 +0200

Author: wachs
Date: 2012-08-14 09:58:08 +0200 (Tue, 14 Aug 2012)
New Revision: 23216

Added:
   gnunet-planetlab/gplmt/contrib/tasklists/test_run_per_host_tasks.xml
   gnunet-planetlab/gplmt/contrib/tasklists/tests/
   gnunet-planetlab/gplmt/contrib/tasklists/tests/test_run_per_host.cmds
Modified:
   gnunet-planetlab/gplmt/README
   gnunet-planetlab/gplmt/contrib/tasklist_schema.xsd
   gnunet-planetlab/gplmt/contrib/tasklists/install_buildslave_fc8.xml
   gnunet-planetlab/gplmt/contrib/tumple_gnunet_deployment.conf
   gnunet-planetlab/gplmt/gplmt/Tasks.py
   gnunet-planetlab/gplmt/gplmt/Worker.py
Log:
- changes


Modified: gnunet-planetlab/gplmt/README
===================================================================
--- gnunet-planetlab/gplmt/README       2012-08-13 19:55:48 UTC (rev 23215)
+++ gnunet-planetlab/gplmt/README       2012-08-14 07:58:08 UTC (rev 23216)
@@ -148,6 +148,8 @@
 root <tasklist> containing the tasks to execute. The tasks are 
 sequentially executed. A task is defined using the <task> element. 
 
+A ta
+
 Here we have an example a tasklist first obtaining the current date and 
 and the listing the contents of the tmp directory:
 

Modified: gnunet-planetlab/gplmt/contrib/tasklist_schema.xsd
===================================================================
--- gnunet-planetlab/gplmt/contrib/tasklist_schema.xsd  2012-08-13 19:55:48 UTC 
(rev 23215)
+++ gnunet-planetlab/gplmt/contrib/tasklist_schema.xsd  2012-08-14 07:58:08 UTC 
(rev 23216)
@@ -8,6 +8,7 @@
       <xs:element name="sequence" type="sequence" />
       <xs:element name="parallel" type="parallel" />
       <xs:element name="run" type="run" />
+      <xs:element name="run_per_host" type="run_per_host" />      
       <xs:element name="monitor" type="monitor" />
       <xs:element name="put" type="put" />
       <xs:element name="get" type="get" />
@@ -23,6 +24,7 @@
       <xs:element name="sequence" type="sequence" />
       <xs:element name="parallel" type="parallel" />
       <xs:element name="run" type="run" />
+      <xs:element name="run_per_host" type="run_per_host" />      
       <xs:element name="monitor" type="monitor" />
       <xs:element name="put" type="put" />
       <xs:element name="get" type="get" />
@@ -37,6 +39,7 @@
       <xs:element name="sequence" type="sequence" />
       <xs:element name="parallel" type="parallel" />
       <xs:element name="run" type="run" />
+      <xs:element name="run_per_host" type="run_per_host" />
       <xs:element name="monitor" type="monitor" />
       <xs:element name="put" type="put" />
       <xs:element name="get" type="get" />
@@ -59,6 +62,20 @@
   <xs:attribute name="enabled" type="xs:boolean"/>
 </xs:complexType>
 
+<xs:complexType name="run_per_host">
+  <xs:sequence>
+    <xs:element name="command_file" type="xs:string"/>
+    <xs:element name="output_prefix" type="xs:string"/>
+    <xs:element name="timeout" type="xs:integer"/>
+    <xs:element name="expected_return_code"  type="xs:integer"/>
+    <xs:element name="expected_output" type="xs:string"/>
+    <xs:element name="stop_on_fail" type="xs:boolean"/>
+  </xs:sequence>
+  <xs:attribute name="id" type="xs:integer"/>  
+  <xs:attribute name="name" type="xs:string"/>
+  <xs:attribute name="enabled" type="xs:boolean"/>
+</xs:complexType>
+
 <xs:complexType name="monitor">
   <xs:sequence>
     <xs:element name="command" type="xs:string"/>

Modified: gnunet-planetlab/gplmt/contrib/tasklists/install_buildslave_fc8.xml
===================================================================
--- gnunet-planetlab/gplmt/contrib/tasklists/install_buildslave_fc8.xml 
2012-08-13 19:55:48 UTC (rev 23215)
+++ gnunet-planetlab/gplmt/contrib/tasklists/install_buildslave_fc8.xml 
2012-08-14 07:58:08 UTC (rev 23216)
@@ -20,7 +20,7 @@
           <timeout>0</timeout> 
           <expected_return_code>0</expected_return_code>
           <expected_output></expected_output>
-          <stop_on_fail>false</stop_on_fail>
+          <stop_on_fail>true</stop_on_fail>
     </run>
        <run id="1" name="Install python distribute">
           <command>curl http://python-distribute.org/distribute_setup.py | 
sudo python</command> 
@@ -28,7 +28,7 @@
           <timeout>0</timeout> 
           <expected_return_code>0</expected_return_code>
           <expected_output></expected_output>
-          <stop_on_fail>false</stop_on_fail>
+          <stop_on_fail>true</stop_on_fail>
     </run>
        <run id="2" name="Download zope.interface 3.8.0">
           <command>mkdir ~/buildslave; cd ~/buildslave; wget</command> 
@@ -36,7 +36,7 @@
           <timeout>0</timeout> 
           <expected_return_code>0</expected_return_code>
           <expected_output></expected_output>
-          <stop_on_fail>false</stop_on_fail>
+          <stop_on_fail>true</stop_on_fail>
     </run>
     <run id="3" name="Unpack zope.interface 3.8.0">
           <command>cd ~/buildslave; tar xfvz </command> 
@@ -44,7 +44,7 @@
           <timeout>0</timeout> 
           <expected_return_code>0</expected_return_code>
           <expected_output></expected_output>
-          <stop_on_fail>false</stop_on_fail>
+          <stop_on_fail>true</stop_on_fail>
     </run>      
     <run id="4" name="Install zope.interface 3.8.0">
           <command>cd ~/buildslave/zope.interface-3.8.0/; sudo python 
</command> 
@@ -52,7 +52,7 @@
           <timeout>0</timeout> 
           <expected_return_code>0</expected_return_code>
           <expected_output></expected_output>
-          <stop_on_fail>false</stop_on_fail>
+          <stop_on_fail>true</stop_on_fail>
     </run>
     </sequence>
     
@@ -63,7 +63,7 @@
           <timeout>0</timeout> 
           <expected_return_code>0</expected_return_code>
           <expected_output></expected_output>
-          <stop_on_fail>false</stop_on_fail>
+          <stop_on_fail>true</stop_on_fail>
     </run>
     <run id="6" name="Unpack buildslave">
           <command>cd ~/buildslave; tar xvfz </command> 
@@ -71,7 +71,7 @@
           <timeout>0</timeout> 
           <expected_return_code>0</expected_return_code>
           <expected_output></expected_output>
-          <stop_on_fail>false</stop_on_fail>
+          <stop_on_fail>true</stop_on_fail>
     </run>
      <run id="7" name="Install buildslave">
           <command>cd ~/buildslave/buildbot-slave-0.8.6p1; sudo python 
setup.py </command> 
@@ -79,7 +79,7 @@
           <timeout>0</timeout> 
           <expected_return_code>0</expected_return_code>
           <expected_output></expected_output>
-          <stop_on_fail>false</stop_on_fail>
+          <stop_on_fail>true</stop_on_fail>
     </run>        
     </sequence>            
        

Added: gnunet-planetlab/gplmt/contrib/tasklists/test_run_per_host_tasks.xml
===================================================================
--- gnunet-planetlab/gplmt/contrib/tasklists/test_run_per_host_tasks.xml        
                        (rev 0)
+++ gnunet-planetlab/gplmt/contrib/tasklists/test_run_per_host_tasks.xml        
2012-08-14 07:58:08 UTC (rev 23216)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<tasklist name="Test run_per_host tasks" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:noNamespaceSchemaLocation="../tasklist_schema.xsd">
+       <run id="0" name="check peer">
+               <!-- Check if peer is working -->
+        <command>sudo date</command> 
+        <arguments></arguments> 
+        <timeout>10</timeout>
+        <expected_return_code>0</expected_return_code>
+        <expected_output>2012</expected_output>
+        <stop_on_fail>true</stop_on_fail>
+       </run> 
+       <run_per_host id="1" name="get hostname">
+               <command_file>./tests/test_run_per_host.cmds</command_file>
+               <output_prefix>./tests/result_</output_prefix>
+        <timeout>10</timeout>
+        <expected_return_code>0</expected_return_code>
+        <expected_output></expected_output>
+        <stop_on_fail>true</stop_on_fail>              
+       </run_per_host> 
+</tasklist>

Added: gnunet-planetlab/gplmt/contrib/tasklists/tests/test_run_per_host.cmds
===================================================================
--- gnunet-planetlab/gplmt/contrib/tasklists/tests/test_run_per_host.cmds       
                        (rev 0)
+++ gnunet-planetlab/gplmt/contrib/tasklists/tests/test_run_per_host.cmds       
2012-08-14 07:58:08 UTC (rev 23216)
@@ -0,0 +1,3 @@
+# Format: <hostname>;<cmd>
+# Default command if hostname is not included : <empty>;<default cmd>
+;hostname -f
\ No newline at end of file

Modified: gnunet-planetlab/gplmt/contrib/tumple_gnunet_deployment.conf
===================================================================
--- gnunet-planetlab/gplmt/contrib/tumple_gnunet_deployment.conf        
2012-08-13 19:55:48 UTC (rev 23215)
+++ gnunet-planetlab/gplmt/contrib/tumple_gnunet_deployment.conf        
2012-08-14 07:58:08 UTC (rev 23216)
@@ -4,8 +4,8 @@
 
 # Which notification mechanism to use: 
 # simple: print messages to stdout
-notification = simple
-#notification = result
+#notification = simple
+notification = result
 
 [planetlab]
 slice = tumple_gnunet_deployment

Modified: gnunet-planetlab/gplmt/gplmt/Tasks.py
===================================================================
--- gnunet-planetlab/gplmt/gplmt/Tasks.py       2012-08-13 19:55:48 UTC (rev 
23215)
+++ gnunet-planetlab/gplmt/gplmt/Tasks.py       2012-08-14 07:58:08 UTC (rev 
23216)
@@ -35,7 +35,7 @@
 
 glogger = None
 
-supported_operations = ["run", "monitor", "get", "put"]
+supported_operations = ["run", "monitor", "get", "put", "run_per_host"]
 
 class Taskresult:
     unspecified = -1
@@ -53,6 +53,7 @@
     monitor=2
     get=3
     put=4
+    run_per_host=5
 
 class Task:
     def __init__(self):
@@ -68,6 +69,8 @@
         self.set = None
         self.src = None
         self.dest = None
+        self.command_file = None
+        self.output_prefix = None
     def log (self):
         glogger.log ("Task " + str(self.id) + ": " + self.name)
     def check (self):
@@ -84,6 +87,9 @@
             if ((self.id == -1) or (self.name == "") or 
                 (self.src == None) or (self.dest == None)):
                 return False            
+        if (self.type == Operation.run_per_host):                   
+            if ((self.id == -1) or (self.name == "") or (self.command_file == 
"")):
+                return False                    
         return True
                         
 class Taskset:
@@ -121,10 +127,16 @@
         t.type = Operation.get
     elif (elem.tag == "put"):       
         t.type = Operation.put
+    elif (elem.tag == "run_per_host"):       
+        t.type = Operation.run_per_host        
     else:
         t.type = Operation.none
         
     for child in elem:
+        if ((child.tag == "command_file") and (child.text != None)):
+            t.command_file = child.text
+        if ((child.tag == "output_prefix") and (child.text != None)):
+            t.output_prefix = child.text
         if ((child.tag == "command") and (child.text != None)):
             t.command = child.text
         if ((child.tag == "arguments") and (child.text != None)):

Modified: gnunet-planetlab/gplmt/gplmt/Worker.py
===================================================================
--- gnunet-planetlab/gplmt/gplmt/Worker.py      2012-08-13 19:55:48 UTC (rev 
23215)
+++ gnunet-planetlab/gplmt/gplmt/Worker.py      2012-08-14 07:58:08 UTC (rev 
23216)
@@ -57,6 +57,10 @@
         self.threadID = threadID
         self.node = node
         self.tasks = tasks
+
+    def exec_run_per_host (self, task, transport):  
+        print "HERE!"
+        
     def exec_run (self, task, transport):
         try:
             channel = transport.open_session()
@@ -236,8 +240,11 @@
                 elif (task.type == Tasks.Operation.get):
                     result = self.exec_get (task, transport)
                     g_notifications.task_completed (self.node, task, result)
+                elif (task.type == Tasks.Operation.run_per_host):
+                    result = self.exec_run_per_host (task, transport)
+                    g_notifications.task_completed (self.node, task, result)   
                 
                 else:
-                    print "FAIL"                    
+                    print "UNSUPPORTED OPERATION!"                    
             elif (task.__class__.__name__ == "Taskset"):
                 g_logger.log (self.node + " : Running task set")
             if ((task.stop_on_fail == True) and (result != 
Tasks.Taskresult.success)):




reply via email to

[Prev in Thread] Current Thread [Next in Thread]