From 105cd09826f200845b1459826016c9bb02164210 Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Mon, 5 Aug 2024 15:02:00 -0700 Subject: [PATCH] document the ray ttl_seconds_after_finished Signed-off-by: Kevin Su --- examples/ray_plugin/ray_plugin/ray_example.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/ray_plugin/ray_plugin/ray_example.py b/examples/ray_plugin/ray_plugin/ray_example.py index 17928e8d9..0eb8a31d6 100644 --- a/examples/ray_plugin/ray_plugin/ray_example.py +++ b/examples/ray_plugin/ray_plugin/ray_example.py @@ -55,6 +55,7 @@ def f(x): # - `replicas`: Specifies the desired number of replicas for the worker group. The default is 1. # - `group_name`: A RayCluster can host multiple worker groups, each differentiated by its name. # - `runtime_env`: The [runtime environment](https://docs.ray.io/en/latest/ray-core/handling-dependencies.html#runtime-environments) +# - `ttl_seconds_after_finished`: Shutdown Ray cluster after 1 hour of inactivity. # definition outlines the necessary dependencies for your Ray application to function. # This environment is dynamically installed on the cluster at runtime. # %% @@ -62,6 +63,8 @@ def f(x): head_node_config=HeadNodeConfig(ray_start_params={"log-color": "True"}), worker_node_config=[WorkerNodeConfig(group_name="ray-group", replicas=1)], runtime_env={"pip": ["numpy", "pandas"]}, # or runtime_env="./requirements.txt" + shutdown_after_job_finishes=True, + ttl_seconds_after_finished=3600, )