r5199 - branches/humility/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2012-01-31 21:38:40 +0000 (Tue, 31 Jan 2012)
New Revision: 5199
Added:
branches/humility/cumin/python/cumin/grid/reports.py
branches/humility/cumin/python/cumin/grid/reports.strings
Modified:
branches/humility/cumin/python/cumin/grid/pool.py
Log:
First pass at initial reporting layout
Modified: branches/humility/cumin/python/cumin/grid/pool.py
===================================================================
--- branches/humility/cumin/python/cumin/grid/pool.py 2012-01-31 19:29:52 UTC (rev 5198)
+++ branches/humility/cumin/python/cumin/grid/pool.py 2012-01-31 21:38:40 UTC (rev 5199)
@@ -8,6 +8,7 @@
from cumin.stat import StatFlashChart, StatSet
from cumin.grid.dashboard import PoolDashboard
from cumin.grid.tags import TagsNodeEditTask, TagsFrame, TagInventory
+from cumin.grid.reports import ReportsFrame, ReportsMain
from submission import PoolSubmissionFrame, PoolSubmissionJoinSelector
from slot import SlotFrame
@@ -78,6 +79,9 @@
self.tag = TagsFrame(app, "tag")
self.add_mode(self.tag)
+
+ self.report = ReportsFrame(app, "rep")
+ self.add_mode(self.report)
dashboard = PoolDashboard(app, "dashboard", self.object)
self.view.add_tab(dashboard)
@@ -108,6 +112,9 @@
self.edit_node_tags = TagsNodeEditTask(app, self)
config_editor = TagInventory(app, "tagi")
self.view.add_tab(config_editor)
+
+ self.reports = ReportsMain(app, "reports")
+ self.view.add_tab(self.reports)
self.top_tab = True
Added: branches/humility/cumin/python/cumin/grid/reports.py
===================================================================
--- branches/humility/cumin/python/cumin/grid/reports.py (rev 0)
+++ branches/humility/cumin/python/cumin/grid/reports.py 2012-01-31 21:38:40 UTC (rev 5199)
@@ -0,0 +1,45 @@
+from wooly import *
+from wooly.widgets import RadioModeSet
+
+class ReportsFrame(Frame):
+ def __init__(self, app, name):
+ super(ReportsFrame, self).__init__(app, name)
+
+ def render_title(self, session):
+ return "Reports"
+
+
+class ReportsMain(RadioModeSet):
+ def __init__(self, app, name):
+ super(ReportsMain, self).__init__(app, name)
+
+ self.add_tab(ReportsHostInfo(app, "host"))
+ self.add_tab(ReportsJobInfo(app, "job"))
+ self.add_tab(ReportsUserInfo(app, "user"))
+
+
+ def render_title(self, session):
+ return "Reports"
+
+
+class ReportsHostInfo(Widget):
+ def __init__(self, app, name):
+ super(ReportsHostInfo, self).__init__(app, name)
+
+ def render_title(self, session):
+ return "Host"
+
+
+class ReportsUserInfo(Widget):
+ def __init__(self, app, name):
+ super(ReportsUserInfo, self).__init__(app, name)
+
+ def render_title(self, session):
+ return "User"
+
+class ReportsJobInfo(Widget):
+ def __init__(self, app, name):
+ super(ReportsJobInfo, self).__init__(app, name)
+
+ def render_title(self, session):
+ return "Job"
\ No newline at end of file
Property changes on: branches/humility/cumin/python/cumin/grid/reports.py
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/humility/cumin/python/cumin/grid/reports.strings
===================================================================
12 years, 3 months
r5198 - trunk/cumin/bin
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-01-31 19:29:52 +0000 (Tue, 31 Jan 2012)
New Revision: 5198
Modified:
trunk/cumin/bin/cumin-database
Log:
Use systemctl when available. Maintains compatibility between F15, F16+, RHEL 5, and RHEL 6 which are all slightly different when considering the whole operation set.
BZ785863
Modified: trunk/cumin/bin/cumin-database
===================================================================
--- trunk/cumin/bin/cumin-database 2012-01-30 19:05:05 UTC (rev 5197)
+++ trunk/cumin/bin/cumin-database 2012-01-31 19:29:52 UTC (rev 5198)
@@ -18,7 +18,9 @@
function format-output {
while read line; do
- echo " | $line"
+ if [ -n "$line" ]; then
+ echo " | $line"
+ fi
done
}
@@ -38,15 +40,36 @@
completed=1
for ((c=0; c<=$2; c++))
do
+ echo $1
$1 && completed=0
if [ $completed -eq 0 ]; then
break
fi
sleep 1
+ echo "retrying..."
done
return $completed
}
+# check for existence of systemctl function...
+if [[ -f "/bin/systemctl" ]]; then
+ have_systemd=1
+else
+ have_systemd=0
+fi
+
+function postgresql_str {
+ # There is no supported OS version that has a valid
+ # initdb option for the postgresql.service systemd script.
+
+ # el6 and Fedora F15 support sevice postresql initdb, however
+ if [ $have_systemd -eq 1 ] && [ "$1" != "initdb" ]; then
+ echo systemctl $1 postgresql.service
+ else
+ echo /sbin/service postgresql $1
+ fi
+}
+
function check-environment {
which rpm > /dev/null
@@ -60,7 +83,7 @@
}
function check-started {
- /sbin/service postgresql status &> /dev/null || {
+ $(postgresql_str status) &> /dev/null || {
echo "Error: The database is not running"
if [ "$1" != noadvice ]; then
echo "Hint: Run 'cumin-database start'"
@@ -188,14 +211,14 @@
check-environment || exit 1
check-initialized || exit 1
- /sbin/service postgresql start
+ $(postgresql_str start)
}
function stop {
check-environment || exit 1
check-initialized || exit 1
- /sbin/service postgresql stop
+ $(postgresql_str stop)
}
function restart {
@@ -207,7 +230,7 @@
# Use condrestart to skip restart of stopped service.
# Apparently condstop sometimes fails. Try up to 5 times.
- retry "/sbin/service postgresql condrestart" 5 || {
+ retry "$(postgresql_str condrestart)" 5 || {
echo "postgres restart failed"
exit 1
}
@@ -227,20 +250,18 @@
exit 1
fi
- # On older versions of Postgres (before 8.4), initdb does not exist but
- # using the start option will initialize the database, then start it.
- # Try initdb first, and if it fails try start. The "start" method
- # will leave the service running, which is different than initdb,
- # but that is fine at this point because it is restarted after
- # the call to configure anyway.
+ # Newer systems have a /usr/bin/postgresql-setup script, try to use it first.
if [[ -f "/usr/bin/postgresql-setup" ]]; then
echo -e "using postgresql-setup..."
run "/usr/bin/postgresql-setup initdb"
else
+ # On older versions of Postgres (before 8.4), initdb does not exist but
+ # using the start option will initialize the database, then start it.
+ # Try initdb first, and if it fails try start.
echo -e "\nAttempting to use initdb option..."
- run "/sbin/service postgresql initdb" || {
+ run "$(postgresql_str initdb)" || {
echo -e "\ninitdb option not supported, using start..."
- run "/sbin/service postgresql start"
+ run "$(postgresql_str start)"
}
fi
@@ -328,7 +349,7 @@
echo "Not good enough"
done
- run "/sbin/service postgresql stop" || :
+ run "$(postgresql_str stop)" || :
run "rm -rf /var/lib/pgsql/data"
}
@@ -395,7 +416,7 @@
configure)
configure && {
echo "The database server is configured"
- /sbin/service postgresql status &> /dev/null && {
+ $(postgresql_str status) &> /dev/null && {
echo -e "\nAfter configuration the server must be restarted."
echo -e "Would you like to restart the server now?\n"
get-explicit-confirmation
12 years, 3 months
r5197 - branches
by croberts@fedoraproject.org
Author: croberts
Date: 2012-01-30 19:05:05 +0000 (Mon, 30 Jan 2012)
New Revision: 5197
Added:
branches/humility/
Log:
Feature branch
12 years, 3 months
r5196 - branches
by croberts@fedoraproject.org
Author: croberts
Date: 2012-01-30 18:58:57 +0000 (Mon, 30 Jan 2012)
New Revision: 5196
Removed:
branches/humility/
Log:
Mistake creating humility branch, will retry
12 years, 3 months
r5195 - branches
by croberts@fedoraproject.org
Author: croberts
Date: 2012-01-30 16:01:27 +0000 (Mon, 30 Jan 2012)
New Revision: 5195
Added:
branches/humility/
Log:
Feature branch
12 years, 3 months
r5194 - /
by croberts@fedoraproject.org
Author: croberts
Date: 2012-01-30 15:37:31 +0000 (Mon, 30 Jan 2012)
New Revision: 5194
Removed:
cumin-trunk/
Log:
Removing what must have been a mistake caused by my malfunctioning eclipse plugin.
12 years, 3 months
r5193 - branches/noflash/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2012-01-27 18:16:59 +0000 (Fri, 27 Jan 2012)
New Revision: 5193
Modified:
branches/noflash/cumin/python/cumin/grid/dashboard.strings
Log:
Shrinking width of the dashboard pie chart tables.
Modified: branches/noflash/cumin/python/cumin/grid/dashboard.strings
===================================================================
--- branches/noflash/cumin/python/cumin/grid/dashboard.strings 2012-01-23 22:01:16 UTC (rev 5192)
+++ branches/noflash/cumin/python/cumin/grid/dashboard.strings 2012-01-27 18:16:59 UTC (rev 5193)
@@ -141,7 +141,7 @@
.DefinitionSet dd span {
text-align: right;
- width: 4em;
+ width: 2em;
display: block;
}
12 years, 3 months
r5192 - branches/stability/cumin/python/cumin/inventory
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-01-23 22:01:16 +0000 (Mon, 23 Jan 2012)
New Revision: 5192
Modified:
branches/stability/cumin/python/cumin/inventory/system.py
Log:
Merge revision 5189 from trunk.
BZ782902
Modified: branches/stability/cumin/python/cumin/inventory/system.py
===================================================================
--- branches/stability/cumin/python/cumin/inventory/system.py 2012-01-23 20:50:12 UTC (rev 5191)
+++ branches/stability/cumin/python/cumin/inventory/system.py 2012-01-23 22:01:16 UTC (rev 5192)
@@ -296,30 +296,33 @@
return len(self.get_data(values, options))
def get_data(self, values, options):
- #first, fetch all the sql data, unsorted since we will sort it after merging the wallaby data
+ #first, fetch all the sql data, unsorted since we will sort and limit it after merging the wallaby data
requested_sort_field = options.sort_field
+ requested_limit = options.limit
+ requested_offset = options.offset
options.sort_field = None
+ options.limit = 10000
+ options.offset = 0
sqldata = super(WallabyAndSqlAdapter, self).get_data(values, options)
#now get the wallaby data
wallaby_nodes = self.app.wallaby.get_data(WBTypes.NODES)
data = list()
-
if len(sqldata) > 0 and len(wallaby_nodes) > 0: #means that we have both sesame and wallaby data
#now merge them
for i, node in enumerate(wallaby_nodes):
- match_index = [i for i, y in enumerate(sqldata) if y[1] == node.name]
- if len(match_index) > 0:
- ## merge-in the wallaby data to the matched node entry in sqldata
- new_record = list(sqldata[match_index[0]])
- new_record.append(", ".join(self.app.wallaby.get_tag_names(node)))
- new_record.append(node.last_checkin)
- sqldata[match_index[0]] = tuple(new_record)
- else:
- # there was no match found, add a wallaby-only row
- data_row = tuple([node.name, node.name, "", "", "", "", ", ".join(self.app.wallaby.get_tag_names(node)), node.last_checkin])
- sqldata.append(data_row)
+ match_index = [i for i, y in enumerate(sqldata) if y[1] == node.name]
+ if len(match_index) > 0:
+ ## merge-in the wallaby data to the matched node entry in sqldata
+ new_record = list(sqldata[match_index[0]])
+ new_record.append(", ".join(self.app.wallaby.get_tag_names(node)))
+ new_record.append(node.last_checkin)
+ sqldata[match_index[0]] = tuple(new_record)
+ else:
+ # there was no match found, add a wallaby-only row
+ data_row = tuple([node.name, node.name, "", "", "", "", ", ".join(self.app.wallaby.get_tag_names(node)), node.last_checkin])
+ sqldata.append(data_row)
data = sqldata
elif len(sqldata) > 0: # we only have sesame data
for node in sqldata:
@@ -333,10 +336,12 @@
data_row = tuple([node.name, node.name, "", "", "", "", ", ".join(self.app.wallaby.get_tag_names(node)), node.last_checkin])
data.append(data_row)
- options.sort_field = requested_sort_field
+ options.sort_field = requested_sort_field
+ options.limit = requested_limit
+ options.offset = requested_offset
data = self.sort_rows(data, options)
data = self.limit_rows(data, options)
-
+
return data
def limit_rows(self, rows, options):
12 years, 3 months
r5191 - branches/noflash/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2012-01-23 20:50:12 +0000 (Mon, 23 Jan 2012)
New Revision: 5191
Modified:
branches/noflash/cumin/python/cumin/grid/slotvis.strings
Log:
Specialized alignment (greater width) for slotvis radio options
Modified: branches/noflash/cumin/python/cumin/grid/slotvis.strings
===================================================================
--- branches/noflash/cumin/python/cumin/grid/slotvis.strings 2012-01-23 18:57:29 UTC (rev 5190)
+++ branches/noflash/cumin/python/cumin/grid/slotvis.strings 2012-01-23 20:50:12 UTC (rev 5191)
@@ -17,10 +17,15 @@
float: left;
}
+div.SlotVisChart div.duration {
+ margin: 1em 0 0.5em 1em;
+ width:300px;
+}
+
[PoolSlotFlashVis.html]
<div id="PoolSlotFlashVis">
<h2>Slots</h2>
- <div class="StatValueChart {fullpageable}" id="{id}">
+ <div class="StatValueChart SlotVisChart {fullpageable}" id="{id}">
<h2>{title}</h2>
<div class="slot_visualization">
<div class="duration">{group_by}</div>
12 years, 3 months
r5190 - in branches/noflash/cumin: python/cumin python/cumin/grid resources
by croberts@fedoraproject.org
Author: croberts
Date: 2012-01-23 18:57:29 +0000 (Mon, 23 Jan 2012)
New Revision: 5190
Modified:
branches/noflash/cumin/python/cumin/grid/negotiator.strings
branches/noflash/cumin/python/cumin/stat.strings
branches/noflash/cumin/resources/app.js
Log:
Un-breaking the flash version of slotvis.
Modified: branches/noflash/cumin/python/cumin/grid/negotiator.strings
===================================================================
--- branches/noflash/cumin/python/cumin/grid/negotiator.strings 2012-01-18 20:21:39 UTC (rev 5189)
+++ branches/noflash/cumin/python/cumin/grid/negotiator.strings 2012-01-23 18:57:29 UTC (rev 5190)
@@ -110,7 +110,7 @@
function ofc_resize(left, width, top, height, id)
{
var jsonVals = cumin.get_quota_sum();
- var chart = cumin.getFlashChart(id);
+ var chart = cumin.getChart(id);
if (chart) {
if (typeof chart.setpieslice != "undefined") {
var obj = {'values': jsonVals};
Modified: branches/noflash/cumin/python/cumin/stat.strings
===================================================================
--- branches/noflash/cumin/python/cumin/stat.strings 2012-01-18 20:21:39 UTC (rev 5189)
+++ branches/noflash/cumin/python/cumin/stat.strings 2012-01-23 18:57:29 UTC (rev 5190)
@@ -224,7 +224,7 @@
cumin.expireIntervalUpdate();
return false;
} else {
- var chart = cumin.getFlashChart(id);
+ var chart = cumin.getChart(id);
if ((chart == null) || (typeof $(chart).getParent().getElements('a')[chart_href] == "undefined")) {
if (typeof attempt == "undefined")
attempt = 1;
@@ -240,7 +240,7 @@
}
// called by open-flash-chart.swf in response to chart.geturl()
function get_chart_url(id, url, state) {
- var chart = cumin.getFlashChart(id);
+ var chart = cumin.getChart(id);
if (chart == null)
return false;
@@ -331,7 +331,7 @@
cumin.setupChart('{id}', '{fullpage_href}');
} else {
cumin.forceChart = function () {
- var chart = cumin.getFlashChart('{id}');
+ var chart = cumin.getChart('{id}');
if (chart) {
chart.height = window.getSize().y * 0.96;
}
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2012-01-18 20:21:39 UTC (rev 5189)
+++ branches/noflash/cumin/resources/app.js 2012-01-23 18:57:29 UTC (rev 5190)
@@ -368,11 +368,17 @@
}
}
-cumin.getFlashChart = function (id) {
+cumin.getChart = function (id) {
var chart = $(id.replace(/\./g, "_")+"_chart");
return chart;
}
+/* Only needed for flash-based slotvis, can go away when that is changed */
+cumin.getFlashChart = function (id) {
+ var chart = $(id+"_chart");
+ return chart;
+}
+
function incrementChartSequence(chart) {
var src = chart.src;
var branch = wooly.session.branch(src);
12 years, 3 months