[rhmessaging-commits] rhmessaging commits: r4174 - mgmt/newdata/cumin/python/cumin/grid.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Fri Jul 30 14:57:54 EDT 2010


Author: eallen
Date: 2010-07-30 14:57:53 -0400 (Fri, 30 Jul 2010)
New Revision: 4174

Modified:
   mgmt/newdata/cumin/python/cumin/grid/submission.py
Log:
Changes to VM submission jobads to match example

Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py	2010-07-30 18:11:03 UTC (rev 4173)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py	2010-07-30 18:57:53 UTC (rev 4174)
@@ -115,6 +115,7 @@
                   stdin=None,
                   stdout=None,
                   stderr=None,
+                  usrlog=None,
                   attrs={}):
         ad = dict()
 
@@ -133,6 +134,10 @@
         put("Iwd", iwd)
         put("Requirements", requirements)
         put("JobUniverse", universe)
+        put("In", stdin)
+        put("Out", stdout)
+        put("Err", stderr)
+        put("UserLog", usrlog)
 
         for name, value in attrs.items():
             put(name, value)
@@ -163,12 +168,15 @@
         self.description.help = "This text will identify the submission"
         self.add_field(self.description)
 
-        self.directory = self.WorkingDirectoryField(app, "directory")
-        self.directory.input.size = 50
-        self.directory.required = True
-        self.directory.help = "Run the process in this directory"
-        self.add_field(self.directory)
+        self.add_fields(app)
 
+    def add_fields(self, app):
+        self.command = self.CommandField(app, "command")
+        self.command.input.columns = 50
+        self.command.required = True
+        self.command.help = "The path to the executable and any arguments"
+        self.add_field(self.command)
+
         self.requirements = self.RequirementsField(app, "requirements")
         self.requirements.input.columns = 50
         self.requirements.required = True
@@ -176,15 +184,12 @@
             "this submission will run"
         self.add_field(self.requirements)
 
-        self.add_fields(app)
+        self.directory = self.WorkingDirectoryField(app, "directory")
+        self.directory.input.size = 50
+        self.directory.required = True
+        self.directory.help = "Run the process in this directory"
+        self.add_field(self.directory)
 
-    def add_fields(self, app):
-        self.command = self.CommandField(app, "command")
-        self.command.input.columns = 50
-        self.command.required = True
-        self.command.help = "The path to the executable and any arguments"
-        self.add_field(self.command)
-
         self.universe = self.UniverseField(app, "universe")
         self.add_extra_field(self.universe)
 
@@ -203,6 +208,11 @@
         self.stderr.help = "Send error output to this file"
         self.add_extra_field(self.stderr)
 
+        self.usrlog = self.UsrLogField(app, "usrlog")
+        self.usrlog.input.size = 50
+        self.usrlog.help = "User log file"
+        self.add_extra_field(self.usrlog)
+
         #self.options = self.OptionsField(app, "options")
         #self.add_extra_field(self.options)
 
@@ -225,6 +235,7 @@
             stdin = self.stdin.get(session)
             stdout = self.stdout.get(session)
             stderr = self.stderr.get(session)
+            usrlog = self.usrlog.get(session)
 
             tokens = shlex.split(command)
 
@@ -242,6 +253,7 @@
                              stdin=stdin,
                              stdout=stdout,
                              stderr=stderr,
+                             usrlog=usrlog,
                              attrs=attrs)
 
             self.task.exit_with_redirect(session)
@@ -379,6 +391,10 @@
         def render_title(self, session):
             return "Standard error"
 
+    class UsrLogField(StringField):
+        def render_title(self, session):
+            return "User Log"
+
     # class OptionsField(CheckboxField):
     #     def __init__(self, app, name):
     #         super(SubmissionAddForm.OptionsField, self).__init__(app, name)
@@ -408,6 +424,27 @@
     def get_title(self, session):
         return "Create VM submission"
 
+    def do_invoke(self, invoc, scheduler,
+                  description,
+                  executable,
+                  arguments=None,
+                  requirements=None,
+                  universe=None,
+                  iwd=None,
+                  stdin=None,
+                  stdout=None,
+                  stderr=None,
+                  usrlog=None,
+                  attrs={}):
+
+        cmd = "%s %s" % (executable, arguments)
+        arguments = None
+        super(SubmissionVMAdd, self).do_invoke(invoc, scheduler,
+                description, cmd, arguments,
+                requirements, universe, iwd,
+                stdin, stdout, stderr, usrlog,
+                attrs)
+
 class SubmissionAddVMForm(SubmissionAddForm):
     def add_fields(self, app):
         self.disk = self.DiskField(app, "disk")
@@ -416,17 +453,28 @@
         self.disk.help = "VM disk img file location"
         self.add_field(self.disk)
 
+        self.requirements = self.RequirementsField(app, "requirements")
+        self.requirements.input.columns = 50
+        self.requirements.required = True
+        self.requirements.help = "Attributes controlling where and when " + \
+            "this submission will run"
+        self.add_field(self.requirements)
+
         self.universe = Attribute(app, "universe")
-        self.universe.default = "vm"
+        self.universe.default = self.task.UNIVERSE["VM"]
         self.add_attribute(self.universe)
 
         self.attributes_ = self.VMAttributes(app, "attributes")
         self.add_attribute(self.attributes_)
 
