xqute.job
class
xqute.job.
Job
(
index
, cmd
, metadir=PosixPath('.xqute')
, error_retry=None
, num_retries=None
)
The abstract class for job
Attributes
CMD_WRAPPER_SHELL
— The shell to run the wrapped scriptCMD_WRAPPER_TEMPLATE
— The template for job wrapping_error_retry
— Whether we should retry if error happened_num_retries
— Total number of retries_rc
— The return code of the job_status
— The status of the job_wrapped_cmd
— The wrapped cmd, used for job submissioncmd
— The commandhook_done
— Mark whether hooks have already been. Since we don't havea trigger for job finished/failed, so we do a polling on it. This is to avoid calling the hooks repeatedlyindex
— The index of the jobjid
— The jid of the job in scheduler systemjid
(int | str | none) — Get the jid of the job in scheduler system</>jid_file
(Path) — The jid file of the job</>metadir
— The metadir of the jobrc
(int) — The return code of the job</>rc_file
(Path) — The rc file of the job</>retry_dir
(Path) — The retry directory of the job</>status
(int) — Query the status of the job
If the job is submitted, try to query it from the status file Make sure the status is updated by trap in wrapped script </>status_file
(Path) — The status file of the job</>stderr_file
(Path) — The stderr file of the job</>stdout_file
(Path) — The stdout file of the job</>strcmd
(str) — Get the string representation of the command</>trial_count
— The count for re-tries
Parameters
index
(int) — The index of the jobcmd
(Union) — The command of the jobmetadir
(PathLike, optional) — The meta directory of the Joberror_retry
(Optional, optional) — Whether we should retry if error happenednum_retries
(Optional, optional) — Total number of retries
method
__repr__
(
)
→ str
repr of the job
method
shebang
(
scheduler
)
→ str
The shebang of the wrapped script
method
clean
(
retry=False
)
Clean up the meta files
Parameters
retry
(optional) — Whether clean it for retrying
method
wrapped_script
(
scheduler
)
Get the wrapped script
Parameters
scheduler
(Scheduler) — The scheduler
Returns (PathLike)
The path of the wrapped script