Required
site| Type: | BaseExecutor |
| Description: | The site this job is to be run at. |
class Job(builtins.object):
def __init__(
self,
site: BaseExecutor,
commands: list[executor_utils.RemoteCommand],
job_type: str,
job_description: str,
job_info: dict,
jobname: str | None = None,
jobname_postfix: str = "",
is_debug_job: bool = False,
wall_time_in_seconds: salvus._core.types.float_ | None = None,
job_groups: list[str | salvus_flow_db.JobGroup] | None = None,
rundir_root: _RemotePathInputType | None = None,
tmpdir_root: _RemotePathInputType | None = None,
working_dir: _RemotePathInputType | None = None,
allow_uninitialized_site: bool = False,
requires_tmp_dir: bool = False,
initialize_on_site: bool = True,
no_db: bool = False,
): ...| Type: | BaseExecutor |
| Description: | The site this job is to be run at. |
| Type: | list[executor_utils.RemoteCommand] |
| Description: | A list of remote command objects. |
| Type: | str |
| Description: | The type of job. |
| Type: | str |
| Description: | Short textual description about the text. |
| Type: | dict |
| Description: | Additional information about the job. |
| Type: | str | None |
| Default value: | None |
| Description: | Name of the job. A random one will be created if none is given. |
| Type: | str |
| Default value: | '' |
| Description: | Optional postfix string for the job name. |
| Type: | bool |
| Default value: | False |
| Description: | True if this job should be executed in the fast/debug queue if the site has one. |
| Type: | salvus._core.types.float_ | None |
| Default value: | None |
| Description: | Wall time in seconds for the job. Not required for jobs on all sites. |
| Type: | list[str | salvus_flow_db.JobGroup] | None |
| Default value: | None |
| Description: | List of job groups names this job should be part of. |
| Type: | _RemotePathInputType | None |
| Default value: | None |
| Description: | Specify what parent folder the run directory will be created in. Defaults to the directory in the site config. |
| Type: | _RemotePathInputType | None |
| Default value: | None |
| Description: | Specify what parent folder the tmp directory will be created in. Defaults to the directory in the site config. |
| Type: | _RemotePathInputType | None |
| Default value: | None |
| Description: | Working directory. If not given it will be set to the job directory. Should only be set if the job is part of a job array. |
| Type: | bool |
| Default value: | False |
| Description: | Allows an uninitialized site - intended to only be used for the job that initializes the site. |
| Type: | bool |
| Default value: | False |
| Description: | The job does require a temporary directory. |
| Type: | bool |
| Default value: | True |
| Description: | Initialize on site. Should be true in most cases. False is useful for creating a Job object from the database. |
| Type: | bool |
| Default value: | False |
| Description: | Don't use the database. Only useful for jobs that initialize things that are required to populate the database. |
salvus_flow_db.DB)-The currently used database.str)-Returns the full name of a job as JOB_NAME@SITE_NAME.int)-Return the maximum number of ranks of all the individual commands.str)-Return the stderr of the job as a string._RemotePathType)-The stderr path of the job.str)-Return the stdout of the job as a string._RemotePathType)-The stdout path of the job.def cancel(self, verbosity: int = 1) -> None: ...| Type: | int |
| Default value: | 1 |
| Description: | Verbosity level. |
def create_random_job_name(prefix: str = "job") -> str: ...| Type: | str |
| Default value: | 'job' |
| Description: | Prefix to give some structure to the randomness. |
def delete(
self, verbosity: int = 1, allow_directory_deletion_failure: bool = False
) -> None: ...| Type: | int |
| Default value: | 1 |
| Description: | Verbosity level. |
| Type: | bool |
| Default value: | False |
| Description: | If True this function will still return successfully (but raise a warning) if the deletion of the remote Salvus managed files failed for some reason. This can easily happen on for example networked file systems. |
def get_status_from_db(self) -> JobStatus: ...def launch(
self, verbosity: int = 1, interactive_tty: bool = False
) -> None: ...| Type: | int |
| Default value: | 1 |
| Description: | Verbosity level. |
| Type: | bool |
| Default value: | False |
| Description: | Launch the job in an interactive terminal. Useful for debugging purposes. Only available for local sites. |
def set_status_in_db(self, status: JobStatus) -> None: ...| Type: | JobStatus |
| Description: | The status to be set. |
tail -f the stdout of the job.tail command and it only suitable for
interactive use.def tail_stdout(self) -> None: ...def update_status(
self,
progress_callback: collections.abc.Callable[[dict], None] | None = None,
force_update: bool = False,
) -> JobStatus: ...| Type: | collections.abc.Callable[[dict], None] | None |
| Default value: | None |
| Description: | Callback function which will receive some information about the update. |
| Type: | bool |
| Default value: | False |
| Description: | Jobs that are not running and not pending will by default only query the local job database and not check the remote site. In most cases this is correct as the jobs are done with and will not change again. Setting this to True will force an update nonetheless. Uses for this are for example if a job update fails for example due to a temporary network problem. |
def wait(
self,
poll_interval_in_seconds: salvus._core.types.float_ | None = None,
timeout_in_seconds: float | None = None,
verbosity: int = 1,
progress_callback: (
collections.abc.Callable[[dict | str], None] | None
) = None,
) -> JobStatus: ...| Type: | salvus._core.types.float_ | None |
| Default value: | None |
| Description: | If given, the site will be queried with this interval. Defaults to the site's default. |
| Type: | float | None |
| Default value: | None |
| Description: | Time in seconds after which this function will return, independent of the status. |
| Type: | int |
| Default value: | 1 |
| Description: | The verbosity level. |
| Type: | collections.abc.Callable[[dict | str], None] | None |
| Default value: | None |
| Description: | Optional progress callback function. Will be called if there are any status updates. Will currently only be called with the Salvus status file contents. |