-        self.command = self.Command(app, "command")
-        self.command.default = ""
+        self.command = Attribute(app, "command")
+        self.command.default = "QMF Submitted VM"
         self.add_attribute(self.command)
 
+        self.directory = Attribute(app, "directory")
+        self.directory.default = "/tmp"
+        self.add_attribute(self.directory)
+
         self.stdin = Attribute(app, "stdin")
         self.add_attribute(self.stdin)
 
@@ -436,25 +484,23 @@
         self.stderr = Attribute(app, "stderr")
         self.add_attribute(self.stderr)
 
+        self.usrlog = Attribute(app, "usrlog")
+        self.add_attribute(self.usrlog)
+
     class DiskField(StringField):
         def render_title(self, session):
             return "Disk"
 
-    class Command(Attribute):
-        def get(self, session):
-            return self.widget.disk.get(session)
-
     class VMAttributes(Attribute):
         def get(self, session):
             vm_ads = list()
-            vm_ads.append("vm_type=kvm")
-            vm_ads.append("vm_networking=false")
-            vm_ads.append("vm_memory=128")
-            vm_ads.append("xen_kernal=included")
+            vm_ads.append("ShouldTransferFiles=NEVER")
+            vm_ads.append("JobVMType=kvm")
+            vm_ads.append("JobVMMemory=512")
+            vm_ads.append("VMPARAM_Xen_Kernel=included")
 
             disk = self.widget.disk.get(session)
-            vm_ads.append("xan_disk=%s:hda:w" % disk)
-            vm_ads.append("executable=%s" % disk)
+            vm_ads.append("VMPARAM_Xen_Disk=%s:hda:w" % disk)
 
             return "\n".join(vm_ads)
 
@@ -476,6 +522,13 @@
         self.dag.help = "DAG descriptor file location"
         self.add_field(self.dag)
 
+        self.requirements = self.RequirementsField(app, "requirements")
+        self.requirements.input.columns = 50
+        self.requirements.required = True
+        self.requirements.help = "Attributes controlling where and when " + \
+            "this submission will run"
+        self.add_field(self.requirements)
+
         self.universe = Attribute(app, "universe")
         self.universe.default = "scheduler"
         self.add_attribute(self.universe)
@@ -483,23 +536,62 @@
         self.attributes_ = self.DagAttributes(app, "attributes")
         self.add_attribute(self.attributes_)
 
-        self.command = Attribute(app, "command")
-        self.command.default = "dag"
-        self.add_attribute(self.command)
-
         self.stdin = Attribute(app, "stdin")
         self.add_attribute(self.stdin)
 
-        self.stdout = Attribute(app, "stdout")
-        self.add_attribute(self.stdout)
+        self.command = self.DagCommand(app, "command")
+        self.add_attribute(self.command)
 
-        self.stderr = Attribute(app, "stderr")
-        self.add_attribute(self.stderr)
+        self.stdout = self.StdoutField(app, "stdout")
+        self.stdout.input.size = 50
+        self.stdout.help = "Send process output to this file"
+        self.stdout.input.param.default = "diamond.dag.lib.out"
+        self.add_extra_field(self.stdout)
 
+        self.stderr = self.StderrField(app, "stderr")
+        self.stderr.input.size = 50
+        self.stderr.help = "Send error output to this file"
+        self.stderr.input.param.default = "diamond.dag.lib.err"
+        self.add_extra_field(self.stderr)
+
+        self.usrlog = self.UsrLogField(app, "usrlog")
+        self.usrlog.input.size = 50
+        self.usrlog.help = "User Log File"
+        self.usrlog.input.param.default = "diamond.dag.dagman.log"
+        self.add_extra_field(self.usrlog)
+
+        self.condor = self.CondorVersionField(app, "cv")
+        self.condor.required = True
+        self.condor.input.size = 50
+        self.condor.help = "Condor Version"
+        self.condor.input.param.default = "'7.4.3' 'Mar' '16' '2010' 'BuildID:' 'RH-7.4.3-0.5.el5' 'PRE-RELEASE'"
+        self.add_extra_field(self.condor)
+
     class DagField(StringField):
         def render_title(self, session):
             return "DAG"
 
+    class CondorVersionField(StringField):
+        def render_title(self, session):
+            return "Condor Version"
+
+    class DagCommand(Attribute):
+        def get(self, session):
+            dag = self.widget.dag.get(session)
+            condor = self.widget.condor.get(session)
+            args = """-f -l . -Debug 3 -Lockfile diamond.dag.lock -AutoRescue 1 
+            -DoRescueFrom 0 -Dag diamond.dag -CsdVersion $CondorVersion:' %s ' %s"""
+
+            cmd = "/usr/bin/condor_dagman"
+            return "%s %s" % (cmd, args % (condor, dag))
+
     class DagAttributes(Attribute):
         def get(self, session):
-            return "dag=%s" % self.widget.dag.get(session)
+            ads = list()
+            ads.append("getenv=True")
+            ads.append("remove_kill_sig=SIGUSR1")
+            ads.append("on_exit_remove=( ExitSignal =?= 11 || (ExitCode =!= \
+                        UNDEFINED && ExitCode>=0 && ExitCode <= 2))")
+            ads.append("environment=_CONDOR_DAGMAN_LOG=diamond.dag.dagman.out;_CONDOR_MAX_DAGMAN_LOG=0")
+
+            return "\n".join(ads)



More information about the rhmessaging-commits mailing list