Closed yarikoptic closed 4 years ago
The base executor just runs and then is done, so time stamp is just there to indicate a start time. If a child executor (based off of shell) expects to run longer and needs and end time, that executor would implement it.
I forgot to paste an example:
$> qme run bash -c 'date; sleep 2; date'
Database: sqlite
[shell-00d909b6-2119-4e97-8669-449f6786c8bd][returncode: 0]
$> qme show
usage: qme [-h] [--version] [--config_dir CONFIG_DIR] {version,config,clear,exec,generate-key,ls,run,rerun,search,start,get} ...
qme: error: argument command: invalid choice: 'show' (choose from 'version', 'config', 'clear', 'exec', 'generate-key', 'ls', 'run', 'rerun', 'search', 'start', 'get')
# doh -- `git show` and in general `show` keeps me away from `get` which is typically something taxing
$> qme get
Database: sqlite
{
"executor": "shell",
"uid": "shell-00d909b6-2119-4e97-8669-449f6786c8bd",
"data": {
"pwd": "/home/yoh/proj/qme",
"user": "yoh",
"timestamp": "2020-05-29 15:40:18.690043",
"output": [
"Fri 29 May 2020 03:40:16 PM EDT\n",
"Fri 29 May 2020 03:40:18 PM EDT\n"
],
"error": [],
"returncode": 0,
"pid": 2768296,
"cmd": [
"bash",
"-c",
"date; sleep 2; date"
],
"status": "complete"
},
"command": "bash -c date; sleep 2; date"
}
So from
"timestamp": "2020-05-29 15:40:18.690043",
"output": [
"Fri 29 May 2020 03:40:16 PM EDT\n",
"Fri 29 May 2020 03:40:18 PM EDT\n"
],
it seems to correspond to end time. Indeed base executor (or jobs "broker" of a kind) could record start time (only) and then specific implementation could report/record end time (some times it would need to be queried from e.g. PBS or alike).
I think this would need to be executor specific, so going to close the issue. The base executor (as we use here) is to be kept as simple as possible.
ATM there is only a
timestamp
which is actually the timestamp for completion of execution. Having both (e.g. "datetime_start", "datetime_end") would allow to report duration of execution and or search up for tasks by their start or end dates/times.