r4933 - trunk/cumin/python/cumin/grid
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-08-16 16:04:54 +0000 (Tue, 16 Aug 2011)
New Revision: 4933
Modified:
trunk/cumin/python/cumin/grid/job.py
Log:
When Cumin requests a job output file from condor, prepend the value of the Iwd
classad attribute to the filename if the filename does not begin with "/"
BZ731065
Modified: trunk/cumin/python/cumin/grid/job.py
===================================================================
--- trunk/cumin/python/cumin/grid/job.py 2011-08-16 15:31:16 UTC (rev 4932)
+++ trunk/cumin/python/cumin/grid/job.py 2011-08-16 16:04:54 UTC (rev 4933)
@@ -917,9 +917,20 @@
return fmt_datetime(now, sec=True)
def do_process(self, session):
+
+ def add_path(path, filename):
+ # If filename does not begin with an absolute
+ # path, prepend the path value to filename
+ if not filename.startswith("/"):
+ if not path.endswith("/"):
+ path += "/"
+ filename = path + filename
+ return filename
+
out_file = None
user_file = None
err_file = None
+ iwd = None
ads, error = self.do_get_items(session)
for ad in ads:
@@ -929,7 +940,16 @@
user_file = ad['value']
elif ad['name'] == "Err":
err_file = ad['value']
+ elif ad['name'] == "Iwd":
+ # Save working directory for path
+ # extension on the above files...
+ iwd = ad['value']
+ if iwd is not None:
+ out_file = add_path(iwd, out_file)
+ err_file = add_path(iwd, err_file)
+ user_file = add_path(iwd, user_file)
+
# set title for radiotab so mouseover will display file name
self.which_file.set_file_name(session, "o", out_file)
self.which_file.set_file_name(session,"e", err_file)
12 years, 8 months
r4932 - in trunk/cumin/python/cumin: . grid
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-16 15:31:16 +0000 (Tue, 16 Aug 2011)
New Revision: 4932
Modified:
trunk/cumin/python/cumin/grid/tags.py
trunk/cumin/python/cumin/grid/tags.strings
trunk/cumin/python/cumin/widgets.py
trunk/cumin/python/cumin/widgets.strings
Log:
Making the hybrid select tool code more portable and moving it to the cumin/widget class so it could be reused.
Modified: trunk/cumin/python/cumin/grid/tags.py
===================================================================
--- trunk/cumin/python/cumin/grid/tags.py 2011-08-15 20:32:42 UTC (rev 4931)
+++ trunk/cumin/python/cumin/grid/tags.py 2011-08-16 15:31:16 UTC (rev 4932)
@@ -329,23 +329,15 @@
def render_title(self, session):
return("Tag name(s): ")
- class TagsList(CheckboxItemSetField):
+ class TagsList(PageableFilteredSelect):
'''
- This class, note the rendering handled in tags.strings::filtered_select_html,
- takes care of displaying the tags for the given node in a filterable select box
+ This class takes care of displaying the tags for the given node in a filterable select box
that is pageable.
'''
def __init__(self, app, name):
- item_parameter = SymbolParameter(app, "tag")
- super(RemoveTags.TagsList, self).__init__(app, name, item_parameter)
- self._tmpl = WidgetTemplate(self, "filtered_select_html")
+ super(RemoveTags.TagsList, self).__init__(app, name)
- def do_render(self, session):
- writer = Writer()
- self._tmpl.render(writer, session)
- return writer.to_string()
-
- def render_tags(self, session):
+ def render_items(self, session):
items = self.do_get_items(session)
tags_string = ""
@@ -504,25 +496,15 @@
def render_form_class(self, session):
return " ".join((super(EditNodeTagsForm, self).render_form_class(session), "mform"))
- class TagsList(CheckboxItemSetField):
+ class TagsList(PageableFilteredSelect):
'''
This class takes care of displaying the tags for the given node in a filterable select box
- that is pageable. Note the rendering handled in tags.strings::filtered_select_html
+ that is pageable.
'''
def __init__(self, app, name):
- item_parameter = SymbolParameter(app, "tag")
- super(EditNodeTagsForm.TagsList, self).__init__(app, name, item_parameter)
- #self._tmpl = WidgetTemplate(self, "double_filtered_select_html")
- self._tmpl = WidgetTemplate(self, "filtered_select_html")
-
- self.update_enabled = False
-
- def do_render(self, session):
- writer = Writer()
- self._tmpl.render(writer, session)
- return writer.to_string()
+ super(EditNodeTagsForm.TagsList, self).__init__(app, name)
- def render_tags(self, session):
+ def render_items(self, session):
items = self.do_get_items(session)
tags_string = ""
@@ -537,18 +519,6 @@
return tags_string
- def render_starting_tags(self, session):
- tags_from_session= self.form.tags.get(session)
- tags_string = ""
- items = []
- if tags_from_session != "":
- items = [x.strip() for x in tags_from_session.split(',')]
-
- for i, tag in enumerate(items):
- tags_string = tags_string + "<option id='init" + str(i) + "'>" + tag + "</option>\n"
-
- return tags_string
-
def do_get_items(self, session):
tags = fetchTags(self, session)
@@ -644,18 +614,11 @@
def render_form_class(self, session):
return " ".join((super(EditTagNodesForm, self).render_form_class(session), "mform"))
- class NodesList(CheckboxItemSetField):
+ class NodesList(PageableFilteredSelect):
def __init__(self, app, name):
- item_parameter = SymbolParameter(app, "tag")
- super(EditTagNodesForm.NodesList, self).__init__(app, name, item_parameter)
- self._tmpl = WidgetTemplate(self, "filtered_select_html")
+ super(EditTagNodesForm.NodesList, self).__init__(app, name)
- def do_render(self, session):
- writer = Writer()
- self._tmpl.render(writer, session)
- return writer.to_string()
-
- def render_nodes(self, session):
+ def render_items(self, session):
items = self.do_get_items(session)
nodes_string = ""
Modified: trunk/cumin/python/cumin/grid/tags.strings
===================================================================
--- trunk/cumin/python/cumin/grid/tags.strings 2011-08-15 20:32:42 UTC (rev 4931)
+++ trunk/cumin/python/cumin/grid/tags.strings 2011-08-16 15:31:16 UTC (rev 4932)
@@ -83,144 +83,4 @@
//]]>
-</script>
-
-
-[NodesList.filtered_select_html]
- <script type="text/javascript">
-//<![CDATA[
-window.addEvent('domready', function (){
- $$('.multiselect').each(function(multiselect){
- new MTMultiWidget({'datasrc': multiselect,
- 'widgetcls':'mtmultiselect',
- 'selectedcls':'selected',
- 'paginator_on_bottom':'true',
- 'items_per_page':15,
- 'case_sensitive':false,
- 'setview':'total'});
- });
-});
-
-//]]>
- </script>
- <tr>
- <th><div class="title">{title}</div></th>
- <td>
- <div style='width:250px;height:375px;'>
- <select class='multiselect' name="{id}.inputs.param" multiple="multiple" id="{id}.inputs.param" size="10" style="width:400px">
- {nodes}
- </select>
- </div>
- </td>
- </tr>
-
-
-[TagsList.filtered_select_html]
- <script type="text/javascript">
-//<![CDATA[
-window.addEvent('domready', function (){
- $$('.multiselect').each(function(multiselect){
- new MTMultiWidget({'datasrc': multiselect,
- 'widgetcls':'mtmultiselect',
- 'selectedcls':'selected',
- 'paginator_on_bottom':'true',
- 'items_per_page':15,
- 'case_sensitive':false,
- 'setview':'total'});
- });
-});
-
-//]]>
- </script>
- <tr>
- <th><div class="title">{title}</div></th>
- <td>
- <div style='width:250px;height:375px;'>
- <select class='multiselect' name="{id}.inputs.param" multiple="multiple" id="{id}.inputs.param" size="10" style="width:400px">
- {tags}
- </select>
- </div>
- </td>
- </tr>
-
-
-
-[TagsList.double_filtered_select_html]
- <script type="text/javascript">
-//<![CDATA[
- MyUtil = new Object();
- MyUtil.selectFilterData = new Object();
- MyUtil.selectFilter = function(selectId, filter) {
- var list = document.getElementById(selectId);
- if(!MyUtil.selectFilterData[selectId]) { //if we don't have a list of all the options, cache them now'
- MyUtil.selectFilterData[selectId] = new Object();
- for(var i = 0; i < list.options.length; i++) MyUtil.selectFilterData[selectId][list.options[i].id] = list.options[i];
- }
-
- //go through all the options in the current list and set the selection status to the cached options
- for(var i = 0; i < list.options.length; i++) MyUtil.selectFilterData[selectId][list.options[i].id] = list.options[i];
-
- list.options.length = 0; //remove all elements from the list
- for(var id in MyUtil.selectFilterData[selectId]) { //add elements from cache if they match filter
- var o = MyUtil.selectFilterData[selectId][id];
- if(o.text.toLowerCase().indexOf(filter.toLowerCase()) >= 0) list.add(o, null);
- }
- }
-
- window.addEvent('domready', function() {
- $('add').addEvent('click', function() {
- $('{id}2.inputs.param').getSelected().each(function(el) {
- el.inject($('{id}.inputs.param'));
- });
- });
- $('remove').addEvent('click', function() {
- $('{id}.inputs.param').getSelected().each(function(el) {
- el.inject($('{id}2.inputs.param'));
- });
- });
- });
-
- // when the form is submitted, we want to grab everything in the "selected tags" box whether it is highlighted or not
- $$('form').each(function(form) {
- form.addEvent('submit',function(event){
- sbox = $('{id}.inputs.param');
- for(var i = 0; i < sbox.length; i++) {
- sbox.options[i].selected = true;
- }
- });
- });
-//]]>
- </script>
-
- <tr>
- <th><div class="title">Filter available tags</div></th>
- <td>
- <input id='{id}.filter' type="text" onkeyup="MyUtil.selectFilter('{id}2.inputs.param', $('{id}.filter').value);"/>
- </td>
- </tr>
- <tr>
- <th><div class="title">Tags</div></th>
- <td>
- <div style="width:500px;">
- <div class='lfloat'>
- <div><label for='{id}2.inputs.param' class='title'>Available Tags</label></div>
- <div>
- <select name="{id}2.inputs.param" multiple="multiple" id="{id}2.inputs.param" size="10" style="width:200px">
- {tags}
- </select>
- </div>
- <div><input type="button" id="add" onclick="javascript:return false;" value="Add to selected tags"/></div>
- </div>
- <div class='rfloat'>
- <div><label for='{id}.inputs.param' class='title'>Selected Tags</label></div>
- <div>
- <select name="{id}.inputs.param" multiple="multiple" id="{id}.inputs.param" size="10" style="width:200px">
- {starting_tags}
- </select>
- </div>
- <div><input type="button" id="remove" onclick="javascript:return false;" value="Remove"/></div>
- </div>
- </div>
- </td>
- </tr>
-
+</script>
\ No newline at end of file
Modified: trunk/cumin/python/cumin/widgets.py
===================================================================
--- trunk/cumin/python/cumin/widgets.py 2011-08-15 20:32:42 UTC (rev 4931)
+++ trunk/cumin/python/cumin/widgets.py 2011-08-16 15:31:16 UTC (rev 4932)
@@ -1573,4 +1573,44 @@
res = self.version_string
if self.version_local:
res += ", devel instance"
- return res
+ return res
+
+class PageableFilteredSelect(CheckboxItemSetField):
+ def __init__(self, app, name):
+ item_parameter = SymbolParameter(app, "iparam")
+ super(PageableFilteredSelect, self).__init__(app, name, item_parameter)
+
+ def render_items(self, session):
+ items = self.do_get_items(session)
+ items_string = ""
+
+ for i, item in enumerate(items):
+ items_string = items_string + "<option id='" + str(i) + "' name='" + item + "' value='" + item + "'" + ">" + item + "</option>"
+
+ return items_string
+
+ def render_datasrc(self, session):
+ return "multiselect"
+
+ def render_class(self, session):
+ return "mtmultiselect"
+
+ def render_selected_class(self, session):
+ return "selected"
+
+ def render_items_per_page(self, session):
+ return 15
+
+ def render_title(self, session):
+ return "Make your selections"
+
+ def render_width(self, session):
+ return "400px"
+
+ def render_container_width(self, session):
+ return "250px"
+
+ def render_container_height(self, session):
+ return "375px"
+
+
\ No newline at end of file
Modified: trunk/cumin/python/cumin/widgets.strings
===================================================================
--- trunk/cumin/python/cumin/widgets.strings 2011-08-15 20:32:42 UTC (rev 4931)
+++ trunk/cumin/python/cumin/widgets.strings 2011-08-16 15:31:16 UTC (rev 4932)
@@ -920,3 +920,31 @@
{version}
</div>
+[PageableFilteredSelect.html]
+<script type="text/javascript">
+//<![CDATA[
+window.addEvent('domready', function (){
+ $$('.multiselect').each(function(multiselect){
+ new MTMultiWidget({'datasrc': {datasrc},
+ 'widgetcls':'{class}',
+ 'selectedcls':'{selected_class}',
+ 'paginator_on_bottom':'true',
+ 'items_per_page':{items_per_page},
+ 'case_sensitive':false,
+ 'setview':'total'});
+ });
+});
+
+//]]>
+ </script>
+ <tr>
+ <th><div class="title">{title}</div></th>
+ <td>
+ <div style='width:{container_width};height:{container_height};'>
+ <select class='{datasrc}' name="{id}.inputs.param" multiple="multiple" id="{id}.inputs.param" size="10" style="width:{width};">
+ {items}
+ </select>
+ </div>
+ </td>
+ </tr>
+
12 years, 8 months
r4931 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-15 20:32:42 +0000 (Mon, 15 Aug 2011)
New Revision: 4931
Modified:
trunk/cumin/python/cumin/grid/tags.py
Log:
Per the UI review, adding a note to clarify that creating multiple tags can be done with a comma separated list.
Modified: trunk/cumin/python/cumin/grid/tags.py
===================================================================
--- trunk/cumin/python/cumin/grid/tags.py 2011-08-15 19:02:32 UTC (rev 4930)
+++ trunk/cumin/python/cumin/grid/tags.py 2011-08-15 20:32:42 UTC (rev 4931)
@@ -290,6 +290,10 @@
return "Create a tag"
class TagNamesField(StringField):
+ def __init__(self, app, name):
+ super(CreateTags.TagNamesField, self).__init__(app, name)
+ self.help = "*Comma separated list"
+
def render_title(self, session):
return("Tag name(s): ")
12 years, 8 months
r4930 - trunk/sage/python/sage/aviary
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-08-15 19:02:32 +0000 (Mon, 15 Aug 2011)
New Revision: 4930
Modified:
trunk/sage/python/sage/aviary/aviaryoperations.py
Log:
Replace localhost in aviary server config strings with result of socket.gethostname()
Modified: trunk/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- trunk/sage/python/sage/aviary/aviaryoperations.py 2011-08-15 18:48:01 UTC (rev 4929)
+++ trunk/sage/python/sage/aviary/aviaryoperations.py 2011-08-15 19:02:32 UTC (rev 4930)
@@ -1,13 +1,16 @@
import os
-
-from suds import *
-from suds.client import Client
-from sage.util import CallSync, CallThread, ObjectPool, host_list
import threading
import logging
import random
import urllib2
+import socket
+import string
+from suds import *
+from suds.client import Client
+from sage.util import CallSync, CallThread, ObjectPool, host_list
+
+
log = logging.getLogger("sage.aviary")
#f = open("./suds.client.log", 'a+')
@@ -60,13 +63,18 @@
# job_servers and query_servers are comma separated lists of
# network locations. See comments on host_port_list for format.
+ # Replace any occurrence of locahost with output of gethostname()
+ # before parsing to match Machine fields of QMF objects later on.
+ host = socket.gethostname()
+ job_servers = string.replace(job_servers, "localhost", host)
+ query_servers = string.replace(query_servers, "localhost", host)
+
self.job_servers = host_list(job_servers,
default_scheme = "http",
default_port="9090",
default_path="/services/job/")
-
- self.query_servers = host_list(job_servers,
+ self.query_servers = host_list(query_servers,
default_scheme = "http",
default_port="9091",
default_path="/services/query/")
12 years, 8 months
r4929 - trunk/wooly/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-15 18:48:01 +0000 (Mon, 15 Aug 2011)
New Revision: 4929
Modified:
trunk/wooly/resources/mootools.js
Log:
Changing the hybrid select box from using the annoying href="#" (which requires an extra back button click to go back) to href='' with the onclick handler returning false to avoid page navigation.
Modified: trunk/wooly/resources/mootools.js
===================================================================
--- trunk/wooly/resources/mootools.js 2011-08-15 18:08:19 UTC (rev 4928)
+++ trunk/wooly/resources/mootools.js 2011-08-15 18:48:01 UTC (rev 4929)
@@ -1787,18 +1787,19 @@
for(var i = this.page; i <= this.page + 6 && i <= numpages; i++){
this.controls.grab(new Element('a', {'text': i,
- 'href': '#cpcspswdnbd',
+ 'href': '',
'class': (i == this.page) ? 'selected' : '',
'events': {
'click': function(evt){
this.setpagenum(evt.target.innerHTML);
this.fireEvent('rebuild', [list]); // wrapped list
+ return false;
}.bind(this)}
}), 'bottom');
}
var nextbtn = new Element('a', {'text':'Next',
- 'href':'#cpcspswdnbd'});
+ 'href':''});
this.controls.grab(nextbtn);
nextbtn.addClass('disabled');
@@ -1807,11 +1808,12 @@
nextbtn.addEvent('click', function(evt){
this.pageup();
this.fireEvent('rebuild');
+ return false;
}.bind(this));
}
var lastbtn = new Element('a', {'text':'Last',
- 'href':'#cpcspswdnbd'});
+ 'href':''});
this.controls.grab(lastbtn);
lastbtn.addClass('disabled');
@@ -1820,6 +1822,7 @@
lastbtn.addEvent('click', function(evt){
this.pagelast(numpages);
this.fireEvent('rebuild');
+ return false;
}.bind(this));
}
@@ -1931,7 +1934,7 @@
makebtn: function(label, func, prefix){
var li = new Element('li');
var btn = new Element('a', {'html': label,
- 'href': '#',
+ 'href': '',
'events': {
// You might have to bind this differently
'click': func.bind(this)
@@ -1953,6 +1956,7 @@
},
this.RESETINPUT
);
+ return false;
},
showselected: function(){
this.filter(this.options.datasrc.getChildren(),
@@ -1961,6 +1965,7 @@
},
this.RESETINPUT
);
+ return false;
},
showunselected:function(){
this.filter(this.options.datasrc.getChildren(),
@@ -1969,6 +1974,7 @@
},
this.RESETINPUT
);
+ return false;
},
selectAll:function(){
this.options.datasrc.getChildren().each(
@@ -1978,6 +1984,7 @@
);
this.fireEvent('rebuild', [this.options.datasrc.getChildren()]);
this.update(this.options.datasrc.getChildren().length);
+ return false;
},
selectNone:function(){
this.options.datasrc.getChildren().each(
@@ -1987,6 +1994,7 @@
);
this.fireEvent('rebuild', [this.options.datasrc.getChildren()]);
this.update(0);
+ return false;
},
// list is the list of option dom elements from the select elem
@@ -2022,6 +2030,7 @@
);
this.fireEvent('rebuild', [results]);
this.update(this.numselected + adds);
+ return false;
},
update: function(numselected){
12 years, 8 months
r4928 - trunk/wooly/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-15 18:08:19 +0000 (Mon, 15 Aug 2011)
New Revision: 4928
Modified:
trunk/wooly/resources/mootools.js
Log:
changes for consistency in labels.
Modified: trunk/wooly/resources/mootools.js
===================================================================
--- trunk/wooly/resources/mootools.js 2011-08-15 18:06:36 UTC (rev 4927)
+++ trunk/wooly/resources/mootools.js 2011-08-15 18:08:19 UTC (rev 4928)
@@ -1759,7 +1759,7 @@
var numpages = this.numpages(list);
this.controls.empty();
- var firstbtn = new Element('a', {'text':'first',
+ var firstbtn = new Element('a', {'text':'First',
'href':'javascript:void(0)'});
this.controls.grab(firstbtn, 'top');
firstbtn.addClass('disabled');
@@ -1772,7 +1772,7 @@
}.bind(this));
}
- var prevbtn = new Element('a', {'text':'prev',
+ var prevbtn = new Element('a', {'text':'Prev',
'href':'javascript:void(0)'});
this.controls.grab(prevbtn, 'bottom');
prevbtn.addClass('disabled');
@@ -1797,7 +1797,7 @@
}), 'bottom');
}
- var nextbtn = new Element('a', {'text':'next',
+ var nextbtn = new Element('a', {'text':'Next',
'href':'#cpcspswdnbd'});
this.controls.grab(nextbtn);
nextbtn.addClass('disabled');
@@ -1810,7 +1810,7 @@
}.bind(this));
}
- var lastbtn = new Element('a', {'text':'last',
+ var lastbtn = new Element('a', {'text':'Last',
'href':'#cpcspswdnbd'});
this.controls.grab(lastbtn);
lastbtn.addClass('disabled');
12 years, 8 months
r4927 - in trunk: cumin/bin cumin/etc cumin/python/cumin sage/python/sage/aviary
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-08-15 18:06:36 +0000 (Mon, 15 Aug 2011)
New Revision: 4927
Modified:
trunk/cumin/bin/cumin-web
trunk/cumin/etc/cumin.conf
trunk/cumin/python/cumin/config.py
trunk/cumin/python/cumin/main.py
trunk/sage/python/sage/aviary/aviaryoperations.py
Log:
Add aviary-job-servers and aviary-query-servers values to cumin.conf.
Aviary operations will select an available server at random from
the list of servers running on a particular host (host is derived
from context based on the operation, ie from the scheduler object
associated with a job for job operations).
Modified: trunk/cumin/bin/cumin-web
===================================================================
--- trunk/cumin/bin/cumin-web 2011-08-15 17:45:52 UTC (rev 4926)
+++ trunk/cumin/bin/cumin-web 2011-08-15 18:06:36 UTC (rev 4927)
@@ -16,17 +16,15 @@
def set_aviary_configs(cumin, values):
cumin.use_aviary = values.use_aviary
- cumin.aviary_host = values.aviary_host
- cumin.aviary_job_host = values.aviary_job_host
- cumin.aviary_query_host = values.aviary_query_host
- cumin.aviary_job_port = values.aviary_job_port
- cumin.aviary_query_port = values.aviary_query_port
+ cumin.aviary_job_servers = values.aviary_job_servers
+ cumin.aviary_query_servers = values.aviary_query_servers
-
def set_wallaby_configs(cumin, values, brokers):
if values.wallaby_broker == "":
cumin.wallaby_broker = brokers[0]
else:
+ if values.wallaby_broker == "None":
+ values.wallaby_broker = None
cumin.wallaby_broker = values.wallaby_broker
# Let 0 indicate "no timeout", since the timeout
# value is an int in the config and None can't be
Modified: trunk/cumin/etc/cumin.conf
===================================================================
--- trunk/cumin/etc/cumin.conf 2011-08-15 17:45:52 UTC (rev 4926)
+++ trunk/cumin/etc/cumin.conf 2011-08-15 18:06:36 UTC (rev 4927)
@@ -13,11 +13,12 @@
[common]
# database: dbname=cumin user=cumin host=localhost
# brokers: localhost:5672
-# sasl-mech-list: [allow all available mechanisms]
+# sasl-mech-list: [default, allow all available mechanisms]
+# wallaby-broker: [default, first item in 'brokers' list]
+# wallaby-refresh: 60
# use-aviary: True
-# aviary-host: localhost
-# aviary-job-port: 9090
-# aviary-query-port: 9091
+# aviary-job-servers: http://localhost:9090
+# aviary-query-servers: http://localhost:9091
# log-level: info
# log-max-mb: 10
# log-max-archives: 1
@@ -141,6 +142,43 @@
# [common]
+# 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
+# and messaging information. The default value is the
+# first item in the 'brokers' list if not specified. To
+# turn off interaction with Wallaby, set wallaby-broker to
+# the string 'None'.
+
+# wallaby-refresh: 60
+# How often in seconds to contact the Wallaby agent
+# for updated information.
+
+# use-aviary: True
+# Whether or not to use the Aviary services for
+# remote procedure calls to condor. If this is
+# set to False, the QMF interface will be used
+# instead.
+
+# aviary-job-servers: http://localhost:9090
+# Specifies the URIs for aviary job servers. The value
+# is a comma separated list of URIs. A full URI has the
+# form 'scheme://user/password@host:port/path". The scheme
+# will default to http if not specified, the port will
+# default to 9090, and the path will default to
+# /services/job/. User and password will be empty by
+# default. As a convenience, a URI that explicitly
+# sets a port number may be followed by one or more
+# port numbers separated by commas to specify
+# mulitple job servers whose URIs differ only
+# by port number.
+
+# aviary-query-servers: http://localhost:9091
+# Like aviary-job-servers but specifies URIs for aviary
+# query servers. The port value defaults to 9091 and the
+# path defaults to /services/query/. Other
+# defaults are as noted for aviary-job-servers.
+
# log-max-mb: 10
# Maximum size in MB of *.log files created by cumin.
# A log file reaching maximum size will be rolled over.
Modified: trunk/cumin/python/cumin/config.py
===================================================================
--- trunk/cumin/python/cumin/config.py 2011-08-15 17:45:52 UTC (rev 4926)
+++ trunk/cumin/python/cumin/config.py 2011-08-15 18:06:36 UTC (rev 4927)
@@ -158,24 +158,12 @@
param = ConfigParameter(self, "use-aviary", bool)
param.default = True
- param = ConfigParameter(self, "aviary-host", str)
- param.default = "localhost"
+ param = ConfigParameter(self, "aviary-job-servers", str)
+ param.default = "http://localhost:9090"
- # Use aviary-host for all services, unless these are
- # set explicitly as an override. This allows different
- # services to be hosted on different machines if desired.
- param = ConfigParameter(self, "aviary-job-host", str)
- param.default = ""
+ param = ConfigParameter(self, "aviary-query-servers", str)
+ param.default = "http://localhost:9091"
- param = ConfigParameter(self, "aviary-query-host", str)
- param.default = ""
-
- param = ConfigParameter(self, "aviary-job-port", int)
- param.default = 9090
-
- param = ConfigParameter(self, "aviary-query-port", int)
- param.default = 9091
-
self.log_file = ConfigParameter(self, "log-file", str)
param = ConfigParameter(self, "log-level", str)
Modified: trunk/cumin/python/cumin/main.py
===================================================================
--- trunk/cumin/python/cumin/main.py 2011-08-15 17:45:52 UTC (rev 4926)
+++ trunk/cumin/python/cumin/main.py 2011-08-15 18:06:36 UTC (rev 4927)
@@ -85,11 +85,8 @@
# These values are expected to be filled in if
# use_aviary is left True.
self.use_aviary = True
- self.aviary_host = None
- self.aviary_job_host = None
- self.aviary_query_host = None
- self.aviary_job_port = None
- self.aviary_query_port = None
+ self.aviary_job_servers = ""
+ self.aviary_query_servers = ""
self.wallaby = None
self.wallaby_broker = None
@@ -173,17 +170,9 @@
from sage.aviary.aviaryoperations import AviaryOperations
aviary_dir = os.path.join(self.home, "rpc-defs/aviary")
- # If aviary_job_host or aviary_query_host are "" or
- # None then they inherit the value of aviary_host.
- if not self.aviary_job_host:
- self.aviary_job_host = self.aviary_host
- if not self.aviary_query_host:
- self.aviary_query_host = self.aviary_host
ops.insert(0, AviaryOperations("aviary", aviary_dir,
- self.aviary_job_host,
- self.aviary_job_port,
- self.aviary_query_host,
- self.aviary_query_port))
+ self.aviary_job_servers,
+ self.aviary_query_servers))
self.remote.add_mechanisms(ops)
# Create RPC interface for Wallaby
Modified: trunk/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- trunk/sage/python/sage/aviary/aviaryoperations.py 2011-08-15 17:45:52 UTC (rev 4926)
+++ trunk/sage/python/sage/aviary/aviaryoperations.py 2011-08-15 18:06:36 UTC (rev 4927)
@@ -2,9 +2,11 @@
from suds import *
from suds.client import Client
-from sage.util import CallSync, CallThread, ObjectPool
+from sage.util import CallSync, CallThread, ObjectPool, host_list
import threading
import logging
+import random
+import urllib2
log = logging.getLogger("sage.aviary")
@@ -49,29 +51,26 @@
- can we use default/timeout with suds?
yes, there is at least a timeout that can be set once,
it might be possible to change the timeout per call.
-
-- Add some nice error message that indicates the connection was
-refused to the aviary service. This probably means that aviary
-is not running on that port -- more helpful than "connection refulsed"
'''
class AviaryOperations(object):
- def __init__(self, name, datadir, job_host, job_port, query_host, query_port):
- assert type(job_host) is str
- assert type(query_host) is str
-
+ def __init__(self, name, datadir, job_servers, query_servers):
self.name = name
self.datadir = datadir
- # Add http:// if there is no protocol...
- if job_host.find("://") < 0:
- job_host = "http://" + job_host
- if query_host.find("://") < 0:
- query_host = "http://" + query_host
+ # job_servers and query_servers are comma separated lists of
+ # network locations. See comments on host_port_list for format.
+ self.job_servers = host_list(job_servers,
+ default_scheme = "http",
+ default_port="9090",
+ default_path="/services/job/")
+
+
+ self.query_servers = host_list(job_servers,
+ default_scheme = "http",
+ default_port="9091",
+ default_path="/services/query/")
- self.job_url = job_host + ":" + str(job_port) + "/services/job/"
- self.query_url = query_host + ":" + str(query_port) + "/services/query/"
-
job_wsdl = "file:" + os.path.join(self.datadir, "aviary-job.wsdl")
query_wsdl = "file:" + os.path.join(self.datadir, "aviary-query.wsdl")
@@ -89,15 +88,19 @@
def my_callback(result):
self.job_client_pool.return_object(job_client)
+ result = self._pretty_result(result, scheduler.Machine)
# massage results for use by standard callback
cb_args = self._cb_args_dataless(result)
callback(*cb_args)
- url = self.job_url + "setJobAttribute"
- #print "Aviary set job attribute " + url
+ host = self._get_host(scheduler.Machine, self.job_servers)
+ if host == "":
+ self._raise_no_host(scheduler.Machine)
+ service = host + "setJobAttribute"
+
# Have to set the URL for the method. This might go away someday...
- job_client.set_options(location=url)
+ job_client.set_options(location=service)
# Make a job id parameter (see job wsdl)
jobId = job_client.factory.create('ns0:JobID')
@@ -124,6 +127,7 @@
# so allow_overrides isn't set for someone else...
job_client.set_allow_overrides(False)
self.job_client_pool.return_object(job_client)
+ result = self._pretty_result(result, scheduler.Machine)
if isinstance(result, Exception):
callback(result, None)
else:
@@ -133,11 +137,14 @@
status = AviaryOperations._get_status(result.status)
callback(status, result.id)
- url = self.job_url + "submitJob"
- #print "Aviary submit job " + url
+ host = self._get_host(scheduler.Machine, self.job_servers)
+ if host == "":
+ self._raise_no_host(scheduler.Machine)
+ service = host + "submitJob"
+
# Have to set the URL for the method. This might go away someday...
- job_client.set_options(location=url)
+ job_client.set_options(location=service)
# Set basic attributes in the order defined by aviary-job.wsdl.
args = list()
@@ -217,6 +224,25 @@
return {int: "INTEGER", float: "FLOAT", str: "STRING", bool: "BOOLEAN"}
@classmethod
+ def _get_host(cls, name, servers):
+ host = ""
+ if name in servers:
+ urls = servers[name]
+ if len(urls) > 0:
+ host = str(random.sample(urls, 1)[0])
+ # A particular method name is going to be appended to path,
+ # so ensure the file "/" here. Since we supply default path
+ # values when the host list is parsed, we know the last portion
+ # of the host string has to be a path.
+ if not host.endswith("/"):
+ host += "/"
+ return host
+
+ @classmethod
+ def _raise_no_host(cls, name):
+ raise Exception("No aviary job servers specified for %s, check config files" % name)
+
+ @classmethod
def _get_status(cls, result):
# For Aviary operations, if the operation
# did not work the reason is in the text field.
@@ -236,6 +262,12 @@
status = AviaryOperations._get_status(result)
return (status, None)
+ @classmethod
+ def _pretty_result(cls, result, host):
+ if isinstance(result, urllib2.URLError):
+ return Exception("Trouble reaching host %s, %s" % (host, result.reason))
+ return result
+
def _call_sync(self, process_results, meth, *meth_args, **meth_kwargs):
# Common interface with QMF operations requires that a MethodResult
# object (or something just like it) be returned for synchronous calls.
@@ -253,13 +285,18 @@
def _control_job(self, scheduler, job_id, reason, meth_name,
callback, default, timeout):
- url = self.job_url + meth_name
+ host = self._get_host(scheduler.Machine, self.job_servers)
+ if host == "":
+ self._raise_no_host(scheduler.Machine)
+
+ service = host + meth_name
+
client = self.job_client_pool.get_object()
meth = getattr(client.service, meth_name)
# Have to set the URL for the method. This might go away someday...
#print "Aviary control job " + url
- client.set_options(location=url)
+ client.set_options(location=service)
# Make a job id parameter (see job wsdl)
jobId = client.factory.create('ns0:JobID')
@@ -270,13 +307,20 @@
if callback:
def my_callback(result):
self.job_client_pool.return_object(client)
+ # Fix up the exception message if necessary
+ result = self._pretty_result(result, scheduler.Machine)
cb_args = self._cb_args_dataless(result)
callback(*cb_args)
t = CallThread(meth, my_callback, jobId, reason)
t.start()
else:
- res = self._call_sync(self._cb_args_dataless, meth, jobId, reason)
+ def my_process_results(result):
+ # Fix up the exception message if necessary
+ result = self._pretty_result(result, scheduler.Machine)
+ return self._cb_args_dataless(result)
+
+ res = self._call_sync(my_process_results, meth, jobId, reason)
self.job_client_pool.return_object(client)
return res;
12 years, 8 months
r4926 - trunk/wooly/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-15 17:45:52 +0000 (Mon, 15 Aug 2011)
New Revision: 4926
Modified:
trunk/wooly/resources/mootools.js
Log:
Correcting count when using the "select filtered" option.
Modified: trunk/wooly/resources/mootools.js
===================================================================
--- trunk/wooly/resources/mootools.js 2011-08-15 14:55:24 UTC (rev 4925)
+++ trunk/wooly/resources/mootools.js 2011-08-15 17:45:52 UTC (rev 4926)
@@ -2011,13 +2011,17 @@
filter_by_text = function(item){ return item.text.toLowerCase().contains($('filterbox').value.toLowerCase()) };
}
results = this.filter(this.options.datasrc.getChildren(), filter_by_text, false);
+ var adds = 0;
results.each(
function(item){
- item.selected = true;
+ if(!item.selected) {
+ adds++; // how many more need to be counted as "selected"
+ }
+ item.selected = true;
}
);
this.fireEvent('rebuild', [results]);
- this.update(this.options.datasrc.getChildren().length);
+ this.update(this.numselected + adds);
},
update: function(numselected){
12 years, 8 months
r4925 - trunk/wooly/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-15 14:55:24 +0000 (Mon, 15 Aug 2011)
New Revision: 4925
Modified:
trunk/wooly/resources/mootools.js
Log:
Adding "select filtered" functionality to the large select widget.
Modified: trunk/wooly/resources/mootools.js
===================================================================
--- trunk/wooly/resources/mootools.js 2011-08-15 14:54:37 UTC (rev 4924)
+++ trunk/wooly/resources/mootools.js 2011-08-15 14:55:24 UTC (rev 4925)
@@ -1850,7 +1850,8 @@
'selected': 'Selected:',
'unselected': 'Unselected:',
'selectall': 'Select all',
- 'selectnone': 'Select none',
+ 'selectedfiltered':'Select filtered',
+ 'selectnone': 'Clear',
'filter': 'Filter',
'in': 'in',
'out': 'out',
@@ -1886,12 +1887,12 @@
this.showunselected,
this.options.datasrc.getChildren().length - this.numselected);
ul.grab(this.unselectedbtn);
+
+ this.selectFilteredBtn = this.makebtn(this.options.labels.selectedfiltered,
+ this.selectFiltered,
+ '');
+ ul.grab(this.selectFilteredBtn);
- this.selectAllBtn = this.makebtn(this.options.labels.selectall,
- this.selectAll,
- '');
- ul.grab(this.selectAllBtn);
-
this.selectNoneBtn = this.makebtn(this.options.labels.selectnone,
this.selectNone,
'');
@@ -1902,6 +1903,7 @@
// that filters based on what's been entered in the textfield
filterbox_container = new Element('div', {'class': 'mtms_filterbox'});
this.filterbox = new Element('input', {
+ 'id':'filterbox',
'events': {
'keyup': function(evt){
if(this.options.case_sensitive){
@@ -1986,7 +1988,7 @@
this.fireEvent('rebuild', [this.options.datasrc.getChildren()]);
this.update(0);
},
-
+
// list is the list of option dom elements from the select elem
// test is a function that gets used in the filter
filter: function(list, test, reset){
@@ -1998,7 +2000,26 @@
this.filterbox.value = "";
}
this.fireEvent('rebuild', [results]);
+ return results; //returning in the even that someone wants to do a filter(...).each()
},
+
+ selectFiltered:function() {
+ var filter_by_text = "";
+ if(this.options.case_sensitive){
+ filter_by_text = function(item){ return item.text.contains($('filterbox').value)};
+ } else {
+ filter_by_text = function(item){ return item.text.toLowerCase().contains($('filterbox').value.toLowerCase()) };
+ }
+ results = this.filter(this.options.datasrc.getChildren(), filter_by_text, false);
+ results.each(
+ function(item){
+ item.selected = true;
+ }
+ );
+ this.fireEvent('rebuild', [results]);
+ this.update(this.options.datasrc.getChildren().length);
+ },
+
update: function(numselected){
var total = this.options.datasrc.getChildren().length;
this.totalbtn.getElement('span').set('text', total);
12 years, 8 months
r4924 - trunk/sage/python/sage/wallaby
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-08-15 14:54:37 +0000 (Mon, 15 Aug 2011)
New Revision: 4924
Modified:
trunk/sage/python/sage/wallaby/wallabyoperations.py
Log:
Test for null broker in wallaby operations, don't start the caching thread
if the broker is null.
Modified: trunk/sage/python/sage/wallaby/wallabyoperations.py
===================================================================
--- trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-08-12 19:56:19 UTC (rev 4923)
+++ trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-08-15 14:54:37 UTC (rev 4924)
@@ -229,12 +229,14 @@
self._stop = False
-# self._maintain_cache = CallThread(cProfile.runctx('maintain_cache(self)', globals(), locals(), filename='sage.stats'), None)
- self._maintain_cache = CallThread(maintain_cache, None, self)
- self._maintain_cache.daemon = True
- self._maintain_cache.start()
- log.debug("WallabyOperations: start cache maintenance thread")
- return True
+ if self.broker_uri is not None:
+# self._maintain_cache = CallThread(cProfile.runctx('maintain_cache(self)', globals(), locals(), filename='sage.stats'), None)
+ self._maintain_cache = CallThread(maintain_cache, None, self)
+ self._maintain_cache.daemon = True
+ self._maintain_cache.start()
+ log.debug("WallabyOperations: start cache maintenance thread")
+ return True
+ return False
def stop(self, wait=False, timeout=None):
'''
@@ -577,11 +579,29 @@
def get_names(self, *args, **kwargs):
return []
+ def get_node_by_name(self, *args, **kwargs):
+ return None
+
+ def get_group_by_name(self, *args, **kwargs):
+ return None
+
+ def get_tag_by_name(self, *args, **kwargs):
+ return None
+
def get_node_names(self, *args, **kwargs):
return []
def get_tag_names(self, *args, **kwargs):
return []
+ def create_tag(self, *args, **kwargs):
+ return False
+
+ def remove_tag(self, *args, **kwargs):
+ return False
+
+ def edit_tags(self, *args, **kwargs):
+ return False
+
def set_interval(self, *args, **kwargs):
pass
12 years, 8 months