calypso.dispatchers.orchestrator.scheduler.shell module
- class calypso.dispatchers.orchestrator.scheduler.shell.Shell(name: str, executor: BaseExecutor, **kwargs)
Bases:
BaseScheduler
- generate_job_script(job: Job)
The outer interface to generate script according to the
job
.- Parameters:
job (Job) – A dict containing job information
Examples
>>> job = Job( name=name, job=job, job_id=None, state=JobStatus.unsubmitted, remote_root=machine.remoteroot, local_root=machine.localroot, machine_idx=machine.machine_idx, }
- Returns:
The shell script of this job.
- Return type:
- generate_task_env()
Env variables should be considered in this func for script.
- Returns:
env varibles command line.
- Return type:
- kill(job: Job)
kill a job and related child processes according to given job id.
- Parameters:
job (int) – job id to be killed.
- Returns:
tuple contains output, error and return code.
- Return type:
- Raises:
RuntimeError – error occurs when return code is not zero.
- query(job: Job)
check the job state. First is to check if the job is finished according to a file tag, if not, check the status according to the job id.
- Parameters:
job (dict) – A dict containing job information.
- Returns:
JobStatus – return job status.
- Return type:
- Raises:
RuntimeError – error occurs when return code is not zero.