purple-father-70173
04/15/2025, 5:29 PMpurple-father-70173
04/15/2025, 5:31 PMclean-glass-36808
04/15/2025, 5:36 PMclean-glass-36808
04/15/2025, 5:38 PMhead_pod_spec = {
"containers": [
{
"name": "ray-head",
"resources": {"requests": {"cpu": "1", "memory": "4Gi"}, "limits": {"cpu": "1", "memory": "4Gi"}},
}
]
}
worker_a_pod_spec = {
"containers": [
{
"name": "ray-worker",
"resources": {"requests": {"cpu": "1", "memory": "3Gi"}, "limits": {"cpu": "1", "memory": "3Gi"}},
}
]
}
worker_b_pod_spec = {
"containers": [
{
"name": "ray-worker",
"resources": {"requests": {"cpu": "1", "memory": "2Gi"}, "limits": {"cpu": "1", "memory": "2Gi"}},
}
]
}
ray_config = RayJobConfig(
head_node_config=HeadNodeConfig(ray_start_params={"log-color": "True"}, k8s_pod=K8sPod(pod_spec=head_pod_spec)),
worker_node_config=[
WorkerNodeConfig(group_name="ray-group-a", replicas=1, k8s_pod=K8sPod(pod_spec=worker_a_pod_spec)),
WorkerNodeConfig(group_name="ray-group-b", replicas=2, k8s_pod=K8sPod(pod_spec=worker_b_pod_spec)),
],
shutdown_after_job_finishes=True,
ttl_seconds_after_finished=3600,
)
purple-father-70173
04/15/2025, 5:46 PMwith_overrides()
clean-glass-36808
04/15/2025, 5:48 PMpurple-father-70173
04/15/2025, 5:51 PMpurple-father-70173
04/15/2025, 5:55 PM@task(
container_image=custom_image,
task_config=RayJobConfig(
head_node_config=xxxx,
worker_node_config=yyyy,
shutdown_after_job_finishes=True,
),
pod_template_name=<>,
)
def task_fun()
I am trying to override this as follows, during the task call:
custom_task_config = RayJobConfig(
head_node_config=xxxx,
worker_node_config=zzzz,
shutdown_after_job_finishes=True,
)
task_fun(task_params).with_overrides(task_config=custom_task_config)
purple-father-70173
04/15/2025, 6:09 PMwith open('config.yaml', 'r', encoding='utf-8') as f:
config = yaml.safe_load(f)
@task(
container_image=RL_IMAGE,
task_config=RayJobConfig(
head_node_config=config['head_config'],
worker_node_config=config['worker_config'],
shutdown_after_job_finishes=True,
),
I guess I'm more asking how developers are currently dynamically setting task configurationsfreezing-airport-6809
purple-father-70173
04/15/2025, 6:37 PMcool-lifeguard-49380
04/16/2025, 6:52 AMwith_overrides
is unfortunately not supported yet.
you can only adjust config in dynamicA dynamic task wrapping a single pytorch task with a single with_overrides. Not multiple uses of with_overrides.
freezing-airport-6809