MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / submit

Method submit

crates/pyhq/python/hyperqueue/client.py:74–87  ·  view source on GitHub ↗

Submit a job into HyperQueue. :param job: Job that will be submitted.

(self, job: Job)

Source from the content-addressed store, hash-verified

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"""

Callers 15

test_long_chain_of_depsFunction · 0.95
test_single_depFunction · 0.45
test_dep_failedFunction · 0.45
test_submit_pyfunctionFunction · 0.45
test_function_resourcesFunction · 0.45
test_default_workdirFunction · 0.45
test_default_envFunction · 0.45

Calls 5

SubmittedJobClass · 0.85
submit_jobMethod · 0.80
infoMethod · 0.80
pluralizeFunction · 0.50
_buildMethod · 0.45

Tested by 15

test_long_chain_of_depsFunction · 0.76
test_single_depFunction · 0.36
test_dep_failedFunction · 0.36
test_submit_pyfunctionFunction · 0.36
test_function_resourcesFunction · 0.36
test_default_workdirFunction · 0.36
test_default_envFunction · 0.36