Submit a job into HyperQueue. :param job: Job that will be submitted.
(self, job: Job)
| 72 | self.python_env = python_env |
| 73 | |
| 74 | def submit(self, job: Job) -> SubmittedJob: |
| 75 | """ |
| 76 | Submit a job into HyperQueue. |
| 77 | |
| 78 | :param job: Job that will be submitted. |
| 79 | """ |
| 80 | job_desc = job._build(self) |
| 81 | task_count = len(job_desc.tasks) |
| 82 | if task_count < 1: |
| 83 | raise Exception("Submitted job must have at least a single task") |
| 84 | |
| 85 | job_id = self.connection.submit_job(job_desc) |
| 86 | logging.info(f"Submitted job {job_id} with {task_count} {pluralize('task', task_count)}") |
| 87 | return SubmittedJob(job=job, id=job_id) |
| 88 | |
| 89 | def wait_for_jobs(self, jobs: Sequence[SubmittedJob], raise_on_error=True) -> bool: |
| 90 | """Returns True if all tasks were successfully finished""" |