Skip to content

Commit

Permalink
Reformat with black
Browse files Browse the repository at this point in the history
  • Loading branch information
almahmoud committed Jul 16, 2024
1 parent a02028c commit 8086c0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions lib/galaxy/jobs/runners/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,6 @@ def __job_failed_due_to_low_memory(self, job_state):

return False


def __check_job_pod_running(self, job_state):
"""
checks the state of the pod to see if it is unschedulable.
Expand All @@ -971,7 +970,6 @@ def __check_job_pod_running(self, job_state):
pod = Pod(self._pykube_api, pods.response["items"][0])
return is_pod_running(self._pykube_api, pod, self.runner_params["k8s_namespace"])


def __job_pending_due_to_unschedulable_pod(self, job_state):
"""
checks the state of the pod to see if it is unschedulable.
Expand Down
7 changes: 5 additions & 2 deletions lib/galaxy/jobs/runners/util/pykube_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ def find_pod_object_by_name(pykube_api, job_name, namespace=None):


def is_pod_running(pykube_api, pod, namespace=None):
is_running = not any(c.get("state", {}).get("running", {}).get("startedAt", False) == False for c in pod.obj["status"].get("containerStatuses", []))
is_running = not any(
c.get("state", {}).get("running", {}).get("startedAt", False) == False
for c in pod.obj["status"].get("containerStatuses", [])
)
if pod.obj["status"].get("phase") == "Running" and is_running:
return True

Expand Down Expand Up @@ -319,7 +322,7 @@ def galaxy_instance_id(params):
"find_pod_object_by_name",
"galaxy_instance_id",
"HTTPError",
"is_pod_running"
"is_pod_running",
"is_pod_unschedulable",
"Job",
"Service",
Expand Down

0 comments on commit 8086c0b

Please sign in to comment.