runtraj.execution.kubernetes.job_summary#
- runtraj.execution.kubernetes.job_summary(job)[source]#
Return what
runtraj statusshows of one Job, fromkubectl get jobs -o json.stateiscomplete,failed,suspendedorrunning, andreasonis Kubernetes’ reason for a failed Job, such asFailedIndexesorDeadlineExceeded.tasksis the Job’scompletions;done,failedandrunningcount its tasks, andfailed_taskslists the ones that gave up as Kubernetes writes them (1,4-6).Examples
>>> job = { ... "metadata": {"name": "runtraj-towers-x7k2p"}, ... "spec": {"completions": 8}, ... "status": {"completedIndexes": "0-5", "failedIndexes": "7", "active": 1}, ... } >>> summary = job_summary(job) >>> summary["state"], summary["done"], summary["failed_tasks"] ('running', 6, '7')