common.services.process package¶
Submodules¶
common.services.process.HtmlProcessJobStatus module¶
File HtmlProcessJobStatus.py Author WJ Vriend (wjvriend@astro.rug.nl)
Module with common class for showing the status and overview of a single job
-
class
common.services.process.HtmlProcessJobStatus.
HtmlProcessJobStatus
(parent, args)¶ Bases:
common.services.general.HtmlBase.HtmlBase
-
GetImageLink
(obj)¶ (overridde) return preview or image link
-
getDbViewLink
(obj)¶ (override) return link to DbView for this object
-
getExtraTableData
(obj)¶ (override) derived classes can define extra table elements (td) for the object overview table
-
getExtraTableHeading
()¶ (override) derived classes can define extra heading elements (th) for the object overview table
-
getHtml
()¶ generate html
-
getJobStatus
(dpu)¶ Return html page with the job status
- A job info dict example:
- JobID 121841 User awwvriend JobStatus SENDDATA DateSubmitted Tue Mar 24 15:25:52 2015 JobDetails FINISHED N/E/A/S/U 0/27/5/0/0
- with per sub job:
- SubJobStatus ERROR: TERMINATED at Tue Mar 24 15:30:52 2015 SubJobTime 1427207183.96 SubJobNode omegacen@node036.cm.cluster
-
getLiExtra
()¶ (override) return extra <li> messages, shown on top of the the page
-
getQualityLink
(obj)¶ (overridde) return link to quality server
-
handleLogsJobs
(dpu, results, job_dicts)¶ handle the returned logs and jobs from the dpu
-
setErrors
(tmpl)¶ display erros
-
setResults
(tmpl)¶ display results (objects) of job
-
tryInstantiateObject
(cls, object_id)¶ try to instantiate an object, for the given class and object_id
-
common.services.process.HtmlProcessJobs module¶
File HtmlProcessJobs.py Author WJ Vriend (wjvriend@astro.rug.nl)
-
class
common.services.process.HtmlProcessJobs.
DpuQuery
(*args, **kwargs)¶ Bases:
common.config.ProfileThread.ProfileThread
class for querying all dpus in seperate threads and retrieving job info of the current user
-
query_current_user
()¶ get all jobs from the dpu for the current user
-
-
class
common.services.process.HtmlProcessJobs.
HtmlProcessJobs
(parent, args)¶ Bases:
common.services.general.HtmlBase.HtmlBase
class for generating an overview of the user jobs on all dpus the parent object could implement :
test_version attribute to indicate a test version is running (True) or not (False), affects the dpu’s being shown setStatusMsg messages are being pushed to this method-
classmethod
deleteJob
(dpu_name, job_id)¶ delete the specified job from the dpu
-
dpu_timeout
= 1¶
-
extractProjectFromInfo
(result)¶ Try to extract the project from one of the SubJobs dicts project is encoded in SubJobInfo as “my info string (project)”
-
classmethod
getDPU
(dpu_name)¶ return dpu with name dpu_name
-
getDPUs
()¶ Return list of dpu hostnames Exclude test dpu’s when not in test mode
-
classmethod
getDpuKey
(username)¶ Return the key or password to use for the DPU, normally the password of the user is used as DPU key, but in case of SSO there is only the sso_ticket. Since the SSO ticket will change over time for an user, generate a key that doesn’t.
-
getExtraJavaScript
()¶ (override) return extra javascript code to include
-
getHtml
()¶ generate html
-
classmethod
get_dpu_url
(dpu)¶ return the dpu url
-
queryDPUs
()¶ query all DPU’s in a separate thread for their job overview
-
setStatusMsg
(msg)¶ push messsage to parent, if defined
-
showDPUs
()¶ show the status of the dpu’s
-
showJob
()¶ show the details of a job
-
showJobs
()¶ generate the html to show the job overview
-
showOldLogs
()¶ show the overview of old logs
-
show_prevlogs
= True¶
-
status_letters
= 'QRFEASU'¶
-
table_class
= 'ProcessTable tablesorter'¶
-
table_id
= 'table_jobs'¶
-
wait_for_threads
(query_list)¶ wait for the threads to finish or dpu_timeout is reached
-
classmethod
-
exception
common.services.process.HtmlProcessJobs.
HtmlProcessJobsError
¶ Bases:
Exception
-
class
common.services.process.HtmlProcessJobs.
HtmlProcessLogs
(parent, args)¶ Bases:
common.services.general.HtmlDir.HtmlDir
-
filter_filename
(filename)¶ only use show filename if username is in it
-
list_filename
(filename_list)¶ reverse the sorting of the filenames
-
common.services.process.HtmlProcessTree module¶
Module with the HtmlProcessTree class
-
class
common.services.process.HtmlProcessTree.
HtmlProcessTree
(obj, obj_class, set_count=0, sub_count=0, config=None, stats=None, parent=None)¶ Bases:
object
Class generates a html tree of an object and its dependencies, showing the state of the object and dependencies
-
BackgroundColor
= {-24: '#ffcccc', -23: '#ddf', -22: '#ffcc99', -21: '#88ee88', -14: '#ffcccc', -13: '#ffcccc', -12: '#ffcc99', -11: '#ccffcc', -10: '#ffcccc', -1: '#ffcccc', 1: '#ccffcc', 999: '#f3f3ff', 1001: '#f3f3ff', 1002: '#ddf', 1003: '#ddf'}¶
-
Color_Blue
= '#ddf'¶
-
Color_DarkGreen
= '#88ee88'¶
-
Color_Green
= '#ccffcc'¶
-
Color_Orange
= '#ffcc99'¶
-
Color_Red
= '#ffcccc'¶
-
Color_Transparent
= '#f3f3ff'¶
-
EMPTY_LIST_DEPENDENCY
= 1003¶
-
LIST_DEPENDENCY
= 1002¶
-
MainStatusText
= {-24: '(no object found)', -23: '(to be built)', -22: '(new version available)', -21: '(fixed)', -14: '(flagged)', -13: '(outdated)', -12: '(obsolete)', -11: '(dependency missing)', -10: '(outdated)', -1: '(rebuild)', 1: '', 999: '(not checked)', 1001: '(null)', 1002: '(list)', 1003: '(empty list)'}¶
-
NULL_DEPENDENCY
= 1001¶
-
SubStatusText
= {-24: 'no object', -23: 'new object', -22: 'SHOULD NOT OCCUR !!', -21: 'fixed', -15: 'not target processor', -14: 'flag set', -13: 'parameter', -12: 'obsolete', -11: 'missing', -10: 'new version', -1: 'rebuild', 1: 'good', 1001: 'null', 1002: 'list', 1003: 'empty list'}¶
-
convertTreeElem
(obj, txt_tree, object_text, fixed_status)¶ convert an element from the object list to html <li> item with tooltip
-
convertTreeProcessParams
(process_params, txt_tree)¶ convert an object process_params to html <li> item with tooltip
-
formatObjectForErrors
(obj, all_objects)¶ Format object from the uptodate dict
-
generateLIid
(class_string)¶ generate an unique id for the HTML LI element
-
getHtml
()¶ generate html
-
getObjectOverviewTableElements
(uptodate_dict, obj)¶ (override) return the name,value pairs for the object overview table
-
getObjectOverviewTableErrors
(uptodate_dict, obj)¶ (override) return the name,value pairs for the object overview table that are erronuous
-
getOnTheFlyValue
(obj, txt_tree)¶ (overridde) determine and return onthefly status
-
makeHtmlTree
()¶ make a html tree from the generated list
-
makeObjectOverviewTable
(uptodate_val, uptodate_dict, obj)¶ make an overview table of the object, this can be used in a tooltip, showing a popup window
-
classmethod
makeObjectString
(obj)¶ (override) make an object specific string, default is object_id derived classes can use multiple attributes seperating them with cls.object_id_sep
-
object_id_sep
= '|'¶
-
process_object_dialog_width
= 500¶
-
process_params_dialog_width
= 300¶
-
show_process_parameters
= False¶
-
skipObject
(parent_class, obj)¶ (override) return True if object does not need to be recursed default False
-
tip_table_class
= 'ProcessTipTable'¶
-
walkObjectTree
(obj, obj_class=None, txt_tree='', depth=0)¶ make a html tree view from an object (obj), arguments: obj_class the class of the object, obj can be None txt_tree total dependency string (example MasterFlatFrame.DomeFlatFrame)
-