watcher
batch.watcher
COMPLETE_MATCH
module-attribute
COMPLETE_MATCH = "\\bRun time:\\s*\\d*\\s*hour.*\\d*\\s*minute.*\\d*\\s*second.*\\b"
REQUESTED_MATCH
module-attribute
REQUESTED_MATCH = '\\bRequested number of primaries NSTAT'
RUN_MATCH
module-attribute
RUN_MATCH = "\\bPrimary particle no.\\s*\\d*\\s*ETR:\\s*\\d*\\s*hour.*\\d*\\s*minute.*\\d*\\s*second.*\\b"
TIMEOUT_MATCH
module-attribute
TIMEOUT_MATCH = '\\bTimeout occured'
args
module-attribute
args = parse_args()
log_level
module-attribute
log_level = INFO
parser
module-attribute
parser = ArgumentParser()
log_generator
log_generator(thefile, event=None, timeout=3600)
Generator equivalent to tail -f
Linux command.
Yields new lines appended to the end of the file.
It no new line appears in timeout
seconds, generator stops.
Main purpose is monitoring of the log files
Source code in yaptide/batch/watcher.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
read_file
read_file(
filepath, sim_id, task_id, update_key, backend_url
)
Monitors log file of certain task
Source code in yaptide/batch/watcher.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
send_task_update
send_task_update(
sim_id, task_id, update_key, update_dict, backend_url
)
Sends task update to flask to update database
Source code in yaptide/batch/watcher.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|