|
18 | 18 | cluster setup queue, a list of all existing clusters, and the user's working namespace. |
19 | 19 | """ |
20 | 20 |
|
21 | | -from time import sleep |
22 | | -from typing import List, Optional, Tuple, Dict |
23 | 21 | import copy |
24 | | - |
25 | | -from ray.job_submission import JobSubmissionClient, JobStatus |
| 22 | +import os |
26 | 23 | import time |
27 | 24 | import uuid |
28 | 25 | import warnings |
| 26 | +from time import sleep |
| 27 | +from typing import Dict, List, Optional, Tuple |
29 | 28 |
|
30 | | -from ...common.utils import get_current_namespace |
| 29 | +import requests |
| 30 | +import yaml |
| 31 | +from kubernetes import client |
| 32 | +from kubernetes import client as k8s_client |
| 33 | +from kubernetes import config |
| 34 | +from kubernetes.client.rest import ApiException |
| 35 | +from kubernetes.dynamic import DynamicClient |
| 36 | +from ray.job_submission import JobStatus, JobSubmissionClient |
31 | 37 |
|
32 | | -from ...common.kubernetes_cluster.auth import ( |
33 | | - config_check, |
34 | | - get_api_client, |
35 | | -) |
| 38 | +from ...common import _kube_api_error_handling |
| 39 | +from ...common.kubernetes_cluster.auth import config_check, get_api_client |
| 40 | +from ...common.utils import get_current_namespace |
| 41 | +from ...common.widgets.widgets import cluster_apply_down_buttons, is_notebook |
| 42 | +from ..appwrapper import AppWrapper, AppWrapperStatus |
36 | 43 | from . import pretty_print |
37 | 44 | from .build_ray_cluster import build_ray_cluster, head_worker_gpu_count_from_cluster |
38 | 45 | from .build_ray_cluster import write_to_file as write_cluster_to_file |
39 | | -from ...common import _kube_api_error_handling |
40 | | - |
41 | 46 | from .config import ClusterConfiguration |
42 | | -from .status import ( |
43 | | - CodeFlareClusterStatus, |
44 | | - RayCluster, |
45 | | - RayClusterStatus, |
46 | | -) |
47 | | -from ..appwrapper import ( |
48 | | - AppWrapper, |
49 | | - AppWrapperStatus, |
50 | | -) |
51 | | -from ...common.widgets.widgets import ( |
52 | | - cluster_apply_down_buttons, |
53 | | - is_notebook, |
54 | | -) |
55 | | -from kubernetes import client |
56 | | -import yaml |
57 | | -import os |
58 | | -import requests |
59 | | - |
60 | | -from kubernetes import config |
61 | | -from kubernetes.dynamic import DynamicClient |
62 | | -from kubernetes import client as k8s_client |
63 | | -from kubernetes.client.rest import ApiException |
64 | | - |
65 | | -from kubernetes.client.rest import ApiException |
| 47 | +from .status import CodeFlareClusterStatus, RayCluster, RayClusterStatus |
66 | 48 |
|
67 | 49 | CF_SDK_FIELD_MANAGER = "codeflare-sdk" |
68 | 50 |
|
@@ -555,7 +537,7 @@ def cluster_dashboard_uri(self) -> str: |
555 | 537 | ingress.metadata.name == f"ray-dashboard-{self.config.name}" |
556 | 538 | or ingress.metadata.name.startswith(f"{self.config.name}-ingress") |
557 | 539 | ): |
558 | | - if annotations == None: |
| 540 | + if annotations is None: |
559 | 541 | protocol = "http" |
560 | 542 | elif "route.openshift.io/termination" in annotations: |
561 | 543 | protocol = "https" |
@@ -883,7 +865,7 @@ def _check_aw_exists(name: str, namespace: str) -> bool: |
883 | 865 | def _get_ingress_domain(self): # pragma: no cover |
884 | 866 | config_check() |
885 | 867 |
|
886 | | - if self.config.namespace != None: |
| 868 | + if self.config.namespace is not None: |
887 | 869 | namespace = self.config.namespace |
888 | 870 | else: |
889 | 871 | namespace = get_current_namespace() |
@@ -1061,7 +1043,7 @@ def _map_to_ray_cluster(rc) -> Optional[RayCluster]: |
1061 | 1043 | ingress.metadata.name == f"ray-dashboard-{rc_name}" |
1062 | 1044 | or ingress.metadata.name.startswith(f"{rc_name}-ingress") |
1063 | 1045 | ): |
1064 | | - if annotations == None: |
| 1046 | + if annotations is None: |
1065 | 1047 | protocol = "http" |
1066 | 1048 | elif "route.openshift.io/termination" in annotations: |
1067 | 1049 | protocol = "https" |
|
0 commit comments