r5254 - trunk/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2012-03-19 19:51:28 +0000 (Mon, 19 Mar 2012)
New Revision: 5254
Modified:
trunk/cumin/python/cumin/widgets.py
trunk/cumin/python/cumin/widgets.strings
Log:
For BZ 768298: Adding the list of supported browsers to the "About" page.
Modified: trunk/cumin/python/cumin/widgets.py
===================================================================
--- trunk/cumin/python/cumin/widgets.py 2012-03-19 16:53:45 UTC (rev 5253)
+++ trunk/cumin/python/cumin/widgets.py 2012-03-19 19:51:28 UTC (rev 5254)
@@ -1617,6 +1617,8 @@
super(AboutFrame, self).__init__(app, name)
content = AboutContent(app, "about_content")
self.add_child(content)
+ browsers = AboutSupportedBrowsers(app, "browsers")
+ self.add_child(browsers)
def render_title(self, session):
return "About the console"
@@ -1627,7 +1629,23 @@
self.about = AboutFrame(app, "about")
self.add_tab(self.about)
+
+class AboutSupportedBrowsers(Widget):
+ def __init__(self, app, name):
+ super(AboutSupportedBrowsers, self).__init__(app, name)
+ self.browsers = ["Firefox 3.6+", \
+ "Internet Explorer 7+", \
+ "Chrome 5.0+", \
+ "Safari 5+"]
+
+ def render_browser_list(self, session):
+ browser_list_items = ""
+ for browser in self.browsers:
+ browser_list_items += "<li class='browseritem'>%s" % browser
+
+ return browser_list_items
+
class AboutContent(Widget):
def __init__(self, app, name):
super(AboutContent, self).__init__(app, name)
Modified: trunk/cumin/python/cumin/widgets.strings
===================================================================
--- trunk/cumin/python/cumin/widgets.strings 2012-03-19 16:53:45 UTC (rev 5253)
+++ trunk/cumin/python/cumin/widgets.strings 2012-03-19 19:51:28 UTC (rev 5254)
@@ -853,6 +853,17 @@
{version}
</div>
+[AboutSupportedBrowsers.css]
+.browseritem {
+ margin-left:30px;
+}
+
+[AboutSupportedBrowsers.html]
+<div>
+<h3>Supported Browsers</h3>
+{browser_list}
+</div>
+
[PageableFilteredSelect.html]
<script type="text/javascript">
//<![CDATA[
12 years, 1 month
r5253 - in trunk: cumin/python/cumin/grid wooly/python/wooly
by croberts@fedoraproject.org
Author: croberts
Date: 2012-03-19 16:53:45 +0000 (Mon, 19 Mar 2012)
New Revision: 5253
Modified:
trunk/cumin/python/cumin/grid/submission.py
trunk/wooly/python/wooly/forms.py
trunk/wooly/python/wooly/forms.strings
Log:
Addressing BZ 765894 by adding a new "LabelFormField" class that can be used to display helpful notes or other text on a form without requiring an input of any sort. This is used to display a note on the VM job submission form indicating that KVM is the default VM job type.
Modified: trunk/cumin/python/cumin/grid/submission.py
===================================================================
--- trunk/cumin/python/cumin/grid/submission.py 2012-03-19 12:01:47 UTC (rev 5252)
+++ trunk/cumin/python/cumin/grid/submission.py 2012-03-19 16:53:45 UTC (rev 5253)
@@ -18,7 +18,7 @@
from wooly import Attribute, Parameter
from wooly.forms import StringField, ScalarField, FormError, OptionInputSet,\
- MultilineStringField, FormField, IntegerField
+ MultilineStringField, FormField, IntegerField, LabelFormField
from wooly.parameters import IntegerParameter
log = logging.getLogger("cumin.grid.submission")
@@ -738,6 +738,9 @@
self.image.required = True
self.add_field(self.image)
+ self.note = self.LabelField(app, "kvmnote")
+ self.add_field(self.note)
+
self.memory = self.MemoryField(app, "memory")
self.memory.required = True
self.add_extra_field(self.memory)
@@ -750,7 +753,7 @@
self.attrs = JobAttributesField(app, "attrs")
self.add_extra_field(self.attrs)
-
+
def process_display(self, session):
self.scheduler.validate(session)
self.memory.set(session, self.app.form_defaults.request_memory_vm)
@@ -778,6 +781,12 @@
self.task.exit_with_redirect(session, scheduler)
+ class LabelField(LabelFormField):
+ ''' this is just text that appears in place of actual form fields '''
+ def __init__(self, app, name):
+ super(VmJobSubmitForm.LabelField, self).__init__(app, name)
+ self.title = "Note: The default VM job type is KVM."
+
class ImageField(StringField):
def render_title(self, session):
return "Image location"
Modified: trunk/wooly/python/wooly/forms.py
===================================================================
--- trunk/wooly/python/wooly/forms.py 2012-03-19 12:01:47 UTC (rev 5252)
+++ trunk/wooly/python/wooly/forms.py 2012-03-19 16:53:45 UTC (rev 5253)
@@ -363,6 +363,14 @@
def render_help(self, session, *args):
return self.help
+
+class LabelFormField(FormField):
+ def __init__(self, app, name):
+ super(LabelFormField, self).__init__(app, name)
+ self.title = ""
+
+ def render_title(self, session, *args):
+ return self.title
class FormFieldSet(Widget):
def __init__(self, app, name):
Modified: trunk/wooly/python/wooly/forms.strings
===================================================================
--- trunk/wooly/python/wooly/forms.strings 2012-03-19 12:01:47 UTC (rev 5252)
+++ trunk/wooly/python/wooly/forms.strings 2012-03-19 16:53:45 UTC (rev 5253)
@@ -161,6 +161,18 @@
<td>{inputs}</td>
</tr>
+[LabelFormField.css]
+.labeltext {
+ font-size:0.8em;
+}
+
+[LabelFormField.html]
+<tr id="{id}">
+ <td colspan="2">
+ <div class="labeltext">{title}</div>
+ </td>
+</tr>
+
[FormFieldSet.css]
table.FormFieldSet {
width: 100%;
12 years, 1 month
r5251 - trunk/cumin/model
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-03-16 18:21:46 +0000 (Fri, 16 Mar 2012)
New Revision: 5251
Modified:
trunk/cumin/model/condor.xml
Log:
Make Suspended and TransferringOutput fields optional for backward compatibility
Modified: trunk/cumin/model/condor.xml
===================================================================
--- trunk/cumin/model/condor.xml 2012-03-15 18:25:09 UTC (rev 5250)
+++ trunk/cumin/model/condor.xml 2012-03-16 18:21:46 UTC (rev 5251)
@@ -830,8 +830,8 @@
<statistic name="Removed" type="count32"/>
<statistic name="Completed" type="count32"/>
<statistic name="Held" type="count32"/>
- <statistic name="TransferringOutput" type="count32"/>
- <statistic name="Suspended" type="count32"/>
+ <statistic name="TransferringOutput" type="count32" optional="y"/>
+ <statistic name="Suspended" type="count32" optional="y"/>
<!-- summary info -->
<method name="GetJobSummaries">
12 years, 1 month
r5250 - trunk/sage/python/sage
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-03-15 18:25:09 +0000 (Thu, 15 Mar 2012)
New Revision: 5250
Modified:
trunk/sage/python/sage/util.py
Log:
The parse_URL utility routine needs to handle empty hoststring.
Modified: trunk/sage/python/sage/util.py
===================================================================
--- trunk/sage/python/sage/util.py 2012-03-14 20:30:47 UTC (rev 5249)
+++ trunk/sage/python/sage/util.py 2012-03-15 18:25:09 UTC (rev 5250)
@@ -241,8 +241,9 @@
^ (?: ([^:/@]+)://)? (?: ([^:/@]+) (?: / ([^:/@]+) )? @)? ([^@:/]+) (?: :([0-9]+))? (?: / (.*))?$
""", re.X)
- scheme = user = password = host = port = path = None
- match = RE.match(hoststring)
+ match = scheme = user = password = host = port = path = None
+ if hoststring is not None:
+ match = RE.match(hoststring)
if match is not None:
scheme, user, password, host, port, path = match.groups()
return sage_URL(scheme, user, password, host, port, path)
12 years, 1 month
r5249 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2012-03-14 20:30:47 +0000 (Wed, 14 Mar 2012)
New Revision: 5249
Modified:
trunk/cumin/python/cumin/grid/quota.py
Log:
Fixing BZ 799382 by detecting when we are doing a csv dump of the quotas and waiting for the values to be fully loaded before rendering them for export.
Modified: trunk/cumin/python/cumin/grid/quota.py
===================================================================
--- trunk/cumin/python/cumin/grid/quota.py 2012-03-14 18:37:34 UTC (rev 5248)
+++ trunk/cumin/python/cumin/grid/quota.py 2012-03-14 20:30:47 UTC (rev 5249)
@@ -13,6 +13,8 @@
from wooly.util import StringCatalog, Writer
from wooly import Parameter, Widget
+from time import *
+
strings = StringCatalog(__file__)
log = logging.getLogger("cumin.grid.quota")
@@ -259,8 +261,13 @@
try:
fval = float(value)
except ValueError:
- if value == self.group_helper.loading_indicator():
- return value
+ if session.page == self.app.export_page:
+ while value == self.group_helper.loading_indicator():
+ sleep(1)
+ value = self.group_helper.get_config_value(session, group, "GROUP_QUOTA_DYNAMIC")
+ else:
+ if value == self.group_helper.loading_indicator():
+ return value
return xml_escape(value)
except:
if isinstance(value, Exception):
@@ -292,8 +299,13 @@
try:
fval = float(value)
except ValueError:
- if value == self.group_helper.loading_indicator():
- return value
+ if session.page == self.app.export_page:
+ while value == self.group_helper.loading_indicator():
+ sleep(1)
+ value = self.group_helper.get_config_value(session, group, "GROUP_QUOTA")
+ else:
+ if value == self.group_helper.loading_indicator():
+ return value
return xml_escape(value)
except:
if isinstance(value, Exception):
12 years, 1 month
r5248 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2012-03-14 18:37:34 +0000 (Wed, 14 Mar 2012)
New Revision: 5248
Modified:
trunk/cumin/python/cumin/grid/limit.py
Log:
Better way of detecting CSV export page for BZ 799404
Modified: trunk/cumin/python/cumin/grid/limit.py
===================================================================
--- trunk/cumin/python/cumin/grid/limit.py 2012-03-14 16:40:04 UTC (rev 5247)
+++ trunk/cumin/python/cumin/grid/limit.py 2012-03-14 18:37:34 UTC (rev 5248)
@@ -98,9 +98,7 @@
limit_max = 0
# if we are exporting csv, we don't want to return a link, so we check here
- # If there is a "nicer" way to check for CSV, I'm all ears
- # maybe refactor CsvTableExporter to call render_csv method (that falls back to regular render if not implemented)?
- if (session.get("modes.m") is not None) and (session.get("modes.m").path == "modes.limits_csv"):
+ if session.page == self.app.export_page:
value = limit_max
else:
href = self.frame.limit.set_limit.get_href(session)
12 years, 1 month
r5247 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2012-03-14 16:40:04 +0000 (Wed, 14 Mar 2012)
New Revision: 5247
Modified:
trunk/cumin/python/cumin/grid/limit.py
Log:
Addressing BZ 799404 by checking for csv mode on the rendering of the table cell. If we are doing a csv, just return the value without the HTML "a" markup.
Modified: trunk/cumin/python/cumin/grid/limit.py
===================================================================
--- trunk/cumin/python/cumin/grid/limit.py 2012-03-14 16:22:25 UTC (rev 5246)
+++ trunk/cumin/python/cumin/grid/limit.py 2012-03-14 16:40:04 UTC (rev 5247)
@@ -88,6 +88,7 @@
return "right"
def render_cell_content(self, session, data):
+ value = None
limit_max = super(LimitTable.MaxColumn, self).render_cell_content(session, data)
try:
limit_max = float(limit_max)
@@ -95,8 +96,17 @@
limit_max = "Unlimited"
except:
limit_max = 0
- href = self.frame.limit.set_limit.get_href(session)
- return fmt_link(href, limit_max)
+
+ # if we are exporting csv, we don't want to return a link, so we check here
+ # If there is a "nicer" way to check for CSV, I'm all ears
+ # maybe refactor CsvTableExporter to call render_csv method (that falls back to regular render if not implemented)?
+ if (session.get("modes.m") is not None) and (session.get("modes.m").path == "modes.limits_csv"):
+ value = limit_max
+ else:
+ href = self.frame.limit.set_limit.get_href(session)
+ value = fmt_link(href, limit_max)
+
+ return value
class LimitSelector(ObjectQmfSelector):
def __init__(self, app, name):
12 years, 1 month
r5246 - in trunk: cumin/model cumin/model/upgrades cumin/python/cumin cumin/python/cumin/grid sage/rpc-defs/aviary
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-03-14 16:22:25 +0000 (Wed, 14 Mar 2012)
New Revision: 5246
Added:
trunk/cumin/model/upgrades/1.1_to_1.2
Modified:
trunk/cumin/model/condor.xml
trunk/cumin/python/cumin/admin.py
trunk/cumin/python/cumin/grid/submission.py
trunk/cumin/python/cumin/util.py
trunk/sage/rpc-defs/aviary/aviary-common.xsd
trunk/sage/rpc-defs/aviary/aviary-job.wsdl
trunk/sage/rpc-defs/aviary/aviary-job.xsd
Log:
Add display of "Suspended" column to submission tables, abbreviate Enqueued.
Change database schema to 1.2 and add upgrade script.
Update schema files.
BZ756384
Modified: trunk/cumin/model/condor.xml
===================================================================
--- trunk/cumin/model/condor.xml 2012-03-09 21:38:31 UTC (rev 5245)
+++ trunk/cumin/model/condor.xml 2012-03-14 16:22:25 UTC (rev 5246)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
<schema package="com.redhat.grid">
<!--
@@ -582,6 +583,17 @@
<arg name="Reason" dir="I" type="sstr"/>
</method>
+ <method name="SuspendJob">
+ <arg name="Id" dir="I" type="sstr"
+ desc="Job's Id, the string ClusterId.ProcId"/>
+ <arg name="Reason" dir="I" type="sstr"/>
+ </method>
+
+ <method name="ContinueJob">
+ <arg name="Id" dir="I" type="sstr"
+ desc="Job's Id, the string ClusterId.ProcId"/>
+ <arg name="Reason" dir="I" type="sstr"/>
+ </method>
</class>
<class name="Submitter">
@@ -818,6 +830,8 @@
<statistic name="Removed" type="count32"/>
<statistic name="Completed" type="count32"/>
<statistic name="Held" type="count32"/>
+ <statistic name="TransferringOutput" type="count32"/>
+ <statistic name="Suspended" type="count32"/>
<!-- summary info -->
<method name="GetJobSummaries">
Added: trunk/cumin/model/upgrades/1.1_to_1.2
===================================================================
--- trunk/cumin/model/upgrades/1.1_to_1.2 (rev 0)
+++ trunk/cumin/model/upgrades/1.1_to_1.2 2012-03-14 16:22:25 UTC (rev 5246)
@@ -0,0 +1,5 @@
+#!/bin/bash
+echo alter table \"com.redhat.grid\".\"Submission\" add column \"Suspended\" bigint | psql -d cumin -U cumin -h localhost
+echo alter table \"com.redhat.grid\".\"Submission_samples\" add column \"Suspended\" bigint | psql -d cumin -U cumin -h localhost
+echo alter table \"com.redhat.grid\".\"Submission\" add column \"TransferringOutput\" bigint | psql -d cumin -U cumin -h localhost
+echo alter table \"com.redhat.grid\".\"Submission_samples\" add column \"TransferringOutput\" bigint | psql -d cumin -U cumin -h localhost
Property changes on: trunk/cumin/model/upgrades/1.1_to_1.2
___________________________________________________________________
Added: svn:executable
+ *
Modified: trunk/cumin/python/cumin/admin.py
===================================================================
--- trunk/cumin/python/cumin/admin.py 2012-03-09 21:38:31 UTC (rev 5245)
+++ trunk/cumin/python/cumin/admin.py 2012-03-14 16:22:25 UTC (rev 5246)
@@ -5,7 +5,7 @@
log = logging.getLogger("cumin.admin")
-schema_version = "1.1"
+schema_version = "1.2"
class SchemaMissing(Exception):
pass
Modified: trunk/cumin/python/cumin/grid/submission.py
===================================================================
--- trunk/cumin/python/cumin/grid/submission.py 2012-03-09 21:38:31 UTC (rev 5245)
+++ trunk/cumin/python/cumin/grid/submission.py 2012-03-14 16:22:25 UTC (rev 5246)
@@ -2,6 +2,7 @@
import shlex
from random import choice
import os
+import datetime
from job import JobSelector, JobFrame
from cumin.objectframe import ObjectFrame, ObjectView, ObjectViewSummary, ObjectViewContext
@@ -107,19 +108,34 @@
self.add_attribute_column(cls.Running)
self.add_attribute_column(cls.Completed)
self.add_attribute_column(cls.Held)
+ self.add_attribute_column(cls.Suspended)
def create_table(self, app, name, cls):
# avoid the checkboxes
return ObjectTable(app, name, cls)
class QDateColumn(ObjectTableColumn):
- def render_cell_content(self, session, data):
- date = super(SubmissionSelector.QDateColumn, self).\
+ def _get_raw_content(self, session, data):
+ d = super(SubmissionSelector.QDateColumn, self).\
render_cell_content(session, data)
- if date is None:
- date = "unknown"
- return date
+ if d is None:
+ d = "unknown"
+ return d
+ def render_cell_content(self, session, data):
+ # Abbreviate to the time or the date, and we'll give
+ # the whole value in the cell title on hover
+ d = self._get_raw_content(session, data)
+ if type(d) is datetime.datetime:
+ if datetime.datetime.now() - d < datetime.timedelta(days=1):
+ d = d.time()
+ else:
+ d = d.date()
+ return d
+
+ def render_cell_title(self, session, data):
+ return self._get_raw_content(session, data)
+
class PoolSubmissionSelector(SubmissionSelector):
def __init__(self, app, name, frame="main.grid.submission"):
super(PoolSubmissionSelector, self).__init__(app, name)
Modified: trunk/cumin/python/cumin/util.py
===================================================================
--- trunk/cumin/python/cumin/util.py 2012-03-09 21:38:31 UTC (rev 5245)
+++ trunk/cumin/python/cumin/util.py 2012-03-14 16:22:25 UTC (rev 5246)
@@ -156,8 +156,8 @@
return dvalue
class JobStatusInfo(object):
- stat_strings = ["Unexpanded", "Idle", "Running", "Removed", "Completed", "Held", "Submission error"]
- stat_colors = ["red", "clear", "green", "black", "blue", "yellow", "red"]
+ stat_strings = ["Unexpanded", "Idle", "Running", "Removed", "Completed", "Held", "Transferring", "Suspended", "Submission error"]
+ stat_colors = ["red", "clear", "green", "black", "blue", "yellow", "green", "yellow", "red"]
@classmethod
def get_status_string(cls, stat):
# Allow strings to be passed in for flexibility.
Modified: trunk/sage/rpc-defs/aviary/aviary-common.xsd
===================================================================
--- trunk/sage/rpc-defs/aviary/aviary-common.xsd 2012-03-09 21:38:31 UTC (rev 5245)
+++ trunk/sage/rpc-defs/aviary/aviary-common.xsd 2012-03-14 16:22:25 UTC (rev 5246)
@@ -122,6 +122,8 @@
<xs:enumeration value="REMOVED"/>
<xs:enumeration value="COMPLETED"/>
<xs:enumeration value="HELD"/>
+ <xs:enumeration value="TRANSFERRING_OUTPUT"/>
+ <xs:enumeration value="SUSPENDED"/>
</xs:restriction>
</xs:simpleType>
<!-- reuse through extension not available for the following related types -->
@@ -157,6 +159,8 @@
<xs:element name="idle" type="xs:int"/>
<xs:element name="removed" type="xs:int"/>
<xs:element name="running" type="xs:int"/>
+ <xs:element name="suspended" type="xs:int"/>
+ <xs:element name="transferring_output" type="xs:int"/>
<xs:element name="jobs" type="tns:JobSummary" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
@@ -182,23 +186,27 @@
</xs:complexType>
<xs:simpleType name="ResourceType">
<xs:restriction base="xs:string">
+ <xs:enumeration value="ANY"/>
<xs:enumeration value="COLLECTOR"/>
- <xs:enumeration value="EXECUTOR"/>
- <xs:enumeration value="EVENT_SERVER"/>
- <xs:enumeration value="JOB_SERVER"/>
- <xs:enumeration value="LOW_LATENCY"/>
+ <xs:enumeration value="CUSTOM"/>
<xs:enumeration value="MASTER"/>
<xs:enumeration value="NEGOTIATOR"/>
<xs:enumeration value="SCHEDULER"/>
- <xs:enumeration value="CUSTOM"/>
+ <xs:enumeration value="SLOT"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ResourceID">
<xs:sequence>
- <xs:element name="subsystem_type" type="tns:ResourceType"/>
- <xs:element name="pool" type="xs:string"/>
- <xs:element name="name" type="xs:string"/>
- <xs:element name="custom_name" type="xs:string" minOccurs="0"/>
+ <xs:element name="resource" type="tns:ResourceType"/>
+ <xs:element name="pool" type="xs:string" minOccurs="0"/>
+ <xs:element name="name" type="xs:string" minOccurs="0"/>
+ <xs:element name="sub_type" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
+ <xs:complexType name="ResourceLocation">
+ <xs:sequence>
+ <xs:element name="id" type="tns:ResourceID"/>
+ <xs:element name="location" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
</xs:schema>
Modified: trunk/sage/rpc-defs/aviary/aviary-job.wsdl
===================================================================
--- trunk/sage/rpc-defs/aviary/aviary-job.wsdl 2012-03-09 21:38:31 UTC (rev 5245)
+++ trunk/sage/rpc-defs/aviary/aviary-job.wsdl 2012-03-14 16:22:25 UTC (rev 5246)
@@ -46,6 +46,18 @@
<wsdl:message name="RemoveJobResponse">
<wsdl:part name="parameters" element="job:RemoveJobResponse"/>
</wsdl:message>
+ <wsdl:message name="SuspendJobRequest">
+ <wsdl:part name="parameters" element="job:SuspendJob"/>
+ </wsdl:message>
+ <wsdl:message name="SuspendJobResponse">
+ <wsdl:part name="parameters" element="job:SuspendJobResponse"/>
+ </wsdl:message>
+ <wsdl:message name="ContinueJobRequest">
+ <wsdl:part name="parameters" element="job:ContinueJob"/>
+ </wsdl:message>
+ <wsdl:message name="ContinueJobResponse">
+ <wsdl:part name="parameters" element="job:ContinueJobResponse"/>
+ </wsdl:message>
<wsdl:message name="SetJobAttributeRequest">
<wsdl:part name="parameters" element="job:SetJobAttribute"/>
</wsdl:message>
@@ -69,6 +81,14 @@
<wsdl:input message="tns:RemoveJobRequest"/>
<wsdl:output message="tns:RemoveJobResponse"/>
</wsdl:operation>
+ <wsdl:operation name="suspendJob">
+ <wsdl:input message="tns:SuspendJobRequest"/>
+ <wsdl:output message="tns:SuspendJobResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="continueJob">
+ <wsdl:input message="tns:ContinueJobRequest"/>
+ <wsdl:output message="tns:ContinueJobResponse"/>
+ </wsdl:operation>
<wsdl:operation name="setJobAttribute">
<wsdl:input message="tns:SetJobAttributeRequest"/>
<wsdl:output message="tns:SetJobAttributeResponse"/>
@@ -112,6 +132,24 @@
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="suspendJob">
+ <soap:operation soapAction="http://grid.redhat.com/aviary-job/suspend"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="continueJob">
+ <soap:operation soapAction="http://grid.redhat.com/aviary-job/continue"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
<wsdl:operation name="setJobAttribute">
<soap:operation soapAction="http://grid.redhat.com/aviary-job/set-attr"/>
<wsdl:input>
Modified: trunk/sage/rpc-defs/aviary/aviary-job.xsd
===================================================================
--- trunk/sage/rpc-defs/aviary/aviary-job.xsd 2012-03-09 21:38:31 UTC (rev 5245)
+++ trunk/sage/rpc-defs/aviary/aviary-job.xsd 2012-03-14 16:22:25 UTC (rev 5246)
@@ -59,6 +59,10 @@
<xs:element name="ReleaseJobResponse" type="job:ControlJobResponse"/>
<xs:element name="RemoveJob" type="job:ControlJob"/>
<xs:element name="RemoveJobResponse" type="job:ControlJobResponse"/>
+ <xs:element name="SuspendJob" type="job:ControlJob"/>
+ <xs:element name="SuspendJobResponse" type="job:ControlJobResponse"/>
+ <xs:element name="ContinueJob" type="job:ControlJob"/>
+ <xs:element name="ContinueJobResponse" type="job:ControlJobResponse"/>
<xs:element name="SetJobAttribute">
<xs:complexType>
<xs:sequence>
12 years, 1 month
r5245 - in trunk: cumin/python/cumin/grid sage/python/sage/aviary sage/python/sage/qmf
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-03-09 21:38:31 +0000 (Fri, 09 Mar 2012)
New Revision: 5245
Modified:
trunk/cumin/python/cumin/grid/job.py
trunk/sage/python/sage/aviary/aviaryoperations.py
trunk/sage/python/sage/qmf/qmfoperations.py
Log:
Add suspend and continue task links for job control
BZ756384
Modified: trunk/cumin/python/cumin/grid/job.py
===================================================================
--- trunk/cumin/python/cumin/grid/job.py 2012-03-07 15:03:24 UTC (rev 5244)
+++ trunk/cumin/python/cumin/grid/job.py 2012-03-09 21:38:31 UTC (rev 5245)
@@ -45,6 +45,8 @@
JobHold(app, self)
JobRelease(app, self)
+ JobSuspend(app, self)
+ JobContinue(app, self)
JobRemove(app, self)
# task not visible on page. used for edit submit
@@ -253,6 +255,8 @@
JobSelectionHold(app, self, "held")
JobSelectionRelease(app, self, "released")
+ JobSelectionSuspend(app, self, "suspended")
+ JobSelectionContinue(app, self, "continued")
JobSelectionRemove(app, self, "removed")
self.enable_csv_export(submission)
@@ -310,15 +314,16 @@
return super(JobSelectorTable, self).do_render(session)
class JobObjectSelectorTask(ObjectSelectorTask):
- def __init__(self, app, selector, verb):
+ def __init__(self, app, selector, verb, cmd):
super(JobObjectSelectorTask, self).__init__(app, selector)
self.form = JobObjectSelectorTaskForm(app, self.name, self, verb)
- self.method = None
+ self.cmd = cmd
def do_invoke(self, invoc, job_id, scheduler, reason, submission):
- assert self.method
- self.method(scheduler, job_id, reason, submission, callback=invoc.make_callback())
+ self.app.remote.control_job(self.cmd, scheduler,
+ job_id, reason, submission,
+ callback=invoc.make_callback())
def do_enter(self, session, osession):
submission = self.selector.submission.get(osession)
@@ -330,31 +335,44 @@
class JobSelectionHold(JobObjectSelectorTask):
def __init__(self, app, selector, verb):
- super(JobSelectionHold, self).__init__(app, selector, verb)
+ super(JobSelectionHold, self).__init__(app, selector, verb,
+ "holdJob")
- self.method = self.app.remote.hold_job
-
def get_title(self, session):
return "Hold"
class JobSelectionRelease(JobObjectSelectorTask):
def __init__(self, app, selector, verb):
- super(JobSelectionRelease, self).__init__(app, selector, verb)
+ super(JobSelectionRelease, self).__init__(app, selector, verb,
+ "releaseJob")
- self.method = self.app.remote.release_job
-
def get_title(self, session):
return "Release"
class JobSelectionRemove(JobObjectSelectorTask):
def __init__(self, app, selector, verb):
- super(JobSelectionRemove, self).__init__(app, selector, verb)
+ super(JobSelectionRemove, self).__init__(app, selector, verb,
+ "removeJob")
- self.method = self.app.remote.remove_job
-
def get_title(self, session):
return "Remove"
+class JobSelectionSuspend(JobObjectSelectorTask):
+ def __init__(self, app, selector, verb):
+ super(JobSelectionSuspend, self).__init__(app, selector, verb,
+ "suspendJob")
+
+ def get_title(self, session):
+ return "Suspend"
+
+class JobSelectionContinue(JobObjectSelectorTask):
+ def __init__(self, app, selector, verb):
+ super(JobSelectionContinue, self).__init__(app, selector, verb,
+ "continueJob")
+
+ def get_title(self, session):
+ return "Continue"
+
class JobObjectSelectorTaskForm(ObjectSelectorTaskForm):
def __init__(self, app, name, task, verb):
super(JobObjectSelectorTaskForm, self).__init__(app, name, task)
@@ -1124,49 +1142,54 @@
return "Reason"
class JobAction(ObjectFrameTask):
- def __init__(self, app, frame, verb):
+ def __init__(self, app, frame, verb, cmd):
super(JobAction, self).__init__(app, frame)
self.form = JobActionForm(app, self.name, self, verb)
+ self.cmd = cmd
def do_enter(self, session, osession):
job_id = self.frame.job_id.get(osession)
self.form.job_id.set(session, job_id)
def do_invoke(self, invoc, scheduler, job_id, reason, submission):
- raise Exception("oops, not implemented!")
+ self.app.remote.control_job(self.cmd, scheduler, job_id,
+ reason, submission,
+ callback=invoc.make_callback())
class JobHold(JobAction):
def __init__(self, app, frame):
- super(JobHold, self).__init__(app, frame, "held")
+ super(JobHold, self).__init__(app, frame, "held", "holdJob")
- def do_invoke(self, invoc, scheduler, job_id, reason, submission):
- self.app.remote.hold_job(scheduler, job_id, reason, submission,
- callback=invoc.make_callback())
-
def get_title(self, session):
return "Hold Job"
class JobRelease(JobAction):
def __init__(self, app, frame):
- super(JobRelease, self).__init__(app, frame, "released")
+ super(JobRelease, self).__init__(app, frame, "released", "releaseJob")
- def do_invoke(self, invoc, scheduler, job_id, reason, submission):
- self.app.remote.release_job(scheduler, job_id, reason, submission,
- callback=invoc.make_callback())
-
def get_title(self, session):
return "Release Job"
-class JobRemove(JobAction):
+class JobSuspend(JobAction):
def __init__(self, app, frame):
- super(JobRemove, self).__init__(app, frame, "removed")
+ super(JobSuspend, self).__init__(app, frame, "suspended", "suspendJob")
- def do_invoke(self, invoc, scheduler, job_id, reason, submission):
- self.app.remote.remove_job(scheduler, job_id, reason, submission,
- callback=invoc.make_callback())
+ def get_title(self, session):
+ return "Suspend Job"
+class JobContinue(JobAction):
+ def __init__(self, app, frame):
+ super(JobContinue, self).__init__(app, frame, "continued", "continueJob")
+
def get_title(self, session):
+ return "Continue Job"
+
+class JobRemove(JobAction):
+ def __init__(self, app, frame):
+ super(JobRemove, self).__init__(app, frame, "removed", "removeJob")
+
+ def get_title(self, session):
return "Remove Job"
def do_enter(self, session, osession):
Modified: trunk/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- trunk/sage/python/sage/aviary/aviaryoperations.py 2012-03-07 15:03:24 UTC (rev 5244)
+++ trunk/sage/python/sage/aviary/aviaryoperations.py 2012-03-09 21:38:31 UTC (rev 5245)
@@ -189,64 +189,30 @@
t = CallThread(job_client.service.submitJob, my_callback, *args)
t.start()
- def hold_job(self, scheduler, job_id, reason, submission, *args, **kwargs):
+ def control_job(self, cmd, scheduler, job_id, reason, submission, *args, **kwargs):
'''
This method is asynchronous iff 'callback' is supplied.
- kwargs will be searched for 'callback', 'default' and 'timeout' arguments.
-
- These optional arguments were moved to kwargs for compatibility
- with another implementation of the same routine.
- '''
-
- callback = "callback" in kwargs and kwargs["callback"] or None
- default = "default" in kwargs and kwargs["default"] or None
- timeout = "timeout" in kwargs and kwargs["timeout"] or 5
+ Values for cmd are case sensitive (although the first letter may
+ actually be either case) and may be one of the following:
+ 'holdJob', 'releaseJob', 'suspendJob', 'continueJob', 'removeJob'
- return self._control_job(scheduler, job_id, reason, submission,
- "holdJob",
- callback, default, timeout)
-
- def release_job(self, scheduler, job_id, reason, submission, *args, **kwargs):
- '''
- This method is asynchronous iff 'callback' is supplied.
-
kwargs will be searched for 'callback', 'default' and 'timeout' arguments.
-
- These optional arguments were moved to kwargs for compatibility
- with another implementation of the same routine.
'''
- callback = "callback" in kwargs and kwargs["callback"] or None
- default = "default" in kwargs and kwargs["default"] or None
- timeout = "timeout" in kwargs and kwargs["timeout"] or 5
-
+ # Aviary and QMF command names for job control differ in one respect,
+ # which is that QMF uses an initial capital and Aviary does not.
+ cmd = cmd[0].lower() + cmd[1:]
return self._control_job(scheduler, job_id, reason, submission,
- "releaseJob",
- callback, default, timeout)
+ cmd, *args, **kwargs)
- def remove_job(self, scheduler, job_id, reason, submission, *args, **kwargs):
- '''
- This method is asynchronous iff 'callback' is supplied.
+ def _control_job(self, scheduler, job_id, reason, submission,
+ meth_name, *args, **kwargs):
- kwargs will be searched for 'callback', 'default' and 'timeout' arguments.
-
- These optional arguments were moved to kwargs for compatibility
- with another implementation of the same routine.
- '''
-
callback = "callback" in kwargs and kwargs["callback"] or None
default = "default" in kwargs and kwargs["default"] or None
timeout = "timeout" in kwargs and kwargs["timeout"] or 5
- return self._control_job(scheduler, job_id, reason, submission,
- "removeJob",
- callback, default, timeout)
-
- def _control_job(self, scheduler, job_id, reason, submission,
- meth_name,
- callback, default, timeout):
-
client = self._setup_client(self.job_client_pool,
scheduler.Machine,
self.job_servers,
Modified: trunk/sage/python/sage/qmf/qmfoperations.py
===================================================================
--- trunk/sage/python/sage/qmf/qmfoperations.py 2012-03-07 15:03:24 UTC (rev 5244)
+++ trunk/sage/python/sage/qmf/qmfoperations.py 2012-03-09 21:38:31 UTC (rev 5245)
@@ -90,55 +90,27 @@
assert callback
self._call(scheduler, "SubmitJob", callback, 0, 0, ad)
- def hold_job(self, scheduler, job_id, reason, *args, **kwargs):
+ def control_job(self, cmd, scheduler, job_id, reason, *args, **kwargs):
'''
This method is asynchronous iff 'callback' is supplied.
- kwargs will be searched for 'callback', 'default' and 'timeout' arguments.
-
- These optional arguments were moved to kwargs for compatibility
- with another implementation of the same routine.
- '''
-
- callback = "callback" in kwargs and kwargs["callback"] or None
- default = "default" in kwargs and kwargs["default"] or None
- timeout = "timeout" in kwargs and kwargs["timeout"] or 5
+ Values for cmd are case sensitive (although the first letter may
+ actually be either case) and may be one of the following:
+ 'HoldJob', 'ReleaseJob', 'SuspendJob', 'ContinueJob', 'RemoveJob'
- return self._call(scheduler, "HoldJob", callback, default,
- timeout, job_id, reason)
-
- def release_job(self, scheduler, job_id, reason, *args, **kwargs):
- '''
- This method is asynchronous iff 'callback' is supplied.
-
kwargs will be searched for 'callback', 'default' and 'timeout' arguments.
-
- These optional arguments were moved to kwargs for compatibility
- with another implementation of the same routine.
'''
- callback = "callback" in kwargs and kwargs["callback"] or None
- default = "default" in kwargs and kwargs["default"] or None
- timeout = "timeout" in kwargs and kwargs["timeout"] or 5
+ # Aviary and QMF command names for job control differ in one respect,
+ # which is that QMF uses an initial capital and Aviary does not.
+ # Make sure initial letter is uppercase
+ cmd = cmd[0].upper() + cmd[1:]
- return self._call(scheduler, "ReleaseJob", callback, default,
- timeout, job_id, reason)
-
- def remove_job(self, scheduler, job_id, reason, *args, **kwargs):
- '''
- This method is asynchronous iff 'callback' is supplied.
-
- kwargs will be searched for 'callback', 'default' and 'timeout' arguments.
-
- These optional arguments were moved to kwargs for compatibility
- with another implementation of the same routine.
- '''
-
callback = "callback" in kwargs and kwargs["callback"] or None
default = "default" in kwargs and kwargs["default"] or None
timeout = "timeout" in kwargs and kwargs["timeout"] or 5
- return self._call(scheduler, "RemoveJob", callback, default,
+ return self._call(scheduler, cmd, callback, default,
timeout, job_id, reason)
# jobserver operations
12 years, 1 month
r5244 - in trunk: cumin/bin cumin/etc cumin/python/cumin mint/python/mint sage/python/sage sage/python/sage/wallaby
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-03-07 15:03:24 +0000 (Wed, 07 Mar 2012)
New Revision: 5244
Modified:
trunk/cumin/bin/cumin-web
trunk/cumin/etc/cumin.conf
trunk/cumin/python/cumin/session.py
trunk/mint/python/mint/session.py
trunk/sage/python/sage/util.py
trunk/sage/python/sage/wallaby/wallabyoperations.py
Log:
Change default value for sasl-mech-list, make it context sensitive based on
the broker URI.
BZ801047
Modified: trunk/cumin/bin/cumin-web
===================================================================
--- trunk/cumin/bin/cumin-web 2012-03-06 18:11:26 UTC (rev 5243)
+++ trunk/cumin/bin/cumin-web 2012-03-07 15:03:24 UTC (rev 5244)
@@ -129,6 +129,9 @@
cumin = Cumin(config.get_home(), broker_uris, opts.database,
opts.host, opts.port, values.persona, authmech)
+ # If the mech_list was set explicitly, honor it.
+ # Otherwise Cumin will default based on whether or not
+ # a broker URL contains credentials.
if type(values.sasl_mech_list) == str:
cumin.sasl_mech_list = values.sasl_mech_list.upper()
Modified: trunk/cumin/etc/cumin.conf
===================================================================
--- trunk/cumin/etc/cumin.conf 2012-03-06 18:11:26 UTC (rev 5243)
+++ trunk/cumin/etc/cumin.conf 2012-03-07 15:03:24 UTC (rev 5244)
@@ -13,13 +13,14 @@
[common]
# database: dbname=cumin user=cumin host=localhost
# brokers: localhost:5672
-# sasl-mech-list: [default, allow all available mechanisms]
+# sasl-mech-list: [default, 'anonymous' or 'plain digest-md5' with usr/passw]
# wallaby-broker: [default, first item in 'brokers' list]
# wallaby-refresh: 60
# log-level: info
# log-max-mb: 10
# log-max-archives: 1
+
# ****************************************************
# Aviary interface to condor
@@ -179,6 +180,18 @@
## [common]
+## sasl-mech-list:
+## A space separated list that restricts the SASL mechanisms
+## Cumin may use when authenticating to the broker. By default
+## Cumin will use ANONYMOUS authentication if the broker URL does
+## not contain user/password and will use PLAIN or DIGEST-MD5
+## if the broker URL does contain user/password. DIGEST-MD5 is
+## considered more secure than PLAIN by SASL and will be
+## used if is available. This value may be set explicitly
+## to make other choices.
+## Setting the value to 'AVAILABLE' will allow Cumin to use
+## any available mechanism including ANONYMOUS.
+
## wallaby-broker: [first item in 'brokers' list]
## The broker to use for interaction with a Wallaby agent.
## This is not necessarily the same broker used for grid
Modified: trunk/cumin/python/cumin/session.py
===================================================================
--- trunk/cumin/python/cumin/session.py 2012-03-06 18:11:26 UTC (rev 5243)
+++ trunk/cumin/python/cumin/session.py 2012-03-07 15:03:24 UTC (rev 5244)
@@ -4,6 +4,7 @@
from qmf.console import Console, Session, ObjectId
from rosemary.model import RosemaryObject
+from sage.util import get_sasl_mechanisms
log = logging.getLogger("cumin.session")
@@ -22,12 +23,13 @@
self.lock = Lock()
def add_broker(self, uri):
+ mechs = get_sasl_mechanisms(uri, self.app.sasl_mech_list)
uri_without_password = uri[uri.rfind("@") + 1:]
- log.info("Adding QMF broker at %s with mech_list %s", uri_without_password, str(self.app.sasl_mech_list))
+ log.info("Adding QMF broker at %s with mech_list %s", uri_without_password, mechs)
assert self.qmf_session
- qmf_broker = self.qmf_session.addBroker(uri,mechanisms=self.app.sasl_mech_list)
+ qmf_broker = self.qmf_session.addBroker(uri,mechanisms=mechs)
self.qmf_brokers.append(qmf_broker)
Modified: trunk/mint/python/mint/session.py
===================================================================
--- trunk/mint/python/mint/session.py 2012-03-06 18:11:26 UTC (rev 5243)
+++ trunk/mint/python/mint/session.py 2012-03-07 15:03:24 UTC (rev 5244)
@@ -2,6 +2,7 @@
from util import *
from qmf.console import Console, Session
+from sage.util import get_sasl_mechanisms
log = logging.getLogger("mint.session")
@@ -14,12 +15,13 @@
self.qmf_brokers = list()
def add_broker(self, uri):
+ mechs = get_sasl_mechanisms(uri, self.app.sasl_mech_list)
uri_without_password = uri[uri.rfind("@") + 1:]
- log.info("Adding QMF broker at %s with mech_list %s", uri_without_password, str(self.app.sasl_mech_list))
+ log.info("Adding QMF broker at %s with mech_list %s", uri_without_password, mechs)
assert self.qmf_session
- qmf_broker = self.qmf_session.addBroker(uri, mechanisms=self.app.sasl_mech_list)
+ qmf_broker = self.qmf_session.addBroker(uri, mechanisms=mechs)
self.qmf_brokers.append(qmf_broker)
def check(self):
Modified: trunk/sage/python/sage/util.py
===================================================================
--- trunk/sage/python/sage/util.py 2012-03-06 18:11:26 UTC (rev 5243)
+++ trunk/sage/python/sage/util.py 2012-03-07 15:03:24 UTC (rev 5244)
@@ -283,4 +283,25 @@
return hosts
-
+def get_sasl_mechanisms(uri, sasl_mech_list):
+ '''
+ Returns the allowable SASL mech list value.
+ If sasl_mech_list is not None, it will determine the return value.
+ If it is None, a default value will be chosen based on the URI.
+ If sasl_mech_list is set to "AVAILABLE" then this routine will
+ return None indicating the mech_list should be unrestricted.
+ '''
+ if sasl_mech_list is not None:
+ # Leaving sasl_mech_list value unset means 'all available mechs'
+ # We still need a way to say that from the config file, since
+ # we have layered Cumin defaults on 'not set'
+ if sasl_mech_list.upper() == "AVAILABLE":
+ return None
+ return sasl_mech_list
+
+ u = parse_URL(uri)
+ if u.user is not None and u.password is not None:
+ mechs = "PLAIN DIGEST-MD5"
+ else:
+ mechs = "ANONYMOUS"
+ return mechs
Modified: trunk/sage/python/sage/wallaby/wallabyoperations.py
===================================================================
--- trunk/sage/python/sage/wallaby/wallabyoperations.py 2012-03-06 18:11:26 UTC (rev 5243)
+++ trunk/sage/python/sage/wallaby/wallabyoperations.py 2012-03-07 15:03:24 UTC (rev 5244)
@@ -2,7 +2,7 @@
import time
from qmf.console import Session
-from sage.util import CallThread
+from sage.util import CallThread, get_sasl_mechanisms
from threading import Lock, Condition
#import cProfile
@@ -54,12 +54,15 @@
The refresh interval may be set for items individually with the
set_interval() method.
- sasl_mech_list -- restricts the list of allowable sasl authentication
- that will be allowed when connecting to a QMF message broker. Default
- is to accept all available mechanisms.
+ sasl_mech_list -- restricts the list of sasl mechanisms
+ that will be allowed when connecting to a QMF message broker.
+ If the broker URL contains no credentials, default is ANONYMOUS.
+ If the broker URL does contain credentials, default is
+ 'PLAIN DIGEST-MD5'
'''
self.broker_uri = broker_uri
- self.sasl_mech_list = sasl_mech_list
+ self.sasl_mech_list = get_sasl_mechanisms(broker_uri,
+ sasl_mech_list)
# A wallaby Store object
self._store = None
12 years, 2 months