|
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 |
|
@@ -546,7 +528,7 @@ def cluster_dashboard_uri(self) -> str: |
546 | 528 | ingress.metadata.name == f"ray-dashboard-{self.config.name}" |
547 | 529 | or ingress.metadata.name.startswith(f"{self.config.name}-ingress") |
548 | 530 | ): |
549 | | - if annotations == None: |
| 531 | + if annotations is None: |
550 | 532 | protocol = "http" |
551 | 533 | elif "route.openshift.io/termination" in annotations: |
552 | 534 | protocol = "https" |
@@ -874,7 +856,7 @@ def _check_aw_exists(name: str, namespace: str) -> bool: |
874 | 856 | def _get_ingress_domain(self): # pragma: no cover |
875 | 857 | config_check() |
876 | 858 |
|
877 | | - if self.config.namespace != None: |
| 859 | + if self.config.namespace is not None: |
878 | 860 | namespace = self.config.namespace |
879 | 861 | else: |
880 | 862 | namespace = get_current_namespace() |
@@ -1052,7 +1034,7 @@ def _map_to_ray_cluster(rc) -> Optional[RayCluster]: |
1052 | 1034 | ingress.metadata.name == f"ray-dashboard-{rc_name}" |
1053 | 1035 | or ingress.metadata.name.startswith(f"{rc_name}-ingress") |
1054 | 1036 | ): |
1055 | | - if annotations == None: |
| 1037 | + if annotations is None: |
1056 | 1038 | protocol = "http" |
1057 | 1039 | elif "route.openshift.io/termination" in annotations: |
1058 | 1040 | protocol = "https" |
|
0 commit comments