Skip to content

xqute.job

module

xqute.job

Job to execute

Classes
  • Job(index, cmd, metadir, error_retry, num_retries) The abstract class for job</>
abstract 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 script
  • CMD_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 submission
  • cmd The command
  • hook_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 repeatedly
  • index The index of the job
  • jid The jid of the job in scheduler system
  • jid (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 job
  • rc (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 job
  • cmd (Union) The command of the job
  • metadir (PathLike, optional) The meta directory of the Job
  • error_retry (Optional, optional) Whether we should retry if error happened
  • num_retries (Optional, optional) Total number of retries
Methods
  • __repr__() (str) repr of the job</>
  • clean(retry) Clean up the meta files</>
  • wrap_cmd(scheduler) (str) Wrap the command for the scheduler to submit and run</>
  • wrapped_script(scheduler) (PathLike) Get the wrapped script</>
method

__repr__() → str

repr of the job

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

abstract method

wrap_cmd(scheduler) → str

Wrap the command for the scheduler to submit and run

Parameters
  • scheduler (Scheduler) The scheduler