r5529 - branches/tmckay/cumin/python/cumin/grid
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-10-30 18:56:54 +0000 (Tue, 30 Oct 2012)
New Revision: 5529
Modified:
branches/tmckay/cumin/python/cumin/grid/job.py
Log:
Probably messed this up during a merge?
Modified: branches/tmckay/cumin/python/cumin/grid/job.py
===================================================================
--- branches/tmckay/cumin/python/cumin/grid/job.py 2012-10-30 16:24:24 UTC (rev 5528)
+++ branches/tmckay/cumin/python/cumin/grid/job.py 2012-10-30 18:56:54 UTC (rev 5529)
@@ -98,9 +98,9 @@
id = self.id.get(session)
if job_id is None:
job_id = self.job_id.get(session)
- submission, job_server, sched = self.get_trifecta(session, id)
- results = self.app.remote.get_job_ad(job_server, job_id,
- sched.Name, submission,
+ submission, sched = self.get_submission_sched(session, id)
+ results = self.app.remote.get_job_ad(sched, job_id,
+ submission,
default={'JobAd': {}})
return results
11 years, 6 months
r5527 - branches/tmckay/sage/python/sage/aviary
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-10-30 13:44:11 +0000 (Tue, 30 Oct 2012)
New Revision: 5527
Modified:
branches/tmckay/sage/python/sage/aviary/aviaryoperations.py
Log:
Allow None for submission in getSubmissionSummaries
Modified: branches/tmckay/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- branches/tmckay/sage/python/sage/aviary/aviaryoperations.py 2012-10-29 19:42:58 UTC (rev 5526)
+++ branches/tmckay/sage/python/sage/aviary/aviaryoperations.py 2012-10-30 13:44:11 UTC (rev 5527)
@@ -718,14 +718,17 @@
query_client.set_enable_attributes(True)
query_client.set_attributes({"includeJobSummaries": "true"})
- if not type(submission) in (list, tuple):
- submission = [submission]
- subIds = []
- for sub in submission:
- subId = query_client.factory.create('ns0:SubmissionID')
- subId.name = sub.Name
- subId.owner = sub.Owner
- subIds.append(subId)
+ if submission is not None:
+ if not type(submission) in (list, tuple):
+ submission = [submission]
+ subIds = []
+ for sub in submission:
+ subId = query_client.factory.create('ns0:SubmissionID')
+ subId.name = sub.Name
+ subId.owner = sub.Owner
+ subIds.append(subId)
+ else:
+ subIds = None
if callback:
t = CallThread(self.call_client_retry, my_callback,
11 years, 6 months
r5526 - trunk/wooly/python/wooly
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-10-29 19:42:58 +0000 (Mon, 29 Oct 2012)
New Revision: 5526
Modified:
trunk/wooly/python/wooly/server.py
Log:
Loosen test for SSL errors and suppress them all, include a debug level log msg
BZ842286 (modified)
Modified: trunk/wooly/python/wooly/server.py
===================================================================
--- trunk/wooly/python/wooly/server.py 2012-10-29 18:12:26 UTC (rev 5525)
+++ trunk/wooly/python/wooly/server.py 2012-10-29 19:42:58 UTC (rev 5526)
@@ -19,9 +19,10 @@
try:
s, env = super(PatchBuiltinSSLAdapter, self).wrap(sock)
except ssl.SSLError, e:
- if e.errno != ssl.SSL_ERROR_SSL or \
- not e.args[1].endswith('alert unknown ca'):
+ if e.errno != ssl.SSL_ERROR_SSL:
raise
+ else:
+ log.debug("Supressing ssl exception", exc_info=True)
s, env = None, {}
return s, env
except:
11 years, 6 months
r5525 - trunk/wooly/python/wooly
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-10-29 18:12:26 +0000 (Mon, 29 Oct 2012)
New Revision: 5525
Modified:
trunk/wooly/python/wooly/server.py
Log:
Prevent unknown ca alert exceptions from restarting the web server
BZ842286
Modified: trunk/wooly/python/wooly/server.py
===================================================================
--- trunk/wooly/python/wooly/server.py 2012-10-29 15:41:32 UTC (rev 5524)
+++ trunk/wooly/python/wooly/server.py 2012-10-29 18:12:26 UTC (rev 5525)
@@ -7,6 +7,26 @@
log = logging.getLogger("wooly.server")
+try:
+ from wsgiserver.ssl_builtin import BuiltinSSLAdapter
+ import ssl
+ class PatchBuiltinSSLAdapter(BuiltinSSLAdapter):
+ def wrap(self, sock):
+ '''
+ Overload the wrap method and suppress unknown
+ ca alerts from clients on connection
+ '''
+ try:
+ s, env = super(PatchBuiltinSSLAdapter, self).wrap(sock)
+ except ssl.SSLError, e:
+ if e.errno != ssl.SSL_ERROR_SSL or \
+ not e.args[1].endswith('alert unknown ca'):
+ raise
+ s, env = None, {}
+ return s, env
+except:
+ pass
+
class WebServer(object):
http_date = "%a, %d %b %Y %H:%M:%S %Z"
http_date_gmt = "%a, %d %b %Y %H:%M:%S GMT"
@@ -265,9 +285,8 @@
# Try the Python ssl module solution first
try:
- from wsgiserver.ssl_builtin import BuiltinSSLAdapter
- ssl_adapter = BuiltinSSLAdapter(self.server.server_cert,
- self.server.server_key)
+ ssl_adapter = PatchBuiltinSSLAdapter(self.server.server_cert,
+ self.server.server_key)
log.info("Webserver: ssl enabled via the Python ssl module.")
except:
pass
11 years, 6 months
r5524 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2012-10-29 15:41:32 +0000 (Mon, 29 Oct 2012)
New Revision: 5524
Modified:
trunk/cumin/python/cumin/grid/dashboard.py
Log:
Changing the reporting charts for memory and cpu to be stacked rather than overlapping.
Modified: trunk/cumin/python/cumin/grid/dashboard.py
===================================================================
--- trunk/cumin/python/cumin/grid/dashboard.py 2012-10-29 15:34:22 UTC (rev 5523)
+++ trunk/cumin/python/cumin/grid/dashboard.py 2012-10-29 15:41:32 UTC (rev 5524)
@@ -59,12 +59,14 @@
chart.stats = ["usedmem", "freemem"]
chart.max_samples = 250
chart.duration.param.default = "86400"
+ chart.chart_type = "stacked"
charts.add_child(chart)
chart = self.PoolCpuChart(app, "fcpu", app.model.com_redhat_grid_plumage.OSUtil)
chart.stats = [ "usedcpu", "freecpu"]
chart.max_samples = 250
chart.duration.param.default = "86400"
+ chart.chart_type = "stacked"
charts.add_child(chart)
chart = self.UserUsageChart(app, "useruse", app.model.com_redhat_grid_plumage.Accountant)
11 years, 6 months
r5523 - in trunk/cumin: python/cumin resources
by croberts@fedoraproject.org
Author: croberts
Date: 2012-10-29 15:34:22 +0000 (Mon, 29 Oct 2012)
New Revision: 5523
Modified:
trunk/cumin/python/cumin/stat.py
trunk/cumin/resources/app.js
Log:
Laying groundwork for the jqplot charts to be able to display in "stacked" mode rather than overlaid line charts.
Modified: trunk/cumin/python/cumin/stat.py
===================================================================
--- trunk/cumin/python/cumin/stat.py 2012-10-24 18:45:46 UTC (rev 5522)
+++ trunk/cumin/python/cumin/stat.py 2012-10-29 15:34:22 UTC (rev 5523)
@@ -221,7 +221,8 @@
params.append("duration=%s" % self.duration.get(session))
params.append("rpkg=%s" % self.cls._package._name)
params.append("rcls=%s" % self.cls._name)
- params.append("type=%s" % "reportarea")
+ if self.chart_type:
+ params.append("type=%s" % self.chart_type)
for i, stat in enumerate(self.stats):
params.append("stat=%s" % stat)
@@ -921,6 +922,7 @@
chart = self.get_chart(session, adapter, stats, samples, time_span, max_value, min_value, append, end_seconds_ago)
#print "**********\n"+chart.create()
chart.graph_div = "%s_chart" % chart.id.replace(".", "_")
+ chart.stackSeries = self.stackSeries
return chart.create()
def get_y_labels(self, absy, intervals, step):
@@ -991,6 +993,7 @@
super(AreaChart, self).__init__(app, name, page)
self.alpha = 3
+ self.stackSeries = False
def getStatSamples(self, adapter, samples, stat, dur, interval, method, end_seconds_ago, delta):
# get more samples than needed to allow chart to clip correctly (explains the + 600)
@@ -1113,40 +1116,11 @@
chart.append = self.get_elapsed(session)['value']
return chart
- chart.title.text = ""
- chart.title.style = "{text-align: left; font-weight: bold; font-size: 14px;}"
- chart.tooltip = {"colour": "#000033",
- "background": "#FFFFCC",
- "stroke": 1,
- "title": "{background-color: #000022; color: #FFFFFF; font-size: 1em;}",
- "body": "{font-size: 10px; color: #000000;}"
- }
-
chart.x_axis = XAxis().get_x_axis(duration, end_secs)
y_axis, y_axis_right = self.get_y_axis(max_value, min_value)
chart.y_axis = y_axis
chart.y_axis_right = y_axis_right
- # if we are big enough, add a control slider to pan and zoom
- if width > 400:
- chart.control.bg_colour = "#DDDDDD"
- chart.control.x_axis = XAxis().get_x_axis(self.one_day, 0, tick_height=10)
- chart.control.x_axis.labels.colour = "#333333"
- chart.control.x_axis.grid_colour = "#FFFFFF"
- samples = self.fetch_samples(adapter, self.one_day, 180, "avg", mode, False, stats, end_seconds_ago=0)
- self.add_control_points(session, stats, samples)
- max_value, min_value = self.get_max_min(session, stats, samples)
- self.make_chart_lines(session, chart.control, "area", stats, 1, 0, 0, samples, self.one_day, 0, mode)
- chart.control.y_min = max(min_value, 0)
- chart.control.y_max = max(max_value-2, 1)
- chart.control.slider_low.value = float(self.page.control_min.get(session))
- chart.control.slider_low.colour = "#666666"
- chart.control.slider_high.value = float(self.page.control_max.get(session))
- chart.control.slider_high.colour = "#666666"
- chart.control.tnow = time()
- chart.control.duration = self.one_day
- chart.control.end_secs = 0
-
#print "sending entire sample set with y_axis.max=%i" % chart.y_axis["max"]
return chart
@@ -1179,6 +1153,10 @@
self.add_attribute(self.points)
self.alpha = 1
+ self.stackSeries = True
+
+ # removed get_vals method since the new way of rendering stacked charts
+ # no longer requires a special method of computing the values.
def get_max_min(self, session, stats, samples, time_span, end_seconds_ago):
max_value = 0
@@ -1220,22 +1198,6 @@
return max_value, min_value
- def get_vals(self, session, samples, stat, text, duration, end_secs):
- tnow = time()
- vals = list()
- points = self.points.get(session)
-
- if points:
- min_dt = tnow - duration - end_secs
- for dt, value, stacked_value in points[stat]:
- if value is not None:
- vals.append({"dt": secs(dt), "y": stacked_value})
- if secs(dt) < min_dt:
- break
-
- vals.reverse()
- return vals
-
class Points(Attribute):
def get_default(self, session):
return dict()
Modified: trunk/cumin/resources/app.js
===================================================================
--- trunk/cumin/resources/app.js 2012-10-24 18:45:46 UTC (rev 5522)
+++ trunk/cumin/resources/app.js 2012-10-29 15:34:22 UTC (rev 5523)
@@ -587,6 +587,7 @@
dataContainer['x_axis_values'] = dataContainer['x_axis_values']
.append([ json.x_axis.labels.labels[i].text ]);
}
+ dataContainer['stackSeries'] = json.stackSeries;
return dataContainer;
}
@@ -649,6 +650,7 @@
}
},
series: getSeries(dataContainer),
+ stackSeries: dataContainer['stackSeries'],
seriesColors: ['#009926','#992600','#0036d6','#ffc414','730099','#ff00cc'],
seriesDefaults: {
lineWidth:1,
@@ -751,10 +753,10 @@
// used to let us tweak the contents of the tooltip according to our whim, gets called from highlighter plugin showTooltip function
customTooltip = function(str, seriesIndex, pointIndex, plot) {
- value = plot.series[seriesIndex]._plotData[pointIndex][1];
+ value = plot.series[seriesIndex].data[pointIndex][1];
seriesValues = new Array();
for(i=0; i<plot.series.length; i++) {
- series = "<tr><td>" + plot.series[i].label + ": " + plot.series[i]._plotData[pointIndex][1] + "</td></tr>";
+ series = "<tr><td>" + plot.series[i].label + ": " + plot.series[i].data[pointIndex][1] + "</td></tr>";
seriesValues.push(series);
}
str = str.replace(/#allSeries#/,seriesValues.join(""));
11 years, 6 months
r5522 - in trunk/cumin/python/cumin: grid usergrid
by croberts@fedoraproject.org
Author: croberts
Date: 2012-10-24 18:45:46 +0000 (Wed, 24 Oct 2012)
New Revision: 5522
Modified:
trunk/cumin/python/cumin/grid/negotiator.py
trunk/cumin/python/cumin/grid/scheduler.py
trunk/cumin/python/cumin/grid/submission.py
trunk/cumin/python/cumin/usergrid/widgets.py
Log:
Now specifying the width of name columns. This was necessary because the table itself is now set to be fixed. With no specific value set, each column gets set to "auto" which is good, but can result in part of the data being hidden at smaller screen widths.
Modified: trunk/cumin/python/cumin/grid/negotiator.py
===================================================================
--- trunk/cumin/python/cumin/grid/negotiator.py 2012-10-24 18:43:44 UTC (rev 5521)
+++ trunk/cumin/python/cumin/grid/negotiator.py 2012-10-24 18:45:46 UTC (rev 5522)
@@ -29,6 +29,7 @@
frame = "main.grid.negotiator"
col = ObjectLinkColumn(app, "name", cls.Name, cls._id, frame)
+ col.width="20%"
self.add_column(col)
self.add_attribute_column(cls.Machine)
Modified: trunk/cumin/python/cumin/grid/scheduler.py
===================================================================
--- trunk/cumin/python/cumin/grid/scheduler.py 2012-10-24 18:43:44 UTC (rev 5521)
+++ trunk/cumin/python/cumin/grid/scheduler.py 2012-10-24 18:45:46 UTC (rev 5522)
@@ -78,6 +78,7 @@
frame = "main.grid.scheduler"
col = ObjectLinkColumn(app, "name", cls.Name, cls._id, frame)
+ col.width="20%"
self.add_column(col)
self.add_attribute_column(cls.NumUsers)
Modified: trunk/cumin/python/cumin/grid/submission.py
===================================================================
--- trunk/cumin/python/cumin/grid/submission.py 2012-10-24 18:43:44 UTC (rev 5521)
+++ trunk/cumin/python/cumin/grid/submission.py 2012-10-24 18:45:46 UTC (rev 5522)
@@ -162,6 +162,7 @@
super(PoolSubmissionSelector, self).__init__(app, name)
col = self.PoolSubmissionObjectLinkColumn(app, "name", self.cls.Name, self.cls._id, frame)
+ col.width="20%"
self.insert_column(0, col)
#self.add_search_filter(col)
Modified: trunk/cumin/python/cumin/usergrid/widgets.py
===================================================================
--- trunk/cumin/python/cumin/usergrid/widgets.py 2012-10-24 18:43:44 UTC (rev 5521)
+++ trunk/cumin/python/cumin/usergrid/widgets.py 2012-10-24 18:45:46 UTC (rev 5522)
@@ -114,6 +114,7 @@
frame = "main.submissions.submission"
col = self.UserSubmissionObjectLinkColumn(app, "name", self.cls.Name, self.cls._id, frame)
+ col.width="25%"
self.insert_column(0, col)
#self.add_search_filter(col)
11 years, 6 months
r5521 - in trunk: cumin/python/cumin wooly/python/wooly
by croberts@fedoraproject.org
Author: croberts
Date: 2012-10-24 18:43:44 +0000 (Wed, 24 Oct 2012)
New Revision: 5521
Modified:
trunk/cumin/python/cumin/objectselector.py
trunk/wooly/python/wooly/table.py
trunk/wooly/python/wooly/table.strings
Log:
Adding title to links from from objectselectors
Modified: trunk/cumin/python/cumin/objectselector.py
===================================================================
--- trunk/cumin/python/cumin/objectselector.py 2012-10-23 19:50:40 UTC (rev 5520)
+++ trunk/cumin/python/cumin/objectselector.py 2012-10-24 18:43:44 UTC (rev 5521)
@@ -599,6 +599,9 @@
def render_cell_content(self, session, record):
return len(record) > 0 and record[self.field.index] or ""
+
+ def render_cell_title(self, session, record):
+ return record[self.field.index]
class ObjectSelectorControl(WidgetSet):
def do_render(self, session):
Modified: trunk/wooly/python/wooly/table.py
===================================================================
--- trunk/wooly/python/wooly/table.py 2012-10-23 19:50:40 UTC (rev 5520)
+++ trunk/wooly/python/wooly/table.py 2012-10-24 18:43:44 UTC (rev 5521)
@@ -301,10 +301,13 @@
def render_cell_href(self, session, record):
pass
-
+
class LinkColumnCell(TableColumnCell):
def render_href(self, session, record):
return self.parent.render_cell_href(session, record)
+
+ def render_title(self, session, record):
+ return self.parent.render_cell_title(session, record)
class CheckboxColumnHeader(TableColumnHeader):
def render_name(self, session):
Modified: trunk/wooly/python/wooly/table.strings
===================================================================
--- trunk/wooly/python/wooly/table.strings 2012-10-23 19:50:40 UTC (rev 5520)
+++ trunk/wooly/python/wooly/table.strings 2012-10-24 18:43:44 UTC (rev 5521)
@@ -76,7 +76,7 @@
<span>{options}</span>
[LinkColumnCell.html]
-<td class="{class}"><a href="{href}">{content}</a></td>
+<td class="{class}"><a href="{href}" title="{title}">{content}</a></td>
[CheckboxColumnHeader.javascript]
(function() {
11 years, 6 months
r5520 - trunk/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2012-10-23 19:50:40 +0000 (Tue, 23 Oct 2012)
New Revision: 5520
Modified:
trunk/cumin/python/cumin/objectselector.py
Log:
The selectable field searching will now use case insensitive searching for all text fields.
Modified: trunk/cumin/python/cumin/objectselector.py
===================================================================
--- trunk/cumin/python/cumin/objectselector.py 2012-10-23 19:49:54 UTC (rev 5519)
+++ trunk/cumin/python/cumin/objectselector.py 2012-10-23 19:50:40 UTC (rev 5520)
@@ -4,7 +4,7 @@
from cumin.util import Identifiable, xml_escape, fmt_ddhhmm_timestamp
from rosemary.model import RosemaryClass, RosemaryAttribute, RosemaryReference
-from rosemary.sqlfilter import SqlFilter, SqlLikeFilter, SqlValueFilter, SqlDateValueFilter
+from rosemary.sqlfilter import SqlFilter, SqlLikeFilter, SqlILikeFilter, SqlValueFilter, SqlDateValueFilter
from wooly.util import StringCatalog, Writer, escape_entity, parse_date_from_string
from wooly.datatable import DataTable, DataTableColumn
@@ -458,7 +458,7 @@
pre = "%%"
else:
post = ""
- self.adapter.query.add_filter(self.SelectableFieldLikeFilter(sql_column))
+ self.adapter.query.add_filter(self.SelectableFieldILikeFilter(sql_column))
values[customfield] = "%s%s%s" % (pre, customvalue, post)
@@ -523,6 +523,9 @@
class SelectableFieldLikeFilter(SqlLikeFilter, SelectableFieldFilter):
pass
+ class SelectableFieldILikeFilter(SqlILikeFilter, SelectableFieldFilter):
+ pass
+
class SelectableFieldValueFilter(SqlValueFilter, SelectableFieldFilter):
pass
11 years, 6 months