diff --git a/docs/cluster/auth.html b/docs/cluster/auth.html index dbec66ace..1beb27c77 100644 --- a/docs/cluster/auth.html +++ b/docs/cluster/auth.html @@ -54,6 +54,8 @@
codeflare_sdk.cluster.auth
codeflare_sdk.cluster.auth
codeflare_sdk.cluster.cluster
codeflare_sdk.cluster.cluster
codeflare_sdk.cluster.cluster
codeflare_sdk.cluster.cluster
+def evaluate_config(self)
+
def evaluate_config(self):
+ if not self.evaluate_dispatch_priority():
+ return False
+ else:
+ return True
+
+def evaluate_dispatch_priority(self)
+
def evaluate_dispatch_priority(self):
+ priority_class = self.config.dispatch_priority
+ if priority_class is None:
+ return True
+ else:
+ try:
+ config_check()
+ api_instance = client.CustomObjectsApi(api_config_handler())
+ priority_classes = api_instance.list_cluster_custom_object(
+ group="scheduling.k8s.io",
+ version="v1",
+ plural="priorityclasses",
+ )
+ available_priority_classes = [
+ i["metadata"]["name"] for i in priority_classes["items"]
+ ]
+ except Exception as e: # pragma: no cover
+ return _kube_api_error_handling(e)
+
+ if priority_class in available_priority_classes:
+ return True
+ else:
+ print(
+ f"Priority class {priority_class} is not available in the cluster"
+ )
+ return False
+
def from_k8_cluster_object(rc)
create_app_wrapper
details
down
evaluate_config
evaluate_dispatch_priority
from_k8_cluster_object
job_logs
job_status
codeflare_sdk.cluster.config
class ClusterConfiguration
-(name: str, namespace: str = None, head_info: list = <factory>, machine_types: list = <factory>, min_cpus: int = 1, max_cpus: int = 1, num_workers: int = 1, min_memory: int = 2, max_memory: int = 2, num_gpus: int = 0, template: str = '/home/runner/work/codeflare-sdk/codeflare-sdk/src/codeflare_sdk/templates/base-template.yaml', instascale: bool = False, envs: dict = <factory>, image: str = 'quay.io/project-codeflare/ray:2.5.0-py38-cu116', local_interactive: bool = False, image_pull_secrets: list = <factory>)
+(name: str, namespace: str = None, head_info: list = <factory>, machine_types: list = <factory>, min_cpus: int = 1, max_cpus: int = 1, num_workers: int = 1, min_memory: int = 2, max_memory: int = 2, num_gpus: int = 0, template: str = '/home/runner/work/codeflare-sdk/codeflare-sdk/src/codeflare_sdk/templates/base-template.yaml', instascale: bool = False, envs: dict = <factory>, image: str = 'quay.io/project-codeflare/ray:2.5.0-py38-cu116', local_interactive: bool = False, image_pull_secrets: list = <factory>, dispatch_priority: str = None)
This dataclass is used to specify resource requirements and other details, and @@ -122,10 +123,15 @@
var dispatch_priority : str
var envs : dict
ClusterConfiguration
dispatch_priority
envs
head_info
image
codeflare_sdk.utils.generate_yaml
codeflare_sdk.utils.generate_yaml
codeflare_sdk.utils.generate_yaml
codeflare_sdk.utils.generate_yaml
-def generate_appwrapper(name: str, namespace: str, min_cpu: int, max_cpu: int, min_memory: int, max_memory: int, gpu: int, workers: int, template: str, image: str, instascale: bool, instance_types: list, env, local_interactive: bool, image_pull_secrets: list)
+def generate_appwrapper(name: str, namespace: str, min_cpu: int, max_cpu: int, min_memory: int, max_memory: int, gpu: int, workers: int, template: str, image: str, instascale: bool, instance_types: list, env, local_interactive: bool, image_pull_secrets: list, dispatch_priority: str)
+def update_priority(item, dispatch_priority)
+
def update_priority(item, dispatch_priority):
+ if dispatch_priority is not None:
+ head = item.get("generictemplate").get("spec").get("headGroupSpec")
+ worker = item.get("generictemplate").get("spec").get("workerGroupSpecs")[0]
+ head["template"]["spec"]["priorityClassName"] = dispatch_priority
+ worker["template"]["spec"]["priorityClassName"] = dispatch_priority
+
def update_rayclient_route(route_item, cluster_name, namespace)
+def update_scheduling_spec(yaml, workers)
+
def update_scheduling_spec(yaml, workers):
+ spec = yaml.get("spec")
+ spec["schedulingSpec"]["minAvailable"] = workers + 1
+
def write_user_appwrapper(user_yaml, output_file_name)
update_labels
update_names
update_nodes
update_priority
update_rayclient_route
update_resources
update_scheduling_spec
write_user_appwrapper