Author: eallen
Date: 2010-07-29 12:44:00 -0400 (Thu, 29 Jul 2010)
New Revision: 4165
Modified:
mgmt/newdata/cumin/python/cumin/grid/submission.py
mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings
Log:
Added DAG submission to Grid User. Will need to be tweaked once we know the correct ad
values to submit.
Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-07-28 21:58:57 UTC (rev 4164)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-07-29 16:44:00 UTC (rev 4165)
@@ -402,9 +402,6 @@
return "Extra attributes"
class SubmissionVMAdd(SubmissionAdd):
- def __init__(self, app, frame):
- super(SubmissionVMAdd, self).__init__(app, frame)
-
def get_add_form(self, app):
return SubmissionAddVMForm(app, self.name, self)
@@ -460,3 +457,49 @@
vm_ads.append("executable=%s" % disk)
return "\n".join(vm_ads)
+
+class SubmissionDagAdd(SubmissionAdd):
+ def __init__(self, app, frame):
+ super(SubmissionDagAdd, self).__init__(app, frame)
+
+ def get_add_form(self, app):
+ return SubmissionAddDagForm(app, self.name, self)
+
+ def get_title(self, session):
+ return "Create DAG submission"
+
+class SubmissionAddDagForm(SubmissionAddForm):
+ def add_fields(self, app):
+ self.dag = self.DagField(app, "dag")
+ self.dag.input.size = 50
+ self.dag.required = True
+ self.dag.help = "DAG descriptor file location"
+ self.add_field(self.dag)
+
+ self.universe = Attribute(app, "universe")
+ self.universe.default = "scheduler"
+ self.add_attribute(self.universe)
+
+ 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.stderr = Attribute(app, "stderr")
+ self.add_attribute(self.stderr)
+
+ class DagField(StringField):
+ def render_title(self, session):
+ return "DAG"
+
+ class DagAttributes(Attribute):
+ def get(self, session):
+ return "dag=%s" % self.widget.dag.get(session)
Modified: mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-07-28 21:58:57 UTC (rev
4164)
+++ mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-07-29 16:44:00 UTC (rev
4165)
@@ -50,6 +50,8 @@
def __init__(self, app, name, user):
super(OverviewFrame, self).__init__(app, name)
+ # XXX temp hack. these are
+ # not used but needed for SubmissionAdd ObjectTask
self.tasks = list()
self.id = Attribute(app, "id")
self.id.default = 0
@@ -69,9 +71,13 @@
self.add_child(self.stats)
task = SubmissionVMAdd(app, frame)
- self.link = TaskLink(app, "submissionvmadd", task)
- self.add_child(self.link)
+ self.vm_link = TaskLink(app, "submissionvmadd", task)
+ self.add_child(self.vm_link)
+ task = SubmissionDagAdd(app, frame)
+ self.dag_link = TaskLink(app, "submissiondagadd", task)
+ self.add_child(self.dag_link)
+
class SubmissionsFrame(CuminFrame):
def __init__(self, app, name, user):
super(SubmissionsFrame, self).__init__(app, name)
Modified: mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings 2010-07-28 21:58:57 UTC (rev
4164)
+++ mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings 2010-07-29 16:44:00 UTC (rev
4165)
@@ -18,18 +18,22 @@
vertical-align: middle;
}
-div.usergrid.heading > a {
+div.usergrid.heading > ul {
float: right;
+ list-style-type: none;
}
[OverviewView.html]
<div class="usergrid heading">
+ <ul>
+ <li>{submissionvmadd}</li>
+ <li>{submissiondagadd}</li>
+ </ul><div style="clear:both;"></div>
<h2>
<img src="resource?name=job-20.png"/>
Jobs
</h2>
- {submissionvmadd}
</div>
<table class="twocol OverviewView">