mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 00:12:08 +08:00
Small fixes for k8s.
This commit is contained in:
@@ -503,7 +503,7 @@ class KubernetesJobRunner(AsynchronousJobRunner):
|
||||
job.api.raise_for_status(r)
|
||||
|
||||
def __job_failed_due_to_walltime_limit(self, job):
|
||||
conditions = job.obj['status']['conditions']
|
||||
conditions = job.obj['status'].get('conditions') or []
|
||||
return any(True for c in conditions if c['type'] == 'Failed' and c['reason'] == 'DeadlineExceeded')
|
||||
|
||||
def __job_failed_due_to_low_memory(self, job_state):
|
||||
@@ -532,7 +532,7 @@ class KubernetesJobRunner(AsynchronousJobRunner):
|
||||
jobs = Job.objects(self._pykube_api).filter(
|
||||
selector="app=" + self.__produce_unique_k8s_job_name(job.get_id_tag()),
|
||||
namespace=self.runner_params['k8s_namespace'])
|
||||
if len(jobs.response['items']) >= 0:
|
||||
if len(jobs.response['items']) > 0:
|
||||
job_to_delete = Job(self._pykube_api, jobs.response['items'][0])
|
||||
self.__cleanup_k8s_job(job_to_delete)
|
||||
# TODO assert whether job parallelism == 0
|
||||
|
||||
Reference in New Issue
Block a user